Skip to content

Last updated: November 9, 2022

We offer Alma's Pay Later payment solution, allowing your customers to split the payment into multiple installments.

Information

To start accepting Alma payments, contact your Customer Success Manager.

Model

Gateway

Payment flow

Redirect

Payment method type

Buy now, pay later (BNPL)

One-step payment

check

Authorization

error

Capture

error

Refund

check

Partial refund

check

Chargeback

error

Recurring payment

error

Alma has a 2-step process:

  1. Request a payment
  2. Redirect the customer

Request a payment

For the full API specification, see the API reference.

post

https://api.checkout.com/payments

Request example

If a customer ID or email is not provided in the request, we automatically create a customer profile and return the customer ID in the response.

1
{
2
"amount": 6001,
3
"currency": "EUR",
4
"source": {
5
"type": "alma",
6
"billing_address": {
7
"address_line1": "123 High St.",
8
"address_line2": "Flat 456",
9
"city": "London",
10
"zip": "SW1A 1AA",
11
"country": "GB"
12
}
13
},
14
"failure_url": "https://example.com/payments/failure",
15
"success_url": "https://example.com/payments/success",
16
"reference": "ORD-5023-4E89",
17
"customer": {
18
"name": "John Smith",
19
"email": "john.smith@example.com",
20
"phone": {
21
"country_code": "+44",
22
"number": "1234 567890"
23
}
24
},
25
"shipping": {
26
"address": {
27
"address_line1": "123 High St.",
28
"address_line2": "Flat 456",
29
"city": "London",
30
"zip": "SW1A 1AA",
31
"country": "GB"
32
}
33
},
34
"capture": true
35
}

Response example

If you receive a 202 Accepted response with a payment id and a status field set to Pending, your request was successful.

1
{
2
"id": "pay_uexsi2rik7ceppidytigjmxshi",
3
"status": "Pending",
4
"reference": "ORD-5023-4E89",
5
"customer": {
6
"id": "cus_rckdrxsk5j7efn7slcem7rofve",
7
"email": "john.smith@example.com",
8
"name": "John Smith",
9
"phone": {
10
"number": "1234 567890",
11
"country_code": "+44"
12
}
13
},
14
"processing": {
15
"partner_payment_id": "payment_11uwPpq2eBVJV3QMphBQk2OIsUnkE1sKay"
16
},
17
"_links": {
18
"self": {
19
"href": "https://api.sandbox.checkout.com/payments/pay_uexsi2rik7ceppidytigjmxshi"
20
},
21
"redirect": {
22
"href": "https://pay.staging.getalma.eu/11uwPpq2eBVJV3QMphBQk2OIsUnkE1sKay"
23
}
24
}
25
}

Redirect the customer

Redirect your customer to the redirect link’s href in the response. This will allow the customer to authorize the payment, before they are transferred to your predefined success or failure URL.


Get details about a payment

You can retrieve details about an existing Alma payment with the following endpoint.

Use the details below to set up your request.

Endpoints

For the full API specification, see the API reference.

post

https://api.checkout.com/payments/{id}

Response example

1
{
2
"id": "pay_uexsi2rik7ceppidytigjmxshi",
3
"requested_on": "2022-07-11T08:59:44.7324985Z",
4
"source": {
5
"type": "alma"
6
},
7
"amount": 6001,
8
"currency": "EUR",
9
"payment_type": "Regular",
10
"reference": "ORD-5023-4E89",
11
"status": "Pending",
12
"customer": {
13
"id": "cus_rckdrxsk5j7efn7slcem7rofve",
14
"email": "john.smith@example.com",
15
"name": "John Smith",
16
"phone": {
17
"country_code": "+44",
18
"number": "1234 567890"
19
}
20
},
21
"shipping": {
22
"address": {
23
"address_line1": "123 High St.",
24
"address_line2": "Flat 456",
25
"city": "London",
26
"zip": "SW1A 1AA",
27
"country": "GB"
28
}
29
},
30
"processing": {
31
"partner_payment_id": "payment_11uwPpq2eBVJV3QMphBQk2OIsUnkE1sKay"
32
},
33
"_links": {
34
"redirect": {
35
"href": "https://pay.staging.getalma.eu/11uwPek5EdoeqjdWXtgCUaqvSROlz7T2WD"
36
},
37
"self": {
38
"href": "https://api.sandbox.checkout.com/payments/pay_uexsi2rik7ceppidytigjmxshi"
39
},
40
"actions": {
41
"href": "https://api.sandbox.checkout.com/payments/pay_uexsi2rik7ceppidytigjmxshi/actions"
42
}
43
}
44
}

Refund a payment

Alma supports both partial and full refunds. You can refund a payment through the Dashboard or using the refund API.

post

https://api.checkout.com/payments/{id}/refunds

Request example

1
{
2
"amount": 10
3
}

Response example

1
{
2
"action_id": "act_f544khcfnyqudh3l73qwnnvfbi",
3
"_links": {
4
"payment": {
5
"href": "https://api.sandbox.checkout.com/payments/pay_uexsi2rik7ceppidytigjmxshi"
6
}
7
}
8
}

Cancel a payment

Once a payment is created, you cannot void it. If you wish to void a payment in progress, please wait for the payment_captured webhook, and then process a refund. Communicating this in advance to your end customer can help you avoid chargebacks.

If the customer cancels or fails to complete their payment, we will send a payment_expired webhook.


Webhooks

You may receive the following webhooks when using Alma. View all of our webhook notifications.

WebhookDescription

payment_pending

Sent when a payment request has been successfully initiated.

payment_expired

Sent when a payment request has expired.

payment_declined

Sent when a payment request has been rejected.

payment_captured

Sent when the payment has been successfully captured.

payment_refunded

Sent when the payment has been (fully or partially) refunded.

payment_refund_declined

Sent when a refund has been declined.


Testing Alma

To start testing, you'll need to contact your Customer Success Manager or Implementation Engineer to activate Alma payments in the sandbox environment.

  1. Create an Alma transaction as above, following the redirect link in the response to Alma’s website.
  2. Enter the name and the test card details that we have provided you with.
  3. Enter the test phone numbers that we have provided you with. Confirm the message code you received on the test phone number.
  4. Select Submit. You should then be redirected to your predefined success URL.