Skip to main content

Appendix B

Examples

Please review carefully the list of parameters before using the examples. Some parameters may be missing in the examples.

Requests examples are for reference only. If you will use them unchanged you will receive an error in the response.

You have to set your own values for parameters (client_key and hash in particular).

All requests are with Content-Type: multipart/form-data.

SALE request sample


Sample data of the sale request

ParameterValid value
actionSALE
client_keyc2b8fb04-110f-11ea-bcd3-0242c0a85004
order_idORDER-12345
order_amount1.99
order_currencyUSD
order_descriptionProduct
card_number4111111111111111
card_exp_month01
card_exp_year2025
card_cvv2000
payer_first_nameJohn
payer_last_nameDoe
payer_addressBig street
payer_countryUS
payer_stateCA
payer_cityCity
payer_zip123456
payer_emaildoe@example.com
payer_phone199999999
payer_ip123.123.123.123
term_url_3dshttp://client.site.com/return.php
hash2702ae0c4f99506dc29b5615ba9ee3c0

The hash above was calculated for PASSWORD equal to_13a4822c5907ed235f3a068c76184fc3_.

Sample curl request
curl -d "action=SALE&client_key=c2b8fb04-110f-11ea-bcd3-0242c0a85004&order_id=ORDER12345&
order_amount=1.99&order_currency=USD&order_description=Product&
card_number=4111111111111111&card_exp_month=01&card_exp_year=2025&card_cvv2=000&
payer_first_name=John&payer_last_name=Doe&payer_address=BigStreet&
payer_country=US&payer_state=CA&payer_city=City&payer_zip=123456&
payer_email=doe@example.com&payer_phone=199999999&
payer_ip=123.123.123.123&term_url_3ds=http://client.site.com/return.php&
parameters[param1]=value1&parameters[param2]=value2&parameters[param3]=value3&
hash=2702ae0c4f99506dc29b5615ba9ee3c0"
https://test.apiurl.com -k

Sample response (synchronous mode)

The response if the sale is successful
{
"action":"SALE",
"result":"SUCCESS",
"status":"SETTLED",
"order_id":"ORDER-12345",
"trans_id":"aaaff66a-904f-11ea-833e-0242ac1f0007",
"trans_date":"2012-04-03 16:02:01",
"descriptor":"test",
"amount":"0.02",
"currency":"USD"
}
The response if the sale is unsuccessful
{
"action":"SALE",
"result":"DECLINED",
"status":"DECLINED",
"order_id":"ORDER-12345",
"trans_id":"aaaff66a-904f-11ea-833e-0242ac1f0007",
"trans_date":"2012-04-03 16:02:01",
"decline_reason":"Declined by processing"
}
The response if the transaction supports 3D-Secure
{
"action":"SALE",
"result":"REDIRECT",
"status":"3DS",
"order_id":"1588856266Intelligent",
"trans_id":"595ceeea-9062-11ea-aa1b-0242ac1f0007",
"trans_date":"2012-04-03 16:02:01",
"descriptor":"Descriptor",
"amount":"0.02",
"currency":"USD",
"redirect_url":"https://some.acs.endpoint.com",
"redirect_params":
{
"PaReq":"M0RTIE1hc3RlciBVU0QgU1VDQ0VTUw==",
"MD":"595ceeea-9062-11ea-aa1b-0242ac1f0007",
"TermUrl":"https://192.168.0.1:8101/verify/3ds/595ceeea-9062-11ea-aa1b-0242ac1f0007/7d6b9b240ff2779b7209aef786f808d1"
},
"redirect_method":"POST"
}
In case of redirect_params is empty
{
"action":"SALE",
"result":"REDIRECT",
"status":"3DS",
"order_id":"1588856266Intelligent",
"trans_id":"595ceeea-9062-11ea-aa1b-0242ac1f0007",
"trans_date":"2012-04-03 16:02:01",
"descriptor":"Descriptor",
"amount":"0.02",
"currency":"USD",
"redirect_url":"https://some.acs.endpoint.com",
"redirect_params":[],
"redirect_method":"POST"
}
In case of an error (sample is shown in the “Errors” section)
{
"result":"ERROR",
"error_message":"Error description"
}

Sample response (asynchronous mode)

The response if the sale is successful
action=SALE&result=SUCCESS&status=SETTLED&order_id=1001&trans_id=aaaff66a-904f-11ea-833e-0242ac1f0007&hash=e36d1001a7ccbfd7870de5c1eab5f86e&trans_date=2022-10-26+11%3A51%3A53&descriptor=Qwest&amount=10.00&currency=EUR&card=4111111%2A%2A%2A%2A11111&card_expiration_date=01%2F2025&exchange_rate=1.058189&exchange_currency=USD&exchange_amount=9.22

RECURRING_SALE request sample

Sample recurring sale request

Request Example
curl -d "action=RECURRING_SALE&client_key=c2b8fb04-110f-11ea-bcd3-0242c0a85004&order_id=ORDER-12345&order_amount=1.99&
order_description=Product&recurring_first_trans_id=aaaff66a-904f-11ea-833e-0242ac&
recurring_token=d6dcb9e0-96b6-11ea-bbd1-0242ac120012&
hash=a1a6de416405ada72bb47a49176471dc"
https://test.apiurl.com -k

Sample response

Response Example
{
"action":"RECURRING_SALE",
"result":"SUCCESS",
"status":"SETTLED",
"order_id":"ORDER-12345",
"trans_id":"aaaff66a-904f-11ea-833e-0242ac1f0007",
"trans_date":"2012-04-03 16:02:01",
"descriptor":"test",
"amount":"0.02",
"currency":"USD"
}

CREDITVOID request sample

Sample request

Request Example
curl -d "action=CREDITVOID&client_key=c2b8fb04-110f-11ea-bcd3-0242c0a85004&trans_id=aaaff66a-904f-11ea-833e-0242ac&amount=10.00&
hash=6b957fca41c353ac344fcad47f0cbf97"
https://test.apiurl.com -k

Sample response

Response Example
{
"action":"CREDITVOID",
"result":"ACCEPTED",
"trans_id":"aaaff66a-904f-11ea-833e-0242ac",
"order_id":"ORDER-12345"
}

See also

For related S2S Card documentation, see the following pages: