Order management
Find, annotate, tag, cancel, and archive orders with the Admin API.
Every morning, a store in Lima reviews yesterday's orders with the Admin API: it finds the unpaid ones, tags the urgent ones, and archives the delivered ones.
Requirements
- An Admin token in
ECOMIQ_TOKEN. See Quickstart. - The
order:readpermission to find, read, and export, andorder:updatefor everything else. - Node.js 18 or Python with
requests, for the examples.
Find orders
GET / filters by status, date, tag, and text. This example returns
yesterday's orders that still have a balance to collect.
curl "https://api.ecomiq.pe/api/v1/orders?task=toCollect&dateFrom=2026-10-05T05:00:00Z&dateTo=2026-10-06T04:59:59Z&limit=50" \
-H "Authorization: Bearer $ECOMIQ_TOKEN"{
"data": [
{
"id": "7204558912004325301",
"orderNumber": "ORD-2026-0142",
"firstName": "Andrea",
"lastName": "Ramos",
"status": "new",
"state": "open",
"currencyCode": "PEN",
"total": 178,
"paymentAt": null,
"tags": null,
"assignee": null,
"archivedOn": null,
"orderDate": "2026-10-05T19:42:10Z"
}
],
"hasNextPage": false,
"nextCursor": null,
"totalCount": 1
}The next steps reuse ADMIN, headers, and HEADERS.
| To see | Send |
|---|---|
| Orders with a balance to collect | task=toCollect |
| Orders whose last payment failed | task=rejectedPayments |
| Confirmed orders to prepare | task=toPrepare |
| One status | status=confirmed |
| A date range | dateFrom and dateTo, in UTC |
| One tag | tags=urgent |
| One seller | sellerIds=7204558912004320500 |
| Archived or not | archived=true or archived=false |
| Free text | search: number, email, name, phone, product, or SKU |
- Repeat a parameter to send several values:
status=new&status=confirmed. - Without
archived, the list includes archived orders.taskleaves out archived, canceled, and invalid orders. - Sort with
sortBy(orderDate,orderNumber,total, orupdatedOn) andsortDirection. The default is newest first. See Pagination.
Read an order
With include=trackings, the response adds the order timeline, newest first.
curl "https://api.ecomiq.pe/api/v1/orders/7204558912004325301?include=trackings" \
-H "Authorization: Bearer $ECOMIQ_TOKEN"{
"id": "7204558912004325301",
"orderNumber": "ORD-2026-0142",
"status": "new",
"state": "open",
"email": "andrea.ramos@example.com",
"total": 178,
"notes": null,
"tags": null,
"assignee": null,
"archivedOn": null,
"updatedOn": "2026-10-05T19:42:10.512344Z",
"financialSummary": {
"paidAmount": 0,
"refundedAmount": 0,
"balanceDue": 178,
"refundableAmount": 0
},
"trackings": [
{
"type": "new",
"title": "Order Created",
"content": "Order created successfully.",
"createdOn": "2026-10-05T19:42:10Z"
}
]
}Keep updatedOn: you need it to change the note.
Add a note and an assignee
PATCH / changes the internal note and the team member
in charge of the order. It returns 204.
curl -X PATCH https://api.ecomiq.pe/api/v1/orders/7204558912004325301/notes \
-H "Authorization: Bearer $ECOMIQ_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"notes": "Leave it at the front desk. The customer works during the day.",
"assignedMemberId": "7204558912004320011",
"expectedUpdatedOn": "2026-10-05T19:42:10.512344Z"
}'- The call replaces both fields.
assignedMemberId: nullremoves the assignee; to keep it, send the currentassignee.memberId. - The assignee must be an active member of the store.
- Send
updatedOnexactly as you read it, without parsing it as a date. If the order changed, the API returns409: read it again and retry.
Comment on the order
The note is a single text. Comments add up in the timeline, with your user and the time.
curl -X POST https://api.ecomiq.pe/api/v1/orders/7204558912004325301/comments \
-H "Authorization: Bearer $ECOMIQ_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "content": "Called Andrea: she pays today by bank transfer." }'It returns 204. The comment shows up in trackings with type: "note". It
takes up to 2,000 characters, attachmentUrls, and up to 20
mentionedMemberIds to alert your team.
Tag orders
PATCH / replaces every tag. Read tags, add yours,
and send the full list.
curl -X PATCH https://api.ecomiq.pe/api/v1/orders/7204558912004325301/tags \
-H "Authorization: Bearer $ECOMIQ_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "tags": "urgent,gift" }'- Separate tags with commas and no spaces. The whole text takes up to 500
characters. Empty or
nullclears them. - Then filter with
tags=urgent. The filter ignores case. - A seller token can't tag or comment: the API returns
403.
Send a payment reminder
POST / emails the customer the balance
due.
curl -X POST https://api.ecomiq.pe/api/v1/orders/7204558912004325301/payment-reminder \
-H "Authorization: Bearer $ECOMIQ_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"idempotencyKey": "reminder-ORD-2026-0142-1",
"dueDate": "2026-10-08"
}'- It returns
202. If you repeat theidempotencyKey, the customer gets a single email. Use up to 50 characters. dueDateis optional and shows in the email.- The order needs an
emailand a balance due. It can't be canceled or invalid.
Cancel an order
If the customer didn't pay, cancel the order. notifyCustomer: false skips the
cancellation email.
curl -X POST https://api.ecomiq.pe/api/v1/orders/7204558912004325301/cancel \
-H "Authorization: Bearer $ECOMIQ_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cancelReason": "We did not receive the payment.",
"cancelReasonType": "unpaid",
"notifyCustomer": false
}'It returns 200 with the order. Statuses and events are in
Order lifecycle.
- Authorized payments that weren't captured are released, unless the same payment covers another active order.
- Canceling doesn't return money already captured. Check
financialSummary.refundableAmountand refund it with Returns and refunds. - To cancel and refund in one step before shipping, use
Cancel order with refund.
It also needs
payment:create.
Archive orders
Archiving takes the order out of your daily list. It doesn't change its status or its payments.
curl -X PUT https://api.ecomiq.pe/api/v1/orders/7204558912004325301/archive \
-H "Authorization: Bearer $ECOMIQ_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "archived": true }'- It returns
204. Send"archived": falseto restore it. - To find delivered orders still in view, search with
status=delivered&archived=false. - Canceling an order archives it too. With
orderProcessing.autoArchiveDeliveredOrdersin the store settings, delivered and paid orders are archived automatically.
Update in bulk
POST / moves several orders to the same status. This
example cancels three unpaid orders.
curl -X POST https://api.ecomiq.pe/api/v1/orders/batch/status \
-H "Authorization: Bearer $ECOMIQ_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"targetStatus": "cancelled",
"ids": ["7204558912004325301", "7204558912004325302", "7204558912004325303"],
"cancelReason": "No payment received within 48 hours.",
"cancelReasonType": "unpaid"
}'{
"results": [
{
"index": 0,
"id": "7204558912004325301",
"status": "updated",
"errors": []
},
{
"index": 1,
"id": "7204558912004325302",
"status": "updated",
"errors": []
},
{
"index": 2,
"id": "7204558912004325303",
"status": "failed",
"errors": [
{
"field": "id",
"code": "Orders.NotFound",
"message": "Order not found."
}
]
}
]
}Each order is processed on its own. Check the status of every result.
- Send
ids(up to 100) orfilters, not both. Withfilters, the API returns202with an operation; follow it with Get operation. - An empty
filtersselects every order in the store. Narrow it withstatuses,tags,dateFrom,dateTo, ororderIds. targetStatusacceptsconfirmed,inProgress,invoiced,readyToPickUp(withtrackingNumber),inTransit,delivered,cancelled,returned,closed, andinvalid. A bulk cancel always notifies the customer.
Export orders
POST / builds a file with the orders you pick. It returns
202 with an operation.
curl -X POST https://api.ecomiq.pe/api/v1/orders/exports \
-H "Authorization: Bearer $ECOMIQ_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"format": "csv",
"statuses": ["delivered"],
"dateFrom": "2026-09-01T05:00:00Z",
"dateTo": "2026-10-01T04:59:59Z"
}'{
"id": "7204558912004325410",
"status": "pending",
"resource": "orders",
"format": "csv",
"createdOn": "2026-10-06T13:05:00Z"
}- Filters go in the body, in plural:
statuses,states,fulfillmentStatuses,tags,orderIds, andorderNumbers. formatacceptscsv,xlsx, orjsonl. The default isxlsx.- Poll
GET /. Oncev1/ operations/ {id} statusiscompleted,resultUrlpoints to the file.
Errors
code | Status | What to do |
|---|---|---|
Common.Validation | 400 | Fix the fields in errors, such as a limit outside 1 to 200 or more than 100 ids. |
Orders.NotFound | 404 | The order doesn't exist or belongs to another seller. |
Orders.AssigneeNotMember | 400 | Assign an active member of the store. |
Orders.VersionConflict | 409 | Read the order again and resend its updatedOn. |
Seller.ScopeNotAllowed | 403 | Tag and comment with a store token. |
Orders.CustomerEmailRequired | 400 | Add the email with Update order contact. |
Orders.NoBalanceDue | 409 | The order is already paid. Skip the reminder. |
Orders.PaymentReminderNotAllowed | 409 | The order is canceled or invalid. |
Orders.PaymentInProgress | 409 | Another payment on the order is in progress. Retry later. |
Common.Conflict | 409 | The order can no longer be canceled: it was delivered, returned, closed, or invalidated. |
Next steps
- Order lifecycle: confirm, ship, and deliver.
- Returns and refunds: give back captured money.
- Orders: every operation.
Last updated: