CryptoExchange API :: Escrow Pay
What is Escrow Pay?
With no minimum fee and prices as low as 0.89%, Escrow Pay is the ideal solution for any website, mobile app, online store, classified site or marketplace that needs to take payments for any product or service of value. It allows buyers shopping online to make purchases safely and with confidence, whether they are spending $100 or $10,000,000 or more. Here is how it works:
- An online store or marketplace integrates the Escrow Pay API call on their listing or checkout pages. Since the store or marketplace only needs to implement a single API call, this can be done very easily.
- When the buyer checks out with Escrow Pay on the store or marketplace, a transaction is created on Cryptoexchange.com and the buyer is redirected to the Escrow Pay wizard on Cryptoexchange.com.
- The buyer secures their order by registering, verifying, and paying via the Escrow Pay wizard.
- All related actions and functionality for the transaction occur as usual.
Calling the Escrow Pay API
The call to the Escrow Pay API specifies how the transaction should be configured. This includes details about the item(s) being transacted, the buyer, the seller, the terms of the transaction, and optionally a broker for marketplace or commission scenarios.
curl "https://cryptoexchange.com/api/v1/escrow/partner/pay" \
-X POST \
-u "Authorization:Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '
{
"title": "good name",
"description": "Perfect sedan for the snow",
"amount": 123000,
"currency": "USD",
"crypto_currency": "USDT",
"who_pay_fee": "split",
"payload": {
"shipping": {
"type": "cargo",
"payer": "buyer",
"price": {
"amount": "330",
"currency": "USD"
}
}
},
"customer": {
"email": "[email protected]",
"phone": "+19737545738",
"date_of_birth": "1980-07-18",
"first_name": "John",
"last_name": "Wick"
},
"inspection_period": 1,
"return_url": "https://www.cryptoexchange.com",
"redirect_type": "manual"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://cryptoexchange.com/api/v1/escrow/partner/pay',
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_USERPWD => 'email-address:your-password',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
CURLOPT_POSTFIELDS => json_encode(
array (
'title' => 'good name',
'description' => 'Perfect sedan for the snow',
'amount' => 123000,
'currency' => 'USD',
'crypto_currency' => 'USDT',
'who_pay_fee' => 'split',
'payload' =>
array (
'shipping' =>
array (
'type' => 'cargo',
'payer' => 'buyer',
'price' =>
array (
'amount' => '330',
'currency' => 'USD',
),
),
),
'customer' =>
array (
'email' => '[email protected]',
'phone' => '+19737545738',
'date_of_birth' => '1980-07-18',
'first_name' => 'John',
'last_name' => 'Wick',
),
'inspection_period' => 1,
'return_url' => 'https://www.cryptoexchange.com',
'redirect_type' => 'manual',
)
)
));
$output = curl_exec($curl);
echo $output;
curl_close($curl);
Example Response
{
"landing_page": "https://cryptoexchange.com/escrow/pay?transaction_id=14872774-e8cc-4ea7-95c7-3235b4d62ccd"
}
Locking the buyers email
Setting the lock_email value to true removes the ability for the buyer to edit their email address on the Escrow Pay sign up and login pages.
landing_page attribute
The landing_page attribute contains the link to which the buyer should be redirected.
token attribute
The token attribute contains the token which is used to identify the buyer's transaction on the the Escrow Pay wizard. While it is embedded in the landing_page, it is split out here for convenience.
transaction_id attribute
The transaction_id attribute contains the Cryptoexchange.com transaction identifier for the transaction that was created by the call to the Escrow Pay API. This is provided so that subsequent calls may be made to the standard Escrow API.
For help on making API calls and configuring transactions, please review the links below.
Redirecting to your site after completing a transaction with Escrow Pay
Set the redirect_url to define the URL to return to after completion of Escrow pay.
Modifying redirect behaviour
Set the redirect_type transaction property to control automatic redirects. A value of automatic will redirect automatically in 3-5 seconds, wheres a value of manual will only redirect the buyer if they click the call to action.