Payment API
POST/rest/payment
/rest/paymentProduction URL
https://api.betterpayment.de/rest/paymentTest URL
https://testapi.betterpayment.de/rest/paymentPayment API is used to create new payment transactions. It performs authorization and capture in a single step — the funds are authorized and captured immediately when the transaction is successful.
If you need to separate authorization from capture, use the Authorize API to reserve funds first, and then the Capture API to capture them later.
Payment API Parameters
Payment request parameters are divided into the following blocks. Depending on the payment method, accepted parameters may differ.
| Payment Method | Common | Billing Address | Redirection URLs | Cardholder Data |
|---|---|---|---|---|
| Card ECOM | Required | Required | Required | Required |
| Card POS | Required | Optional | - | Required |
| iDEAL | Required | Optional | Required | - |
| Pay by Bank | Required | Optional | Required | - |
| Wero | Required | Optional | Required | - |
Payment API Request
Common Parameters
The following parameters are used with all payment methods:
payment_typeStringrequiredorder_idStringrequiredinvoice_idStringinvoice_dateDateYYYY-MM-DDcustomer_idStringmerchant_referenceStringamountFloatrequiredshipping_costsFloatVATFloatcurrencyStringrequiredISO 4217). Defaults to EURpostback_urlStringrequiredlocaleStringISO 639-1additional_transaction_dataStringpostback_url as part of the postback dataPOST /rest/payment
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"payment_type": "cardecom",
"order_id": "122",
"invoice_id": "INV-2025-001",
"invoice_date": "2025-02-19",
"customer_id": "CUST-12345",
"merchant_reference": "Order 122 - My Shop",
"amount": "15.90",
"shipping_costs": "3.90",
"VAT": "2.54",
"currency": "EUR",
"postback_url": "https://your-postback.url.com",
"locale": "en",
"additional_transaction_data": "customer_id=123ABC"
}
Billing Address Parameters
Billing information is required in all payment methods.
addressStringrequiredaddress2StringcityStringrequiredpostal_codeStringrequiredstateStringcountryStringrequiredISO 3166-1 alpha-2 codefirst_nameStringrequiredlast_nameStringrequiredemailStringphoneString{
"address": "Rosenthalerstr. 8",
"address2": "Apt 3",
"city": "Berlin",
"postal_code": "10178",
"state": "Berlin",
"country": "DE",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@email.com",
"phone": "+49 30 1234567"
}
Redirection URL Parameters
For payment methods that make use of payment page redirects such as Wero or Card Acceptance, these URLs are required.
success_urlStringrequirederror_urlStringrequired{
"success_url": "https://your-success.url.com",
"error_url": "https://your-error.url.com"
}
The following data is appended to the redirect URL: order_id, transaction_id.
Postback URL works differently from the redirection URLs, since Postback does not use browser redirection.
Cardholder Data Parameters
There is an option to enable Server-to-Server Integration for merchants who use card payments. In that case, the API will not use redirection, but expects cardholder data as parameters in the payment or authorization request. This is a special feature that cannot incorporate 3DS verification, so its use is limited to special business cases. To use this feature, the merchant must have the appropriate level of PCI DSS compliance. Please contact Better Payment for further information about Server-to-Server Integration.
card_numberStringrequiredcard_holderStringrequiredcard_cvvStringrequiredcard_expiry_yearStringrequiredcard_expiry_monthStringrequiredcard_entryStringe-commerce, manual, card-on-file, token, token-on-file. See the default mapping table below.charge_orderStringcheckout, unspecified, mail, phone, one-click, recurring, ucof, installment, standing-order. See the default mapping table below.clearing_modeStringauto (the transaction is cleared instantly), manual (the transaction is cleared when the Capture API is called). Defaults to manual for authorizations and auto for payments.clear_afterStringclearing_mode behavior.sca_exemption_requestStringtra (Transaction Risk Analysis), low-value (Low Value Payment), scp (Secure Corporate Payment). Exemption requests may or may not be honored by the issuer. Depending on the outcome, the acquirer will respond with the appropriate flow — skipping 3DS entirely, making it frictionless, etc.threeds_authentication_valueStringthreeds_authentication_value and threeds_directory_server_trans_id are provided, the gateway will skip its own 3DS verification and use the provided values instead.threeds_directory_server_trans_idStringthreeds_authentication_value.{
"card_number": "4761070000000509",
"card_holder": "John Doe",
"card_cvv": "196",
"card_expiry_year": "2026",
"card_expiry_month": "12"
}
Default values for card_entry and charge_order:
| Payment Method | card_entry | charge_order |
|---|---|---|
| Apple Pay | token | checkout |
| Google Pay (with cryptogram) | token | checkout |
| Google Pay (PAN only, no cryptogram) | e-commerce | checkout |
| Card (one-time) | e-commerce | checkout |
| Card (recurring) | card-on-file | ucof |
| Click to Pay (with cryptogram) | token | checkout |
| Click to Pay (PAN only) | e-commerce | checkout |
Recurring Payment Parameters
Some payment methods can use recurring payments. For card payments, authorizations can be recurring as well. Here is a summary of the recurring payment flow:
- Create a regular payment with a special parameter:
recurring = 1 - Store the
transaction_idparameter from the response of the first payment request - Create any number of repeat payments with the following parameters:
recurring = 1andoriginal_transaction_id= transaction_id from the first transaction
recurringInteger1 when making a recurring paymentoriginal_transaction_idStringtransaction_id returned from the initial payment or registration response{
"recurring": 1,
"original_transaction_id": "5e02903b-0fbf-4266-affd-dc58f2749cd1"
}
Payment API Response
transaction_idStringpayment_typeStringstatus_codeIntegerstatusStringorder_idStringmessageStringadditional_transaction_dataStringpostback_url as part of the postback data.amountFloatincluded_feesStringerror_codeIntegerclient_actionStringurl in action_data) or postform (build and submit a POST form using the data in action_data). When not returned, no client-side action is required.action_dataObjectclient_action is specified. Contains: url (target URL of the action) and, in case of a postform, fields (key/value pairs of the data to be posted).{
"transaction_id": "88593bcc-d819-4347-84d1-ebfec3806a24",
"payment_type": "cardecom",
"status_code": 1,
"status": "started",
"order_id": "123000",
"message": null,
"additional_transaction_data": "customer_id=123ABC, billing_info=123",
"amount": 15.9,
"included_fees": "0.00",
"error_code": 0,
"client_action": "redirect",
"action_data": {
"url": "https://some-target-url"
}
}
Postbacks
When a payment is completed or its status changes, the API sends an HTTP POST request to the postback_url provided in the payment request. This allows your system to receive real-time payment updates — even if the customer does not return to your website after checkout.
All postback URLs must use HTTPS and support TLS 1.2 or higher. Non-secure or HTTP URLs will be rejected.
Payment Postback — Completed
transaction_idStringpayment_typeStringstatus_codeIntegerstatusStringorder_idStringmessageStringremittance_infoStringwallet_activity_referenceStringwallet_account_referenceStringpayer_locationStringadditional_transaction_dataStringamountFloatincluded_feesStringexternal_transaction_idStringnetwork_token_idStringnetwork_token_statusStringrequested, active, suspended, failed, archive_pending, or archived. Only present when network_token_id is included.checksumString{
"transaction_id": "d1bf9fdf-7268-406f-9e08-8d5a9540ab97",
"payment_type": "wero",
"status_code": 3,
"status": "completed",
"order_id": "12345678",
"message": "CAPTURE SETTLED",
"remittance_info": "12345678 - Test Shop",
"wallet_activity_reference": "WARf47ac10b58cc",
"wallet_account_reference": "WAC50000aW12",
"payer_location": "DE",
"additional_transaction_data": "customer_id=123ABC, billing_info=12345678",
"amount": 15.90,
"included_fees": "0.00",
"external_transaction_id": "0I66TOoXap2bNLZ2m89tm1",
"checksum": "73a93b8a2d5260f592d98e386c4e5784ee551d1c"
}
Payment Postback — Declined
transaction_idStringpayment_typeStringstatus_codeIntegerstatusStringorder_idStringmessageStringreason_codeStringwallet_activity_referenceStringwallet_account_referenceStringpayer_locationStringadditional_transaction_dataStringamountFloatincluded_feesStringchecksumString{
"transaction_id": "bfe9cff7-8cd9-4976-9236-21253c1f40c1",
"payment_type": "wero",
"status_code": 6,
"status": "declined",
"order_id": "123010",
"message": "CAPTURE REJECTED",
"reason_code": "AC01",
"wallet_activity_reference": "WARf47ac10b58cc",
"wallet_account_reference": "WAC50000aW12",
"payer_location": "DE",
"additional_transaction_data": "customer_id=123ABC, billing_info=12345678",
"amount": 10.00,
"included_fees": "0.00",
"checksum": "d56fe31a1a38e06337672ca781e4cb6f3b83fd11"
}
For details on retry policy and signature verification, see Postbacks.