Skip to main content

Unified Queries

GET /payment/api/v1/{request_id}?key={key}&resource={resource}&mode=sha256&nonce={nonce}

Note

Note: As this is a GET request and does not have a request body, the way to generate the signature changes. Follow the instructions provided in this section.

Regardless of the payment method, you can query operations using just the reference number of the transaction (request_id) from this endpoint.

Signature

The signature that will travel in Content-Signature is generated using part of the URL:

"/payment/api/v1/{request_id}?key={key}&resource={resource}&mode=sha256&nonce=123123123"

With this example, you could confirm if the signature is generated correctly:

  • Complete query endpoint: https://sandbox.sipay.es/payment/api/v1/aaaabbbbcccc11112222?key=key-api-merchant&resource=resource-api-merchant&mode=sha256&nonce=123123123

  • Substring to generate the signature: /payment/api/v1/aaaabbbbcccc11112222?key=key-api-merchant&resource=resource-api-merchant&mode=sha256&nonce=123123123

This means we have removed the base URL that contains the domain with the protocol.

Example Signature

For a secret: abc123, if we apply the HMAC SHA256 algorithm to the substring, it should return the following signature:

f3f4011662773146ee11b009ac338c24dd911b656580bb25284dfedf3ce40220

info

As can be observed, the most important thing is to always provide a very variable nonce value.

Request

URL Parameters

  • request_id: Identifier for the operation received during the link generation.

Payload

No parameters

You must indicate the request_id in the URL of the GET request. This identifier is always obtained in the first request for generating the payment link.

Response

Payload

  • code: Unified response code of the operation. A value of 0 indicates that it was completed successfully. A value different from 0 means there was a problem.
  • amount (integer, required): Amount of the operation in decimals. 140 in the currency. In € it would be 1.4€.
  • currency (string): Currency defined according to ISO_4217.
  • order (string): Ticket for the operation.
  • payment_method_name: Name of the payment method used.
  • events: All events that have occurred with the operation. We have included a table with all available events.

Examples

Response example

Response:

{
"type": "resource.status",
"code": "0",
"detail": "Operation status retrieved successfully",
"payload": {
"code": 0,
"amount": 15000,
"order": "6927d0555d014",
"currency": "EUR",
"payment_method_name": "fastpay",
"events": {
"create_session": [
{
"triggered_at": 1651144763.4668915,
"extra": {}
}
],
...
}
},
"request_id": "626a783ba72bfcb052598789",
"uuid": "626a783ba72bfcb052598789"
}