<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pods.finance/v2/swap/bytecode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => '550e8400-e29b-41d4-a716-446655440000',
'settlementMode' => 'depositAddress',
'accountId' => '12',
'originAddress' => 'EXYhCNamLPFfSMekSn7Lzc2cP32aZpRa7ok5gErdJzcj',
'destinationAddress' => 'EXYhCNamLPFfSMekSn7Lzc2cP32aZpRa7ok5gErdJzcj',
'output' => 'bytecode',
'pixKey' => '[email protected]',
'bankAccountNumber' => '<string>',
'bankRoutingNumber' => '<string>',
'bankBeneficiaryName' => '<string>',
'bankName' => '<string>',
'beneficiaryStreetLine1' => '<string>',
'beneficiaryStreetLine2' => '<string>',
'beneficiaryCity' => '<string>',
'beneficiaryState' => '<string>',
'beneficiaryPostalCode' => '<string>',
'beneficiaryCountry' => '<string>',
'alias' => '<string>',
'description' => '<string>',
'usdPaymentMethod' => 'WIRE',
'rawQuote' => '<unknown>',
'thirdParty' => false,
'webhookURL' => 'https://example.com/webhooks/swap-action'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}