Obtain transaction status and details

You can obtain the status of a Payment Transaction making a GET request to /payment/status. You need to pass the API key and transaction hash.

Request
POST /payment/status HTTP/1.1
Host: api-testing.secupay-ag.de
Content-Type: application/json; charset=utf-8;
Accept: application/json
Accept-Charset: utf-8
 
{
"data": {
"apikey": "6801fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7ace",
"hash": "tujevzgobryk3303"
}
}

The response contains some meta information about the transaction.

Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8;
...
 
{
"status": "ok",
"data": {
"hash": "tujevzgobryk3303",
"status": "accepted",
"created": "2013-06-10 10:27:42",
"demo": 0,
"trans_id": "1831201",
"amount": "100",
"opt": {
}
},
"errors": null
}

The status contained in the data part of the response must be "accepted" after forwarding to url_success. Exception: for advance payment and pre-authorized transactions the status can be "proceed". It is recommended, after forwarding to url_success, to verify the status "accepted" or "proceed" by a status query. Read more details about the status in the following section Payment Status.

If the payment method is invoice or prepaid, then the subordinate object "opt" contains additional details.

Example response body of a prepaid transaction (advance payment):

{
"status": "ok",
"data": {
"hash": "tujevzgobryk3303",
"status": "proceed",
...
"opt": {
"recipient_legal": "secupay AG, Goethestraße 6, 01896 Pulsnitz",
"payment_link": "https://api.secupay.ag/payment/tujevzgobryk3303",
"payment_qr_image_url": "https://api.secupay.ag/qr?d=http%3A%2F%2F....",
"transfer_payment_data": {
"purpose": "TA 123456",
"accountowner": "secupay AG",
"iban": "DE37 8999 9999 5555 5555 55",
"bic": "TESBDEZZXXX",
"bankname": "Testbank AG"
}
}
},
"errors": null
}

All these fields are always present, when the payment method is invoice or prepaid. They have these meanings:

  • recipient_legal: full name and address of the payee (secupay as holder of the escrow account);

  • payment_link: URL to help the buyer to pay immediately;

  • payment_qr_image_url: URL to get an QR code for the above URL (helps to overcome media disruption from a printed invoice to online payment);

  • transfer_payment_data: bank details to pay by your own.

You need to print the details on your invoice, at least the bank details. It is a good practice to include the payment_url in online media, and the QR code at printed media. You should also remind the buyer that their invoice was assigned to secupay AG in Pulsnitz (recipient_legal) as payment service provider.

If your transaction is paid on invoice, and you have already marked it as shipped, the status response will also contain this message:

{
"status": "ok",
"data": {
"hash": "tujevzgobryk3303",
"status": "proceed",
...
"opt": {
"recipient_legal": "secupay AG, Goethestraße 6, 01896 Pulsnitz",
"payment_link": "https://api.secupay.ag/payment/tujevzgobryk3303",
"payment_qr_image_url": "https://api.secupay.ag/qr?d=http%3A%2F%2F....",
"transfer_payment_data": {
"purpose": "TA 123456",
"accountowner": "secupay AG",
"iban": "DE37 8999 9999 5555 5555 55",
"bic": "TESBDEZZXXX",
"bankname": "Testbank AG"
},
"invoice_number": "90001234555",
"shipping_date": "2018-11-12 08:50:40",
"shipped": true
}
},
"errors": null
}