Make your first API call
The easiest way to test the API is by making a sale request using curl.
Below, you’ll find examples for executing a sale transaction and then checking its status.
Sale request using curl
Please replace $REQUSTOR_ID and $BEARER_TOKEN with your credentials.
curl --request POST \ --url https://SERVER_NAME/api/payments/sale/$REQUSTOR_ID \ --header "Authorization: Bearer $BEARER_TOKEN" \ --header 'Content-Type: application/json' \ --data '{ "order": { "orderAmount": "1.0", "orderCurrencyCode": "EUR", "orderDescription": "Order description", "orderMerchantId": "13117038" }, "card": { "cardNumber": "4444444444443333", "cvv2": "123", "expireMonth": "12", "expireYear": "2029", "cardPrintedName": "CL-BRWA" }, "browser": { "acceptLanguage": "en", "ipAddress": "1.2.3.4", "screenHeight": 900, "screenWidth": 1440, "colorDepth": 24, "timeZone": 7200, "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0", "javascriptEnabled": true }, "urls": { "resultUrl": "https://httpbin.org/anything" }, "customerEmail": "[email protected]", }, "feature": { "redirectUrlCreation" : "CREATE_IN_RESPONSE" }}'Sale Response
Then you will get the following json response:
{ "correlationId": "603485e6-e238-4773-a039-d128c6442b07", "orderSystemId": 123456789, "orderMerchantId": "13117038", "orderState": "PROCESSING", "outputRedirectToUrl": "https://SERVER_NAME/redirect/to/1/123456789/01YoerIpb_EUPIZ9AXwV95JQp3iVmV2jkRSdgw4uLh00S-poDKy2c3x6kBhAM0mevu", "statusCreatedTimestamp": 1736870509826}Go to the the outputRedirectToUrl to complete the payment.
For more into please see Sale API call
Getting an order status
Request
curl --request POST \ --url https://SERVER_NAME/api/payments/sale/$REQUSTOR_ID \ --header "Authorization: Bearer $BEARER_TOKEN" \ --header 'Content-Type: application/json' \ --data '{ "orderSystemId": 123456789}'Example response
{ "correlationId": "2602550b-101d-419d-9633-420248e0c17c", "orderSystemId": 123456789, "orderMerchantId": "123", "orderState": "APPROVED", "transactionType": "SALE", "orderAmount": "1.00", "orderCurrencyCode": "EUR", "cardFirstDigits": "444444", "cardLastDigits": "3333", "cardType": "VISA", "cardHolderName": "CL-BRWA", "cardExpiryMonth": 1, "cardExpiryYear": 2029, "cardHashId": 13261, "cardIssuerName": "UNKNOWN", "orderUpstreamRrn": "332362073404", "orderUpstreamId": "UPSTREAM-11378", "orderUpstreamAuthorizationCode": "251997", "orderUpstreamDescriptor": "EUR 3DS", "statusCreatedTimestamp": 1700425061897, "transactions": [ { "type": "SALE", "status": "APPROVED", "amount": "1.00", "createdSystemTimestamp": "2023.11.19 13:31:15 +0000" } ], "cardPaymentNetworkProductCode": "P", "cardPaymentNetworkProductName": "Visa Gold", "cardPaymentNetworkTypeCode": "Credit", "cardPaymentNetworkTypeName": "VISA Credit"}For more into please see Status API call