Exchange Rate With Token
HTTPS POST / Server-to-Server
Sandbox endpoint : sandbox-pgw.2c2p.com/payment/4.1/exchangerate
Run test with Swagger EditorTo go live, refer to: Live endpoint guide
The Exchange Rate With Token API allows merchants to get foreign exchange rates with payment tokens.
Exchange Rate With Token Request
To prepare an exchange rate with token request, refer to the guidelines below.
-
Send a request and receive a response from the Payment Token API.
-
Prepare payload data. The sample code below demonstrates the correct data structure for an API request.
For API specifications, refer to: Exchange Rate With Token Request Parameters
{
"paymentToken": "kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu+KKSegjUjERKCyWPg=",
"clientID": "E380BEC2BFD727A4B6845133519F3AD7",
"locale": "en",
"bin": "411111"
}
Exchange Rate With Token Response
To process a response from the Exchange Rate With Token API, refer to the guidelines below.
The sample code below demonstrates the structure for the API response. For more details on the specific parameters, refer to: Exchange Rate With Token Response Parameters
{
"paymentToken": "kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu+KKSegjUjERKCyWPg=",
"providerCode": "SCB",
"expire": 1545383164989,
"fxRates": [{
"sequenceNo": 1,
"id": "fx001",
"name": "SGD",
"iconUrl": "https://img.2c2p.com/pgw/fx/flag_sg.png",
"amount": "1500.00",
"fx": 1.0,
"currencyCode": "SGD"
}, {
"sequenceNo": 2,
"id": "fx002",
"name": "THB",
"iconUrl": "https://img.2c2p.com/pgw/fx/flag_th.png",
"amount": "2450.00",
"fx": 24.50,
"currencyCode": "THB"
}],
"respCode": "0000",
"respDesc": "success"
}
Updated 2 months ago