> For the complete documentation index, see [llms.txt](https://docs.oyf.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oyf.io/developer-guide/make-invoice-order.md).

# Make Invoice (Order)

## CURL Request

{% code lineNumbers="true" fullWidth="true" %}

```php
$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;
```

{% endcode %}

## Form Object

<table data-full-width="true"><thead><tr><th>Key</th><th width="345">Example Value</th><th>Description</th></tr></thead><tbody><tr><td>currency_id</td><td>cd3b5f06-7a00-4513-bbd3-ea8118f1326a</td><td>Required</td></tr><tr><td>name</td><td>Test User</td><td>Optional / Nullable</td></tr><tr><td>email</td><td>test@oyf.io</td><td>Optional / Nullable</td></tr><tr><td>phone</td><td>+(508) 646-2869</td><td>Optional / Nullable</td></tr><tr><td>address</td><td>test address</td><td>Optional / Nullable</td></tr><tr><td>issued_date</td><td>2023-04-06</td><td>Required</td></tr><tr><td>inv_description</td><td>Testing Invoice descriotions</td><td>Optional / Nullable</td></tr><tr><td>invoice_type</td><td>S</td><td>S => Sale , R => Recursion (Required)</td></tr><tr><td>subtotal</td><td>85.00</td><td>Optional / Nullable</td></tr><tr><td>subtotal_discount</td><td>0.00</td><td>Optional / Nullable</td></tr><tr><td>vat_tax</td><td>5.00</td><td>Optional / Nullable</td></tr><tr><td>grand_total</td><td>90.00</td><td>Required</td></tr><tr><td>profile_id</td><td>04d66e00-8617-4d43-938e-5326f1442897</td><td>Required</td></tr><tr><td>success_return_url</td><td>https://test.com/payment-confirmation</td><td>Required</td></tr><tr><td>failed_return_url</td><td>https://test.com/payment-confirmation</td><td>Required</td></tr><tr><td>cart_id</td><td>7567557687</td><td>Required</td></tr></tbody></table>

## Response

```json
{
"_metadata": {
"outcome": "SUCCESS",
"outcomeCode": 200,
"numOfRecords": 1,
"message": "Invoice created successfully!."
"records": "https://portal.oyf.io/payment-page/gWqbhRMH1V4cNSDd8O92,"
"errors": []
}
```
