Update Order

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.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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:

FieldDescription
updatedFieldsThe fields whose value changed, for example ["discountAmount", "products", "status"]. Customer changes appear as distributor.name, distributor.phone and distributor.address. Empty when nothing changed.
requestRefAn 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

  • discountAmount is 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 409 and 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… or 01…): 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 valueDashboard label
REQUESTEDPending
APPROVEDApproved
ON_HOLDOn-Hold
PROCESSINGProcessing
SHIPPEDReady to Ship
COMPLETEDDelivered
CANCELLEDCancelled

status is case-insensitive, so approved and APPROVED are the same.

Sub-status

API valueMeaning
PAYMENT_DUEPayment 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" and onHoldReason together.
  • To change the reason on an order that is already On-Hold, send onHoldReason alone.
  • When the order leaves On-Hold, the reason is cleared.
  • Sending onHoldReason for an order that is not On-Hold returns 409.

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 \ ToPendingApprovedOn-HoldCancelledAny other
Pending—✅✅✅❌
Approved✅—✅✅❌
On-Hold✅✅—✅❌
Cancelled✅❌❌—❌
  • Any other move returns 409 with a message using dashboard labels, for example Status 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 409 and 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

CodeWhen
400Empty 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
401Missing or wrong API key
404No order with that internalId in your company
409The 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
422Unknown 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.updated events as an edit in the dashboard.

📘

Legacy endpoint

PATCH /integration/orders, with internalId in the request body, still works and follows the same status and Nuport Fulfillment warehouse rules. Use PATCH /integration/orders/{internalId} for new integrations.

Path Params
string
required

The internalId you set when creating the order with Upsert Order.

Body Params
distributor
object

The order's customer. Send only the parts you want to change.

products
array of objects

New quantities for products already on the order. Products cannot be added or removed. Each product can appear only once.

products
double

Order-level discount in taka, 0 or more. Replaces any percentage discount on the order.

string

Delivery charge in taka, 0 or more.

string

Notes on the order. Send an empty string to clear them.

string
enum

The status of an order. Follow the diagram to change the status of an order in a sequence that makes logical sense within your own system.

Allowed:
string
enum

Sub-status of the order, for example PAYMENT_DUE. Can only be sent together with DELIVERED status.

Allowed:
string

Reason the order is On-Hold, up to 250 characters. Only accepted when the order is On-Hold or is being moved to On-Hold in the same request.

Headers
string
required
Defaults to API_KEY

Bearer . Find your API key on the Nuport dashboard under Configuration > Integrations. Pressing Generate creates a new key and stops the old one from working.

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json