# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.citypay.io/endpoint/create-order-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
