Make Invoice (Order)
CURL Request
$apiURL = 'https://live.oyf.io/api/payment/make-payment';
$secret_key = 'aij3vg2bmucgbzrkgzsfgkenaabhdf8be81mgzz7yj38787rav8ai';
$profile_id = 'c83821798-286c-0007-bb29-2ce849e0de10';
$postInput = ['currency_id' => 'c7b5e721-72c3-4222-b2c4-d4a244daa1ae',
'name' => 'John Doe',
'email' => 'johndoe@example.com',
'phone' => '(415) 555‑0132',
'address' => "N/A",
'issued_date' => '2023-10-23',
'inv_description' => 'Testing Order',
'invoice_type' =>"S",
'subtotal' =>'100',
'subtotal_discount' => "0",
'grand_total' => '100',
'profile_id' => $profile_id,
'callback' => 'www.example.com/return-url',
'cart_id' => '231123',
];
$curl = curl_init($apiURL);
curl_setopt($curl, CURLOPT_URL, $apiURL);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array('Content-Type: application/json','X-Authorization:' . $secret_key);
curl_setopt($curl, CURLOPT_HTTPHEADER,$headers);
$data= json_encode($postInput);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Form Object
Response
{
"_metadata": {
"outcome": "SUCCESS",
"outcomeCode": 200,
"numOfRecords": 1,
"message": "Invoice created successfully!."
"records": "https://portal.oyf.io/payment-page/gWqbhRMH1V4cNSDd8O92,"
"errors": []
}
Last updated