Make the Subsequent Payments

The API endpoint to create a Payment Transaction for SEPA direct debit is POST /api/v2/Payment/Secupaydebits. It is the same endpoint as for the initial payment.

The request looks much like that for the initial payment, except that we reuse the existing customer (customer/id), and pass the subscription ID (subscription.id) we have received for the first payment:

Request
POST /Payment/Secupaydebits HTTP/1.1
Host: connect-testing.secupay-ag.de
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
 
{
"demo": true,
"customer": {
"id": "PCU_28WPDZGR82X3GHFU0HR4G997HDSPA2"
},
"subscription": {
"id": 2404,
"purpose": "Gartengeräte-Club Mgl.-Nr. 452676"
},
"amount": 550,
"purpose": "Gartengeräte-Club Monatsgebühr",
"redirect_url": {
"url_success": "https://shop.example.com/checkout/payment/success",
"url_failure": "https://shop.example.com/checkout/payment/failure",
"url_push": "https://shop.example.com/order/payment/update"
}
}

This creates a Payment Transaction for SEPA direct debit about €5.50 for the same customer.

Monetary amounts are expressed in the smallest currency unit (e. g. Euro Cent).

If everything is fine, the API responds with 200 OK, and the representation of the Payment Transaction:

Response
HTTP/1.1 200 OK
Content-Type: application/json
...
 
{
"object": "payment.secupaydebits",
"id": "tirtekbawqel5221108",
"trans_id": 33922088,
"payment_id": "PCI_WH0VP4RWMCTUK03S4DNNPH4PP484N8",
"status": "accepted",
"amount": 550,
"currency": "EUR",
"purpose": "Gartenger\u00e4te-Club Monatsgeb\u00fchr",
"order_id": "9000112",
"transaction_status": 11,
"basket": null,
"accrual": false,
"payment_action": "sale",
"customer": {
"object": "payment.customers",
"id": "PCU_28WPDZGR82X3GHFU0HR4G997HDSPA2",
"merchant": {
"object": "general.merchants",
"id": "MRC_WVHJQFQ4JNVYNG5B55TYK748ZCHQP8"
},
"contact": {
"forename": "Catherine",
"surname": "Mustermann",
"companyname": "Musterfirma GmbH",
"name": "Catherine Mustermann",
"address": {
"street": "Prosaccostr.",
"street_number": "230",
"additional_address_data": "Whg. 714",
"postal_code": "09999",
"city": "Musterstadt",
"country": "DE"
},
"email": "Wooden50@example.net",
"mobile": "+49177555396390",
"phone": "+49555555819165",
"dob": "1965-12-31T00:00:00+01:00"
},
"created": "2021-04-09T19:16:44+02:00"
},
"redirect_url": {
"iframe_url": "https:\/\/api-dev6.secupay-ag.de\/payment\/tirtekbawqel5221108",
"url_success": "https:\/\/shop.example.com\/checkout\/payment\/success",
"url_failure": "https:\/\/shop.example.com\/checkout\/payment\/failure",
"url_push": "https:\/\/shop.example.com\/order\/payment\/update"
},
"iframe_url": "https:\/\/api-dev6.secupay-ag.de\/payment\/tirtekbawqel5221108",
"used_payment_instrument": {
"type": "bank_account",
"data": {
"owner": "",
"iban": "DE02 XXXX XXXX 4712",
"bic": "COKSDE33XXX",
"bankname": "Kreissparkasse K\u00f6ln"
}
},
"mandate": {
"identification": "OPI\/tirtekbawqel5221108",
"creditor_id": "DE17ZZZ00000011109"
},
"subscription": {
"id": 2404,
"purpose": "Gartenger\u00e4te-Club Mgl.-Nr. 452676"
}
}

When the field status contains accepted, everything is fine. Otherwise you need to respond.

Please also respond to later status changes, signalized by the callback API. A payment may also fail after it was accepted.