# Orders

These keys are specified to use as defined in docs, they are case-sensitive. Any change in these keys may cause issues during data sync&#x20;

### Authentication&#x20;

\
Use your token provided inside converted.in after on boarding process to authenticate the request using form-data body

![](/files/EX2SIK3Rj9DDgbZxd7ef)

## Get orders

<mark style="color:green;">`POST`</mark> `YOUR_BASEURL/convertedin/orders`

#### Request Body

| Name                                        | Type    | Description                  |
| ------------------------------------------- | ------- | ---------------------------- |
| per\_page<mark style="color:red;">\*</mark> | integer | limit per page (default 100) |
| page<mark style="color:red;">\*</mark>      | integer | page number                  |
| token<mark style="color:red;">\*</mark>     | string  |                              |

{% tabs %}
{% tab title="200 " %}

```
{
    "current_page": 1,
    "data": [
        {
            "id": 101905,
            "ordered_at": "2020-12-02 14:42:29.000000",
            "total_price": 350, 
            "subtotal_price": 300,
            "total_tax": 0,
            "taxes_included": 0,
            "currency": "EGP",
            "country_code": "CA",
            "financial_status": "processing", // order status, (successful, canceled, etc...) your own statuses
            "total_discounts": 0,
            "phone": "01226699662",
            "customer_locale": null, // en, ar
            "contact_email": "someone@example.com", 
            "line_items" : [
                {
                    "product_id": 324,
                    "quantity": 2,
                    "price": 50
                }
            ]
        }
    ],
    "from": 1,
    "last_page": 30,
    "per_page": 100,
    "to": 100,
    "total": 3000
}
```

{% endtab %}
{% endtabs %}

<table data-header-hidden><thead><tr><th>key </th><th>Description</th><th>Validation Rule</th></tr></thead><tbody><tr><td>key </td><td>Description</td><td>Validation Rule</td></tr><tr><td>id</td><td>Unique identifier for order</td><td><strong>Required</strong></td></tr><tr><td>ordered_at</td><td>Order date,  Format: Y-m-d H:i:s, ex: 2020-12-15 19:00:00</td><td><strong>Required</strong></td></tr><tr><td>total_price</td><td>Order total payment by customer, decimal</td><td><strong>Required</strong></td></tr><tr><td>subtotal_price</td><td>Order subtotal / goods price,, decimal</td><td><strong>Required</strong></td></tr><tr><td>total_tax</td><td>Order taxes, decimal <strong>default 0</strong></td><td><strong>Required</strong></td></tr><tr><td>taxes_included</td><td>Is taxes included (0, 1)</td><td><strong>Required</strong></td></tr><tr><td>currency</td><td>Order currency in ISO code (USD, EUR, etc...)</td><td><strong>Required</strong></td></tr><tr><td>country_code</td><td>Client country code in ISO code (US, GB)</td><td><strong>Required</strong></td></tr><tr><td>financial_status</td><td>Order status (processing, successful, canceled, refunded)</td><td>Not required</td></tr><tr><td>total_discounts</td><td>Order discount, decimal <strong>default 0</strong></td><td><strong>Required</strong></td></tr><tr><td>phone</td><td>Client phone</td><td><strong>Required</strong></td></tr><tr><td>customer_locale</td><td></td><td>Not Required</td></tr><tr><td>contact_email</td><td></td><td><strong>Required</strong></td></tr><tr><td>line_items</td><td>items array as shown in response example</td><td><strong>Required</strong></td></tr><tr><td><a href="/pages/-MQpPyERBC25eF65CrfL#undefined">customer</a></td><td><p>link order with id inside customer object <br>ex: </p><pre><code>"customer": {         
   "id": 207119551
}
</code></pre></td><td><strong>Required</strong></td></tr></tbody></table>

### Response

