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

# Create Invoice

This API is used to create orders for customers

<mark style="color:green;">`POST`</mark> `https://wallet-api.xaigate.com/api/v1/invoice/create`

**Parameter content type: application/json**

#### Request Body

| Name                                       | Type   | Description                          |
| ------------------------------------------ | ------ | ------------------------------------ |
| apiKey<mark style="color:red;">\*</mark>   | String | fdda9f03-6409-43eb-a6ef-e1f6cea71c2e |
| orderId<mark style="color:red;">\*</mark>  | String | 10                                   |
| currency<mark style="color:red;">\*</mark> | Stirng | USD                                  |
| amount<mark style="color:red;">\*</mark>   | String | 10                                   |
| email<mark style="color:red;">\*</mark>    | String | <examplate@hotmail.com>              |
| shopName                                   | String | My Store                             |
| notifyUrl                                  | String | <http://yourdomain.com/notify-url>   |
| failUrl                                    | String | <http://yourdomain.com/fail-url>     |
| successUrl                                 | String | <http://yourdomain.com/success-url>  |
| description                                | String | 3 Coffee                             |

### Request Parameter <a href="#request-parameter" id="request-parameter"></a>

| **Parameter**                                       | **Type** | **Sample Value** |
| --------------------------------------------------- | -------- | ---------------- |
| apiKey <mark style="color:red;">(required)</mark>   | String   | ​                |
| orderId <mark style="color:red;">(required)</mark>  | String   | ​                |
| amount <mark style="color:red;">(required)</mark>   | String   |                  |
| currency <mark style="color:red;">(required)</mark> | String   | ​USD, EUR        |
| email <mark style="color:red;">(required)</mark>    | String   |                  |
| shopName                                            | String   |                  |
| description                                         | String   |                  |
| successUrl                                          | String   |                  |
| failUrl                                             | String   |                  |
| notifyUrl                                           | String   |                  |

### Example Value <a href="#example-value-1" id="example-value-1"></a>

```
{
  "apiKey": "fdda9f03-6409-43eb-a6ef-e1f6cea71c2e",
  "shopName": "My Store",
  "amount": 10,
  "currency": "USD",
  "orderId": "1",
  "email": "examplate@hotmail.com",
  "successUrl": "http://yourdomain.com/success-url",
  "failUrl": "http://yourdomain.com/fail-url",
  "notifyUrl": "http://yourdomain.com/notify-url",
  "description": "3 Coffee"
}
```

### Response (<mark style="color:green;">200 Ok</mark> - https status code) <a href="#response-200-ok-https-status-code" id="response-200-ok-https-status-code"></a>

| **Response** | **Type** | **Sample Value**                                       |
| ------------ | -------- | ------------------------------------------------------ |
| invoiceNo    | String   | ​                                                      |
| amount       | String   | ​                                                      |
| paidAmount   | String   |                                                        |
| toEmail      | String   |                                                        |
| toName       | String   |                                                        |
| expiry       | Int      | default: 60 mins                                       |
| description  | String   |                                                        |
| status       | String   | Pending                                                |
| payUrl       | String   | <https://wallet.xaigate.com/pay/INV2167234232?lang=en> |
| currency     | String   | USD                                                    |
| shopName     | String   |                                                        |
| orderId      | String   |                                                        |
| createdAt    | String   |                                                        |
| updatedAt    | String   |                                                        |

### Example Value <a href="#example-value-1" id="example-value-1"></a>

```
{
  "invoiceNo": "INV2167234232",
  "amount": "10",
  "paidAmount": "0",
  "toEmail": "example@hotmail.com",
  "toName": "My Store",
  "expiry": 60,
  "description": "3 Coffee",
  "status": "Pending",
  "payUrl": "https://wallet.xaigate.com/pay/INV2167234232?lang=en",
  "currency": "USD",
  "shopName": "My Store",
  "orderId": 10,
  "createdAt": "2023-12-07T09:03:07.976520Z",
  "updatedAt": "2023-12-07T09:03:07.976523Z"
  ....
}
```
