Card Payments API Demonstration
This demonstration leads you through the main steps in the processing of a credit card transaction so that you can get a feel for the process. Each step uses the minimum set of parameters required for a successful response; in real life your requests are likely to include many more. You can use the default settings or you can enter your own to see how and where they appear in the requests and responses.
This demonstration requires the same API Key and Account ID in each of its three steps. These two parameters are essential to every request to the API, which will not respond if they are missing or incorrect.
Please type the API Key and Account Number to be used, or accept the defaults; the values will be locked once you start the demo.
Step 1: Authorize a Transaction
The FMA in the endpoint must be replaced with the Account Number.
Request
curl -X POST https://api.test.paysafe.com/cardpayments/v1/accounts/[[accountNumber]]/auths \
-u [[apiKey]] \
-H 'Content-Type: application/json' \
-d '
{
"merchantRefNum": [[merchantReferenceNumber]],
"amount": [[amount]],
"settleWithAuth": false,
"card": {
"cardNum": [[cardNum]],
"cardExpiry": {
"month": 2,
"year": 2027
}
},
"billingDetails": {
"street": "100 Queen Street West",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zip": [[zip]]
}
}
'
Response
ID Value: [[id]]
is required for Step 2: [[next-step-link2|Settle a Transaction]] and has been entered in the next step for your convenience.
Step 2: Settle a Transaction
The FMA in the endpoint must be replaced with the Account Number.
The ID in the endpoint must be replaced with the id from the authorization response.
Request
curl -X POST https://api.test.paysafe.com/cardpayments/v1/accounts/[[accountNumber]]/auths/[[id]]/settlements \
-u [[apiKey]] \
-H 'Content-Type: application/json' \
-d '
{
"merchantRefNum": [[merchantReferenceNumber]],
"amount": [[amount]]
}
'
Response
ID Value: [[id]]
is required for Step 3: [[next-step-link3|Look up a Settlement]] and has been entered in the next step for your convenience.
Step 3: Look up a Settlement
The FMA in the endpoint must be replaced with the Account Number.
The ID in the endpoint must be replaced with the id from the authorization response.
Request
curl -X GET https://api.test.paysafe.com/cardpayments/v1/accounts/[[accountNumber]]/settlements/[[id]] \
-u [[apiKey]] \
-H 'Content-Type: application/json'