API reference · Orders

Update Order Status - Marketplace

PUThttps://api.sandbox.cws.digital/partnerOrders/store/{id}

Description

Allows the origin store to move an order that was born in it to the next status, saving along with it the data that status requires.

The body, the transitions and the response are identical to those of the store route. The difference is the scope and a configuration prerequisite — see The store must be enabled.

The invoice fields are only saved when the order does not have an invoice yet: resending them on an order already marked with an invoice does not overwrite the values.

Parameters

Path parameters

FieldTypeRequiredDescriptionValue
idintegerYes

Id of the partner order (partnerOrderId), the id field of the listing.

Request body

Content-Typeapplication/jsonRequired
Edit the body with
FieldTypeRequiredDescriptionValue
statusstringYes

Target status. See Where the order can go.

supplierOrderIdstringConditional

Order number in your system. Required when status is READY.

supplierInvoiceNumberstringConditional

Invoice number. Accepted in READY and SHIPPED; required in SHIPPED when the order has no invoice yet.

supplierInvoiceSeriestringNo

Invoice series. Accepted in READY and SHIPPED.

supplierInvoiceKeystringNo

Invoice access key. Accepted in READY and SHIPPED.

supplierInvoiceDatestringNo

Invoice issue date, in the format 2026-09-01T08:30:00. A date in an invalid format refuses the request with 422.

trackingCodestringConditional

Tracking code. Accepted in SHIPPED and required when the order's shipping is Correios. When sent, requires ownCarrier.

urlTrackingCodestringNo

Carrier's tracking URL. Optional, accepted in SHIPPED.

ownCarrierstringConditional

Name of the carrier making the delivery. Accepted in SHIPPED and required when trackingCode is sent.

orderObservationstringNo

Free note saved in the order. Accepted in READY, SHIPPED and DELIVERED.

orderReasonCanceledintegerNo

Cancellation reason id. Accepted in CANCELED — see Cancellation reasons.

Business rules

Where the order can go

The target status is accepted from a specific current status. Outside that combination, the response is 422.

status sentRequired current statusOwn fields
APPROVEDorder awaiting payment, without credit or with payment at the store—
READYPAYMENT_APPROVEDsupplierOrderId required
SHIPPEDREADYtrackingCode with Correios shipping; with trackingCode, ownCarrier; supplierInvoiceNumber if the order has no invoice yet — see Shipping (SHIPPED)
DELIVEREDSHIPPED—
STRAYEDSHIPPED—
RETURNEDDELIVERED—
AWAITING_PAYMENTAWAITING_PAYMENT—
CANCELEDanyorderReasonCanceled

Payment approval is sent as APPROVED, not as PAYMENT_APPROVED — it is the order that then stays in PAYMENT_APPROVED.

The other values of the status enum (PRE_ORDER, PAYMENT_APPROVED, COMPLETED, WITHOUT_CREDIT_LIMIT, STORE_PAYMENT) are used to filter the listing, but are not accepted here: the request responds 422.

Shipping (SHIPPED)

  • trackingCode is required when the order's shipping is Correios; with other shipping types, it is optional.
  • When you send trackingCode, also send ownCarrier with the carrier's name — that is what gets saved as the delivery carrier.
  • Without ownCarrier and without urlTrackingCode, the response is 422 with Para realizar a atualização do pedido com id <id> ownCarrier e urlTrackingCode é obrigatorio.
  • With only urlTrackingCode, without ownCarrier, the request is also refused with 422.
  • urlTrackingCode is optional.
  • If the order has no invoice number yet, supplierInvoiceNumber is required: without it, the response is 422 with Número de Nota Fiscal é obrigatório.

Order under approval workflow

In an order with an approval workflow (approvalWorkflow: true) not yet approved, the only accepted status is CANCELED. Any other responds 422.

Cancellation reasons

orderReasonCanceled receives the reason id:

IdReasonIdReason
27-day withdrawal20Payment declined
3Logistics problem21No response from the customer
4Description error22No credit
5Lost in transit23Expired
6Lack of payment24Wrong customer
7No response from the store26Wrong order
8Out of stock27Integration failure
9Different brand28Wrong seller
10Damaged product29Chargeback
11Wrong product30Fraud – Product recovered
12Counterfeit part31Suspected fraud
13Wrong store price32Assisted repurchase
14Pre-order33Commercial approval denied
15Incorrect price34Order canceled by the seller
16Wrong composition35Quote edited
17Shipping delay
18Duplicate order
19Test purchase

Who can cancel

When the order was born in another store — you are the supplier, not the origin —, cancellation depends on the origin store having enabled cancellation by the seller.

It is its configuration, not yours: until it enables it, your CANCELED responds 422, and it is the origin store itself that cancels. With the permission on, cancellation works normally.

An order originated in your own store does not go through this check.

The store must be enabled

Updating orders by the origin store depends on a configuration of the store itself. Without it, the request responds 422 without touching the order. The release is done by CWS.

Responses

  • 401

    Missing, malformed or expired token.

  • 404

    The order does not exist or is not in your scope.

Try it

Sandbox

Language

Credentials

Access token: saved in this tab and used on every endpoint.

Each token only reaches the partner's own data and that of the branches with an authorized link.

Don't have sandbox credentials yet? See how to request them

Request

cURL
curl --request PUT \
  --url 'https://api.sandbox.cws.digital/partnerOrders/store/900201' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "status": "READY",
  "supplierOrderId": "PED-ERP-77120",
  "supplierInvoiceNumber": "1234",
  "supplierInvoiceSerie": "1",
  "supplierInvoiceDate": "2026-09-02T08:30:00"
}'

Response

Click Try it to see the real response here, or pick a documented example: