# Create Order

## Description

The orders are placed using create order API method. Payment URL is generated after successful call. Buyer should be redirected to payment URL. On this page buyer can see the payment amount, select the desired payment currency and complete the payment.

## Create Order

<mark style="color:green;">`POST`</mark> `https://v2-listener.citypay.io/api/generateOrder`

#### Path Parameters

| Name          | Type    | Description                                  |
| ------------- | ------- | -------------------------------------------- |
| customer\_id  | string  | Your account's ID                            |
| access\_token | string  | Access token issued by CityPay               |
| order\_id     | integer | Order ID                                     |
| order\_token  | integer | Unique token for order given by you          |
| amount        | number  | The price set by the merchant in double type |

{% tabs %}
{% tab title="200 Order was successfully created " %}

```javascript
{
    "status": 1,
    "status_code ": 201,
    "message": {
        "id": 441,
        "payment_url": "https://v2-order.citypay.io/invoice?token=2334232323233232323",
        "token": "2334232323233232323"
    }
}
```

{% endtab %}

{% tab title="422 Invalid parameters" %}

```javascript
{
    "status": "error",
    "status_code ": 422,
    "message": {
        "amount": "The amount field is required."
    }
}
```

{% endtab %}
{% endtabs %}