```json
{
    "data": [
        {
            "id": 450789469,
            "closed_at": null,
            "confirmed": true,
            "contact_email": "bob.norman@hostmail.com",
            "created_at": "2008-01-10T11:00:00-05:00",
            "currency": "USD",
            "customer_locale": null,
            "discount_codes": [
                {
                    "code": "TENOFF",
                    "amount": "10.00",
                    "type": "fixed_amount"
                }
            ],
            "email": "bob.norman@hostmail.com",
            "financial_status": "partially_refunded",
            "fulfillment_status": null,
            "landing_site": "http://www.example.com?source=abc",
            "landing_site_ref": "abc",
            "name": "#1001",
            "note": null,
            "number": 1,
            "order_number": 1001,
            "order_status_url": "https://apple.myshopify.com/690933842/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod",
            "payment_gateway_names": [
                "bogus"
            ],
            "phone": "+557734881234",
            "presentment_currency": "USD",
            "processed_at": "2008-01-10T11:00:00-05:00",
            "processing_method": "direct",
            "reference": "fhwdgads",
            "referring_site": "http://www.otherexample.com",
            "source_identifier": "fhwdgads",
            "source_name": "web",
            "source_url": null,
            "subtotal_price": "597.00",
            "tags": "",
            "taxes_included": false,
            "total_discounts": "10.00",
            "total_line_items_price": "597.00",
            "total_price": "598.94",
            "total_price_usd": "598.94",
            "total_tax": "11.94",
            "total_tip_received": "0.00",
            "total_weight": 0,
            "updated_at": "2008-01-10T11:00:00-05:00",
            "billing_address": {
                "first_name": "Bob",
                "address1": "Chestnut Street 92",
                "phone": "555-625-1199",
                "city": "Louisville",
                "zip": "40202",
                "province": "Kentucky",
                "country": "United States",
                "last_name": "Norman",
                "address2": "",
                "company": null,
                "latitude": 45.41634,
                "longitude": -75.6868,
                "name": "Bob Norman",
                "country_code": "US",
                "province_code": "KY"
            },
            "customer": {
                "id": 207119551,
                "email": "bob.norman@hostmail.com",
                "accepts_marketing": false,
                "created_at": "2021-10-01T17:01:53-04:00",
                "updated_at": "2021-10-01T17:01:53-04:00",
                "first_name": "Bob",
                "last_name": "Norman",
                "orders_count": 1,
                "state": "disabled",
                "total_spent": "199.65",
                "last_order_id": 450789469,
                "note": null,
                "verified_email": true,
                "multipass_identifier": null,
                "tax_exempt": false,
                "phone": "+16136120707",
                "tags": "",
                "last_order_name": "#1001",
                "currency": "USD",
                "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
                "marketing_opt_in_level": null,
                "tax_exemptions": [],
                "admin_graphql_api_id": "gid://shopify/Customer/207119551",
                "default_address": {
                    "id": 207119551,
                    "customer_id": 207119551,
                    "first_name": null,
                    "last_name": null,
                    "company": null,
                    "address1": "Chestnut Street 92",
                    "address2": "",
                    "city": "Louisville",
                    "province": "Kentucky",
                    "country": "United States",
                    "zip": "40202",
                    "phone": "555-625-1199",
                    "name": "",
                    "province_code": "KY",
                    "country_code": "US",
                    "country_name": "United States",
                    "default": true
                }
            },
            "line_items": [
                {
                    "id": 466157049,
                    "fulfillable_quantity": 0,
                    "fulfillment_status": null,
                    "name": "IPod Nano - 8gb - green",
                    "price": "199.00",
                    "product_exists": true,
                    "product_id": 632910392,
                    "quantity": 1,
                    "title": "IPod Nano - 8gb",
                    "total_discount": "0.00",
                    "variant_id": 39072856,
                    "variant_title": "green",
                    "vendor": null
                }
            ]
        }
    ],
    "total": 1000,
    "per_page": 100,
    "current_page": 1,
    "last_page": 10,
    "from": 1,
    "to": 100
}
```


---

# 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.converted.in/api-1/orders.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.
