Easymailing
Orders

Create a cart

POST /stores/{storeResourceId}/orders

POST/stores/{storeResourceId}/orders

Creates an order in cart status for a customer: the shopper has started the checkout but not bought yet. No automation starts at this moment.

A cart that is not updated for the time set in an abandoned-cart automation can start it. Move it forward with process_order, pay_order, ship_order, cancel_order or refund_order.

When to use: When a shopper adds products or starts the checkout, so that a cart can be recovered if it is abandoned.

When not to use: To load an order that already has its final status (for example from an old shop), use import_order; to change a cart use update_store_order.

Permissions: Requires the manager role or higher, or the marketing.audiences.write capability.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

storeResourceId*string

Identifier (resource_id) of the store the order belongs to.

Request Body

The new Order resource

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://api.easymailing.com/stores/acme-shop/orders" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "resource_id": "string",    "currency": "string",    "currency_exchange_rate": 0.1,    "order_total": 0,    "tax_total": 0,    "discount_total": 0,    "shipping_total": 0,    "checkout_url": "http://example.com",    "campaign_hash": "string",    "order_items": [      {        "quantity": 1,        "price": 0,        "discount": 0,        "variant": "/entity/1"      }    ],    "customer": "/entity/1",    "created_at": "2019-08-24T14:15:22Z"  }'
{  "resource_id": "string",  "currency": "string",  "currency_exchange_rate": 0.1,  "order_total": 0,  "tax_total": 0,  "discount_total": 0,  "shipping_total": 0,  "checkout_url": "http://example.com",  "status": "cart",  "order_number": "string",  "tracking_number": "string",  "tracking_carrier": "string",  "tracking_url": "http://example.com",  "abandoned_cart_at": "2019-08-24T14:15:22Z",  "processed_at": "2019-08-24T14:15:22Z",  "paid_at": "2019-08-24T14:15:22Z",  "cancelled_at": "2019-08-24T14:15:22Z",  "campaign_hash": "string",  "order_items": [    {      "quantity": 1,      "price": 0,      "discount": 0,      "variant": "/entity/1"    }  ],  "customer": "/entity/1",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}