<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withorb.com/v1/customers/external_customer_id/{external_customer_id}/credits/top_ups",
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([
'currency' => '<string>',
'threshold' => '<string>',
'amount' => '<string>',
'per_unit_cost_basis' => '<string>',
'invoice_settings' => [
'auto_collection' => true,
'net_terms' => 123,
'memo' => '<string>',
'require_successful_payment' => false
],
'expires_after' => 123,
'active_from' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}