Updates the state of an order and its various fields within the Nuport system. You should be able to map your own flow to Nuport's order flow.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
How updates work
Send only the fields you want to change. Fields you leave out stay as they are. The request must contain at least one field.
Updates are all-or-nothing: if any part of the request is rejected, nothing on the order changes, including stock.
If you send values the order already has, the request succeeds and nothing changes. updatedFields comes back empty and requestRef is null.
The response
A successful response returns the full order, in the same format as Get Order Details, plus two fields:
| Field | Description |
|---|---|
updatedFields | The fields whose value changed, for example ["discountAmount", "products", "status"]. Customer changes appear as distributor.name, distributor.phone and distributor.address. Empty when nothing changed. |
requestRef | An ID for this request, shared by every order log entry it created. null when nothing changed. |
onHoldReason is null unless the order is On-Hold.
Amounts and totals
After every change, Nuport recalculates the order total:
totalDueAmount = products total + delivery charge − discount − amount already paid
discountAmountis a flat amount in taka. It replaces any percentage discount on the order.- Changing the delivery charge on an order already sent to a courier updates Nuport only. Nothing is sent to the courier.
Product quantities
You can change the quantity of products already on the order. You cannot add or remove products with this endpoint.
Stock is only affected for orders that hold stock (Approved and later):
- Raising a quantity takes the extra units from available stock at the order's pick-up warehouse. If there isn't enough stock, the request fails with
409and nothing changes. - Lowering a quantity returns the units to available stock.
- Pending and On-Hold orders hold no stock, so their quantities can be changed freely. Stock is checked when they are approved.
Customer
distributor.phone decides which customer the order belongs to, the same way it does in Upsert Order:
- Phone of an existing customer: the order moves to that customer, and the delivery address becomes that customer's main address.
- New phone: a new customer is created with the name, phone and address you send.
- Same phone in another format (
+8801…or01…): treated as the same customer, so nothing changes.
distributor.name renames the customer record, so the new name shows on all of that customer's orders, as it does in the dashboard.
distributor.address is added to the customer's addresses and set as this order's delivery address.
If the order has no customer yet, you must send distributor.phone.
Customer changes save first
A new customer name or address is saved just before the order itself is updated. If the order update then fails (for example, not enough stock), the name or address change is kept.
Status changes
For orders in your own warehouses, status changes follow the same rules as the Nuport dashboard and trigger the same actions: stock updates, customer SMS and webhooks. A move the dashboard does not allow returns 400.
| API value | Dashboard label |
|---|---|
REQUESTED | Pending |
APPROVED | Approved |
ON_HOLD | On-Hold |
PROCESSING | Processing |
SHIPPED | Ready to Ship |
COMPLETED | Delivered |
CANCELLED | Cancelled |
status is case-insensitive, so approved and APPROVED are the same.
Sub-status
| API value | Meaning |
|---|---|
PAYMENT_DUE | Payment is still due on the order |
subStatus can only be sent together with status, for example { "status": "COMPLETED", "subStatus": "PAYMENT_DUE" }. Sending subStatus alone returns 400. The status move itself must still be allowed: from Pending, this example returns 400 because Pending cannot move straight to Delivered.
On-Hold reason
- To put an order On-Hold with a reason, send
status: "ON_HOLD"andonHoldReasontogether. - To change the reason on an order that is already On-Hold, send
onHoldReasonalone. - When the order leaves On-Hold, the reason is cleared.
- Sending
onHoldReasonfor an order that is not On-Hold returns409.
Fields locked by status
Once an order reaches certain statuses, such as Delivered or Cancelled, its fields can no longer be changed. The API returns 409 naming the field and status, for example Field discountAmount cannot be changed in status COMPLETED.
Field error messages use API status values (COMPLETED, REQUESTED), not dashboard labels.
Orders in the Nuport Fulfillment warehouse
When an order's current pick-up warehouse is the Nuport Fulfillment warehouse, Nuport manages its fulfillment, so the API allows only these status moves:
| From \ To | Pending | Approved | On-Hold | Cancelled | Any other |
|---|---|---|---|---|---|
| Pending | — | ✅ | ✅ | ✅ | ❌ |
| Approved | ✅ | — | ✅ | ✅ | ❌ |
| On-Hold | ✅ | ✅ | — | ✅ | ❌ |
| Cancelled | ✅ | ❌ | ❌ | — | ❌ |
- Any other move returns
409with a message using dashboard labels, for exampleStatus update from Pending to Processing is not allowed for orders in the Nuport Fulfillment warehouse. - Once the order is past Pending, Approved, On-Hold or Cancelled (for example Processing), no changes are allowed through the API. The request returns
409and nothing is saved. - Cancelling is final.
- The order's current pick-up warehouse decides which rules apply. If you switch the warehouse in the dashboard, the API follows the new warehouse.
Errors
| Code | When |
|---|---|
400 | Empty body; wrong value type; subStatus without status; the same product sent twice; the order has no customer and no distributor.phone was sent; a status move the dashboard doesn't allow |
401 | Missing or wrong API key |
404 | No order with that internalId in your company |
409 | The order's status doesn't allow the change; a Nuport Fulfillment warehouse rule; not enough stock; another update for the same order is still in progress |
422 | Unknown or non-changeable field (the message names it); product not on the order |
If two updates for the same order arrive at the same moment, they are applied one after the other, or the second gets 409 with a message that the order is already being processed. Retry it.
Order logs and webhooks
- Every change appears in the order's Logs tab, one entry per changed field, under your company's account owner name followed by via API. Entries appear a few seconds after the response.
- Rejected requests and requests that change nothing create no log entries.
- If you have webhooks set up, an API update sends the same status and
order.updatedevents as an edit in the dashboard.
Legacy endpoint
PATCH /integration/orders, withinternalIdin the request body, still works and follows the same status and Nuport Fulfillment warehouse rules. UsePATCH /integration/orders/{internalId}for new integrations.
