Skip to content

Accept a Payment

Create and process a checkout for a single card payment.

This guide covers single payments over SumUp API, using customer-entered card details without associating it with a specific customer saved for the merchant user’s account. Ideal for quick checkout processing if you don’t want to use our Payment Widget.

You will go through the following steps:

  1. Create a checkout
  2. Complete a checkout

When you complete these steps, you will have processed a payment with a payment card entered by a customer.

To create a new checkout resource, make a POST request to the https://api.sumup.com/v0.1/checkouts endpoint.

Attribute nameDescription
checkout_referenceA unique string identifying the payment in your system. It must be unique for your application.
amountThe amount for which the payment is made.
currencyThe three-letter ISO4217 code of the payment currency. It must match the currency registered for the specified merchant (see merchant_code).
merchant_codeThe code of the registered SumUp merchant the payment is made.

Example request:

curl -X POST \
https://api.sumup.com/v0.1/checkouts \
-H "Authorization: Bearer $SUMUP_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"merchant_code": "ME7RMQN3",
"amount": 15.0,
"currency": "EUR",
"checkout_reference": "unique-checkout-ref-123"
}'

The response contains a JSON body with the details of the created checkout resource. Note the identifier of the resource - you will need it for all operations on the resource, such as processing the payment in the next step.

The resource identifier is returned in the id attribute, or f14425c6-8bc1-4d02-957c-47573f762828 in the sample response below. The status attribute shows that the payment for this resource is pending and will be processed when you complete the checkout with the payment instrument details.

{
"checkout_reference": "CO746453",
"amount": 10,
"currency": "EUR",
"merchant_code": "ME7RMQN3",
"description": "Sample one-time payment",
"id": "f14425c6-8bc1-4d02-957c-47573f762828",
"status": "PENDING",
"date": "2018-09-28T13:47:01.832Z",
"transactions": []
}

To process the checkout and trigger the payment, make a PUT request to the https://api.sumup.com/v0.1/checkouts/{id} endpoint, where the value of the {id} path parameter is the identifier of the checkout resource.

The request body should be a JSON object with the payment type (card) and the payment card details. For more information about the request, see the API Reference.

Example request for Step 1 checkout:

curl -X PUT \
https://api.sumup.com/v0.1/checkouts/f14425c6-8bc1-4d02-957c-47573f762828 \
-H "Authorization: Bearer $SUMUP_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"payment_type": "card",
"card": {
"name": "Boaty McBoatface",
"number": "4200000000000042",
"expiry_month": "12",
"expiry_year": "23",
"cvv": "123"
}
}'

The response contains a JSON body with the details of the processed checkout resource in which the attributes related to the payment outcome are populated:

{
"checkout_reference": "CO746453",
"amount": 10.0,
"currency": "EUR",
"merchant_code": "ME7RMQN3",
"description": "Sample one-time payment",
"id": "f14425c6-8bc1-4d02-957c-47573f762828",
"status": "PAID",
"date": "2018-09-28T13:47:01.832Z",
"transaction_code": "TFDCP3FLQ7",
"transaction_id": "19aa3cca-89f6-42d2-b462-463b0b53e959",
"transactions": [
{
"id": "19aa3cca-89f6-42d2-b462-463b0b53e959",
"transaction_code": "TFDCP3FLQ7",
"merchant_code": "ME7RMQN3",
"amount": 10.0,
"vat_amount": 0.0,
"tip_amount": 0.0,
"currency": "EUR",
"timestamp": "2018-09-28T13:48:28.768Z",
"status": "SUCCESSFUL",
"payment_type": "ECOM",
"entry_mode": "CUSTOMER_ENTRY",
"installments_count": 1,
"auth_code": "585388",
"internal_id": 24118507
}
]
}

You have made a payment with a payment card entered by a customer without associating it with a specific customer saved for a merchant user’s account. If the payment is successful, the funds will be transferred to the merchant user according to the configured account settings.