Make the Initial Payment

The API endpoint to create a Payment Transaction for SEPA direct debit is POST https://connect.secucard.com/api/v2/Payment/Secupaydebits:

Request
POST /api/v2/Payment/Secupaydebits HTTP/1.1
Host: connect-testing.secupay-ag.de
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
 
{
"demo": true,
"payment_action": "sale",
"customer": {
"contact": {
"companyname": "Musterfirma GmbH",
"forename": "Catherine",
"surname": "Mustermann",
"phone": "+49 555 555819165",
"mobile": "+49 177 555396390",
"address": {
"street": "Prosaccostr.",
"street_number": "230",
"additional_address_data": "Whg. 714",
"postal_code": "09999",
"city": "Musterstadt",
"country": "DE"
},
"email": "Wooden50@example.net",
"dob": "1965-12-31"
}
},
"subscription": {
"purpose": "Gartengeräte-Club Mgl.-Nr. 452676"
},
"amount": 2495,
"currency": "EUR",
"purpose": "Gartengeräte-Club Beitrittsgebühr",
"order_id": "9000112",
"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 €24.95. The customer is preset with the previously created object.

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": "phowiujqwmxi5221107",
"trans_id": 33922087,
"payment_id": "PCI_MAAU6P5F46GRJ5QW4QZVSP4PP484N7",
"status": "internal_server_status",
"amount": 2495,
"currency": "EUR",
"purpose": "Gartenger\u00e4te-Club Beitrittsgeb\u00fchr",
"order_id": "9000112",
"transaction_status": 1,
"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\/phowiujqwmxi5221107",
"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\/phowiujqwmxi5221107",
"subscription": {
"id": 2404,
"purpose": "Gartenger\u00e4te-Club Mgl.-Nr. 452676"
}
}

Now you need to direct the customer to the payment iframe (redirect_url/iframe_url) in order to complete the process. This is explained in detail in the Getting Started part.

When the payment is successful, the customer is directed back to the URL you set as redirect_url/url_success. If the customer quits the process, or the payment cannot be authenticated, he is returned to redirect_url/url_failure.