Checkout API
POST/rest/checkouts
/rest/checkoutsCheckout API is used to create checkout sessions where merchants don't have their own checkout page. This way, merchants can easily share payment links with their customers, where they can select one of the available payment methods and fill in their information to pay for a product or a service.
Checkout API is a low-code solution for merchants to accept payments from their customers. When creating a checkout link, configured payment methods in your merchant account will be available for the customers to choose from — including Google Pay, Apple Pay, and Click to Pay if enabled.
The hosted checkout page is available in multiple languages. See Locales for the full list.
Checkout API Request
merchant_nameStringrequiredorder_idStringrequiredreferenceStringdescriptionStringcurrencyStringrequiredrecurringIntegerrecurring_optionalInteger0 or 1). Requires recurring: 1. See Recurring payments belowamountFloatrequiredamount_taxesFloatamount_shippingFloatamount_feesFloattotal_amountFloatrequiredcopyright_textStringcopyright_linkStringimprint_urlStringdata_privacy_urlStringterms_and_conditions_urlStringcollect_dobInteger0 or 1)collect_phoneInteger0 or 1)collect_genderInteger0 or 1)collect_shipping_addressInteger0 or 1)collect_billing_addressInteger0 or 1)display_transaction_detailsInteger0 or 1)display_manual_payment_instruction_to_customerInteger0 or 1)payment_instruction_merchant_account_holderStringpayment_instruction_merchant_ibanStringpayment_instruction_merchant_bicStringsuccess_urlStringrequirederror_urlStringrequiredpostback_urlStringrequiredPOST /rest/checkouts
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"merchant_name": "Merchant Name",
"order_id": "ORD001",
"reference": "Some reference",
"description": "Description about the product or service",
"currency": "EUR",
"recurring": 0,
"recurring_optional": 0,
"amount": 10,
"amount_taxes": 2,
"amount_shipping": 1,
"amount_fees": 0,
"total_amount": 13,
"copyright_text": "Merchant Name",
"copyright_link": "https://merchant.example.com",
"imprint_url": "https://merchant.example.com/imprint",
"data_privacy_url": "https://merchant.example.com/privacy",
"terms_and_conditions_url": "https://merchant.example.com/terms",
"collect_dob": 0,
"collect_phone": 1,
"collect_gender": 0,
"collect_shipping_address": 0,
"collect_billing_address": 1,
"display_transaction_details": 1,
"success_url": "https://your-success.url.com",
"error_url": "https://your-error.url.com",
"postback_url": "https://your-postback.url.com"
}
Prefill Customer Info Parameters
You can optionally prefill customer information by including a prefill_customer_info object:
prefill_customer_info.emailStringprefill_customer_info.phoneStringprefill_customer_info.companyStringprefill_customer_info.first_nameStringprefill_customer_info.last_nameStringprefill_customer_info.addressStringprefill_customer_info.address2Stringprefill_customer_info.cityStringprefill_customer_info.stateStringprefill_customer_info.postal_codeStringprefill_customer_info.countryStringprefill_customer_info.ibanStringprefill_customer_info.bicStringprefill_customer_info.account_holderStringprefill_customer_info.sepa_mandateString{
"prefill_customer_info": {
"email": "john.doe@email.com",
"phone": "+49 30 1234567",
"company": "My Company",
"first_name": "John",
"last_name": "Doe",
"address": "Rosenthalerstr. 8",
"address2": "Apt 3",
"city": "Berlin",
"state": "Berlin",
"postal_code": "10178",
"country": "DE",
"iban": "DE89370400440532013000",
"bic": "COBADEFFXXX",
"account_holder": "John Doe",
"sepa_mandate": "mandate-reference"
}
}
Recurring payments
Use recurring and recurring_optional to control how recurring billing works on the hosted checkout page.
Forced recurring mode
Set recurring: 1 and recurring_optional: 0:
- Only payment methods that support recurring payments are shown.
- Every completed payment is created as a recurring transaction.
- Use this when the checkout is always for a subscription or when you will trigger follow-up charges via the Payment API using
original_transaction_id.
Optional recurring (payer opt-in)
Set both recurring: 1 and recurring_optional: 1:
- All payment methods configured for your merchant account are shown.
- Recurring-capable methods display a recurring badge.
- The payer can opt in on the review step to save payment details for future recurring charges.
- If the payer does not opt in, the payment is processed as a one-time transaction.
recurring_optional: 1 alone is not sufficient — you must also pass recurring: 1.
Checkout API Response
checkout_idStringerror_codeIntegerstatusStringopen)client_actionStringurl in action_dataaction_dataObjecturl — the checkout page URL to redirect the customer to{
"checkout_id": "7a87a507-91e8-4882-9b2d-19f35434d946",
"error_code": 0,
"status": "open",
"client_action": "redirect",
"action_data": {
"url": "https://testapi.betterpayment.de/rest/checkouts/7a87a507-91e8-4882-9b2d-19f35434d946"
}
}