Payment Page Redirect
Redirect the customer to the Pay by Bank experience hosted by Deutsche Bank after creating a payment.
Payment workflow
For the full sequence diagram, see Payment workflow on the Pay by Bank overview.
Implementation flow
- Make a Payment API request.
- Receive the API response with
client_action=redirect. - Redirect your customer to the
urlprovided inaction_data. - The customer selects their bank, authenticates with their bank, and authorises the payment.
- Customer is redirected back to your
success_urlorerror_url. - Receive asynchronous postback notifications to
postback_urlabout transaction status.
For a general walkthrough of credentials, authentication, and postbacks, see Get Started — Payment Page Redirect.
Create a payment
POST/rest/payment
/rest/paymentProduction URL
https://api.betterpayment.de/rest/paymentTest URL
https://testapi.betterpayment.de/rest/paymentpayment_typeStringrequiredpbborder_idStringrequiredAny alphanumeric string to identify the Merchant's order
amountFloatrequiredAmount of the transaction including all taxes and shipping fees
currencyStringrequired3 letter currency code
postback_urlStringrequiredThe URL for updates about transaction status are posted
success_urlStringrequiredWhere to redirect the user after a successful transaction
error_urlStringrequiredWhere to redirect the user after a failed transaction
This example includes only the minimum required parameters to create a Pay by Bank payment. See the Create Payment API reference for the full list of supported parameters.
Example RequestHTTP
POST /rest/payment
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"payment_type": "pbb",
"order_id": "PAYBYBANK-12345",
"amount": "29.90",
"currency": "EUR",
"postback_url": "https://your-postback.url.com",
"success_url": "https://your-success.url.com",
"error_url": "https://your-error.url.com"
}
Payment API Response
transaction_idStringID of the created transaction
payment_typeStringPayment type of the transaction
status_codeIntegerStatus code of the transaction
statusStringStatus of the transaction
order_idStringOrder ID of the transaction
messageStringOptional additional information about the transaction result. When declined, this field contains the decline code (e.g. AC01)
additional_transaction_dataStringAdditional transaction data provided by you. This will be shown in the dashboard as well as when you query for transaction data. It will also be sent back to your
postback_url as part of the postback data.amountFloatAmount of the transaction
included_feesStringIncluded fees for the transaction
error_codeIntegerError code for the response
client_actionStringIndicates the required client-side action after a payment request. Possible values: redirect (redirect to the
url 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_dataObjectPresent when
client_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).Example ResponseJSON
{
"transaction_id": "4d79a749-0f9e-4f77-8ac4-5acb2ac55b43",
"payment_type": "pbb",
"status_code": 1,
"status": "started",
"order_id": "PAYBYBANK-12345",
"message": null,
"additional_transaction_data": null,
"amount": 29.9,
"included_fees": "0.00",
"error_code": 0,
"client_action": "redirect",
"action_data": {
"url": "https://testapi.betterpayment.de/pay-by-bank/4d79a749-0f9e-4f77-8ac4-5acb2ac55b43"
}
}
Refund API
Create a refund
POST/rest/refund
/rest/refundProduction URL
https://api.betterpayment.de/rest/refundTest URL
https://testapi.betterpayment.de/rest/refundtransaction_idStringrequiredID of the transaction to be refunded
amountFloatRefunded amount. When omitted, full amount will be refunded
commentStringAny other reference that you would like to save in this refund request. Displayed in dashboard.
This example includes only the minimum required parameters to create a Pay by Bank refund. See the Create a Refund API reference for the full list of supported parameters.
Example RequestHTTP
POST /rest/refund
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"transaction_id": "4d79a749-0f9e-4f77-8ac4-5acb2ac55b43",
"amount": "29.90",
"comment": "Goods returned"
}
Refund API Response
note
The response is attributed to the Refund object — not the transaction. Thus, the status_code and status will differ from transaction values.
transaction_idStringID of the refunded transaction
refund_idStringID of the created refund object
statusStringStatus of the refund (STARTED, SUCCESS, ERROR)
status_codeIntegerStatus code of the refund (0 for STARTED, 1 for SUCCESS, 2 for ERROR)
error_codeIntegerError code for the response
Example ResponseJSON
{
"transaction_id": "4d79a749-0f9e-4f77-8ac4-5acb2ac55b43",
"refund_id": "d64f85aa-3c43-4f18-9a43-4d2b46ddbb2c",
"status_code": 1,
"status": "successful",
"error_code": 0
}
Postbacks
For the full list of payment postback fields, see the Payment API. For refund postbacks, see the Refund API. For retry policy and signature verification, see Postbacks.
Test Data
SEPA Capability Embedded Flow Test Bank
Step 1 (AIS)
- username:
max.mustermann - password:
12345 - otp:
987654
Step 2 (PIS)
- username:
max.mustermann - password:
12345 - otp:
111111