1. Start Solicitation
To start the credit solicitation and prepare the identification form, send the shopping cart and shopper data to seQura. See Order API Payload and Examples for the full specification.
Make a POST request to /orders. seQura returns the URL to the order object in the Location header. Store this URL in your database or session—you'll need it for the next steps.
HTTP header names are case-insensitivePer the HTTP specification (RFC 9110), header field names are case-insensitive. seQura may return this header as
Location,location, or any other casing (for example, header names are lowercased over HTTP/2), so match it case-insensitively when reading the order URL. Most HTTP clients normalize header names for you.
cURL example
cURLis a command-line tool for HTTP requests. We use it here because it's easy to run and provides a quick start. It's available for Unix, Windows, and macOS.
To run this example, generate the payload at the API Reference.
Request Example (cURL)
$ SQPASS='yourAccountKey:yourAccountSecret'
$ curl -i -X POST -u $SQPASS -k \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Sequra-Merchant-Id: yourMerchantID' \
--data-binary @checkout_sample.json \
https://sandbox.sequrapi.com/ordersResponse Example
HTTP/1.1 100 Continue
HTTP/1.1 204 No Content
Cache-Control: no-cache
Date: Mon, 06 Feb 2017 17:18:51 GMT
Location: https://sandbox.sequrapi.com/orders/1dc26b35-06f6-41d6-b6f5-d0eb6c66aad1
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Request-Id: acdaa7e4-61ef-40a6-878d-0c562257a71c
X-Runtime: 0.035769
X-XSS-Protection: 1; mode=block
Connection: keep-alivePHP example
See the PHP example of the full checkout in Calling the Order API. This step corresponds to $client->startSolicitation().
Errors
The API may refuse the solicitation with a 409 error and an explanation.
{
"errors": ["Invalid data: items' total_with_tax add up to 5055 (200+295+-1500+6060) but order_total_with_tax is 5097. The diff is 42."]
}Notes
- Remember to send prices as integers in cents and not as Euros.
- Make sure that the entire JSON must be in UTF-8. ISO-8859 is not allowed.
- If you set the mandatory
Content-Lengthheader manually, remember to count the number of bytes, not characters, in the payload.
Updated 22 days ago