> For the complete documentation index, see [llms.txt](https://docs.shiplemon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shiplemon.com/endpoints/incoming-orders/create-incoming-order.md).

# Create Incoming Order

## Create Incoming order

<mark style="color:green;">`POST`</mark> `https://api-sandbox.shiplemon.com/v1/incoming-orders/generic`

Adds an incoming order in our system

#### Request Body

| Name                                       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| store\_id                                  | string | <p>The unique store url to avoid overwrites when orders from multiple stores have the same id. For link compatibility, also add the url protocol.<br>Eg. value: <a href="https://woocommercestore.gr/"><https://woocommercestore.gr></a> </p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| shipment\_id                               | string | The id of the related shipment from [Create Shipment](/endpoints/shipments/create-shipment.md#create-shipment)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| status                                     | string | <p>The status of the order:<br>One of: processing, completed</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| items<mark style="color:red;">\*</mark>    | array  | <p>{</p><p>  id: number;</p><p>  name: string;<br>  quantity: string;</p><p>  price: number;</p><p>  sku?: string;</p><p>  width: string;</p><p>  length: string;</p><p>  height: string;</p><p>  weight: string;</p><p>  image\_url: string;</p><p>}</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| shipping<mark style="color:red;">\*</mark> | object | <p><code>{</code></p><p>  <code>"first\_name": "First Name",</code></p><p>  <code>"last\_name": "Last Name",</code></p><p>  <code>"company": "Company",</code></p><p>  <code>"address\_1": "Address 1",</code></p><p>  <code>"address\_2": "2nd floor",</code></p><p>  <code>"city": "city",</code></p><p>  <code>"state": "state",</code></p><p>  <code>"postcode": "postcode",</code></p><p>  <code>"country": "GR",</code></p><p>  <code>"phone": "phone",</code></p><p>  <code>"email": "<email@test.com>",</code></p><p>  <code>"notes: "Beware of the dog"</code><br><code>}</code></p><p><br><code>company</code>, <code>address\_2</code>, and <code>state</code> are optional and can accept <strong>null</strong></p><p></p><p><strong>Country</strong> is a 2 letter ISO code</p><p><strong>Phone</strong> is either local phone or for non GR destination prefix with country code: <a href="https://en.wikipedia.org/wiki/E.164"><https://en.wikipedia.org/wiki/E.164></a></p> |
| total<mark style="color:red;">\*</mark>    | number | The total amount of the order                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| currency<mark style="color:red;">\*</mark> | string | <p>Accepts the code of the currency based on the iso 4217 </p><p>Check more here: <a href="https://en.wikipedia.org/wiki/ISO_4217 "><https://en.wikipedia.org/wiki/ISO_4217> </a></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| shipping\_total                            | number | <p>The shipping amount of the order</p><p>Default to 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| billing<mark style="color:red;">\*</mark>  | object | <p><code>{</code></p><p>  <code>"first\_name": "First Name",</code></p><p>  <code>"last\_name": "Last Name",</code></p><p>  <code>"company": "Company",</code></p><p>  <code>"address\_1": "Address 1",</code></p><p>  <code>"address\_2": "2nd floor",</code></p><p>  <code>"city": "city",</code></p><p>  <code>"state": "state",</code></p><p>  <code>"postcode": "postcode",</code></p><p>  <code>"country": "GR",</code></p><p>  <code>"phone": "phone",</code></p><p>  <code>"email": "<email@test.com>"</code><br><code>}</code></p><p><br><code>company</code>, <code>address\_2</code>, and <code>state</code> are optional and can accept <strong>null</strong></p><p></p><p><strong>Country</strong> is a 2 letter ISO code</p><p><strong>Phone</strong> is either local phone or for non GR destination prefix with country code: <a href="https://en.wikipedia.org/wiki/E.164"><https://en.wikipedia.org/wiki/E.164></a></p>                                                   |
| id                                         | string | The order id (could be a string or number)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| payment\_method                            | string | [#payment-methods](#payment-methods "mention")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| payment\_status                            | string | [#payment-statuses](#payment-statuses "mention")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| created\_at                                | Date   | eg. 2022-02-20T18:14:00.000Z                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| discount\_total                            | number | <p>The discount amount of the order.<br>Default to 0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

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

```
```

{% endtab %}
{% endtabs %}

## Example Request

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

```erlang
curl --location --request POST 'http://api-sandbox.shiplemon.com/v1/incoming-orders/generic' \
--header 'x-api-key: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id": 1,
  "store_id": "https://test-store.gr",
  "shipment_id": null,
  "currency": "eur",
  "shipping_total": 3,
  "total": 22,
  "billing": {
    "first_name": "first_name",
    "last_name": "last_name",
    "company": "company",
    "address_1": "address_1",
    "address_2": "address_2",
    "city": "city",
    "state": null,
    "postcode": "12345",
    "country": "GR",
    "phone": "+306900000000",
    "email": "email@domain.com"
  },
  "shipping": {
    "first_name": "first_name",
    "last_name": "last_name",
    "company": "company",
    "address_1": "address_1",
    "address_2": "address_2",
    "city": "Athens",
    "state": "Attica",
    "postcode": "12345",
    "country": "GR",
    "phone": "+306900000000",
    "email": "email@domain.com"
  },
  "payment_method": "cash_on_delivery",
  "payment_status": "pending",
  "created_at": "2022-02-20T18:14:00.000Z",
  "items": [
    {
      "id": "product_id",
      "name": "name",
      "quantity": 2,
      "price": 11,
      "width": 0,
      "length": 0,
      "height": 0,
      "weight": 0,
      "image_url": null
    }
  ]
}'
```

{% endtab %}
{% endtabs %}

### Payment methods

Inside an order `payment_method` listed above should be one of the following fields:

* cash\_on\_delivery&#x20;
* bank\_transfer&#x20;
* paypal&#x20;
* card&#x20;
* free&#x20;
* unknown

### Payment Statuses

Inside an order `payment_status` listed above should be one of the following fields:

* pending
* paid

## Example response

```
{
  "status": "ok",
  "data": {
    "id": "820b648b-2d06-4786-8b13-73a6dc8b4aec",
    "state": "new",
    "store_id": "https://test-store.gr",
    "source_id": "1",
    "shipment_id": null,
    "total": 22,
    "currency": "eur",
    "payment_method": "cash_on_delivery",
    "payment_status": "pending",
    "billing_address": {
      "company": "string",
      "first_name": "string",
      "last_name": "string",
      "address_1": "string",
      "address_2": "string",
      "country": "string",
      "state": "string",
      "postcode": "string",
      "city": "string",
      "phone": "string",
      "email": "string"
    },
    "shipping_address": {
      "company": "string",
      "first_name": "string",
      "last_name": "string",
      "address_1": "string",
      "address_2": "string",
      "country": "string",
      "state": "string",
      "postcode": "string",
      "city": "string",
      "phone": "string",
      "email": "string",
      "notes": null
    },
    "shipping_option": {
      "driver": null,
      "service": null
    },
    "ecommerce_token": null,
    "ecommerce_id": "1",
    "ecartapi_id": null,
    "has_shipment_draft": false,
    "items": [
      {
        "id": "product_id",
        "name": "name",
        "quantity": 2,
        "price": 11,
        "width": 0,
        "height": 0,
        "length": 0,
        "weight": 0,
        "image_url": null
      }
    ],
    "completed": false,
    "deleted_at": null,
    "created_at": "2022-02-20T18:14:00.000Z",
    "updated_at": "2022-10-10T16:02:43.825Z"
  }
}
```


---

# 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://docs.shiplemon.com/endpoints/incoming-orders/create-incoming-order.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.
