Import an order
POST /stores/{storeResourceId}/orders/import
/stores/{storeResourceId}/orders/importLoads an order with the status it already has (cart, new, paid, shipped, refunded or cancelled), without going through the usual steps. It does not start Classic automations or credit campaign revenue; the statistics of the store are recalculated. In the new automations, an imported order or cart only enters if its own date (processed, payment, cancellation or the cart's own date) is within the last 24 hours and later than the automation's publication.
When to use: To bring in the history of a shop (orders that already happened), for example when connecting it for the first time.
When not to use: For a live order, create a cart with create_store_order and move it forward with the action operations, so automations and revenue tracking run.
Side effects: The statistics of the store are recalculated in the background. No Classic automation is started; for the new automations, see the date rule above.
Permissions: Requires the manager role or higher, or the marketing.audiences.write capability.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
Identifier (resource_id) of the store the order belongs to.
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/import" \ -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", "status": "cart", "order_number": "string", "tracking_number": "string", "tracking_carrier": "string", "tracking_url": "http://example.com", "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" }'{ "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"}