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

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
