API reference · Orders

Update Items Lead Time

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

Description

Reports the preparation lead time of the items left with the lead time upon request. It is this submission that releases the order for payment: once the lead times are answered, the customer is notified that the order is available.

The pending items are in List Items with Lead Time Upon Request.

Parameters

Path parameters

FieldTypeRequiredDescriptionValue
idintegerYes

Id of the partner order (partnerOrderId).

Request body

Content-Typeapplication/jsonRequired
Edit the body with
FieldTypeRequiredDescriptionValue
partnerOrderLineListarray of objectYes

The order items whose lead time is pending.

Fields in partnerOrderLineList[]

Items of partnerOrderLineList[]
partnerOrderLineList[]
FieldTypeRequiredDescriptionValue
idintegerYes

Order line id — the id field of the query, and the deliveries[].products[].partnerOrderLineId of the order details.

leadTimeintegerYes

Item preparation lead time, in days. Greater than zero.

Business rules

All pending items, at once

The request must bring all the order items whose lead time is pending. If one is missing, nothing is saved and the response is 422.

There is no partial submission: check the list, answer the whole list.

The order must be waiting for the lead time

Only accepts an order that was born with lead time upon request and that has not had its lead times answered yet. Once answered, the lead time cannot be edited again here.

The status must allow it

The order must be in PRE_ORDER, AWAITING_PAYMENT or PAYMENT_APPROVED. In any other status the update is refused.

What answering the lead time triggers

Once the lead times are saved, three things happen at once:

  • the delivery preparation lead time adds the largest reported lead time — and, in stores configured for it, the freight lead time adds it too;
  • the order is marked as answered;
  • the customer is notified that the order is available for payment.

Responses

  • 401

    Missing, malformed or expired token.

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/900201/partnerOrderLines' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "partnerOrderLineList": [
    {
      "id": 4490101,
      "leadTime": 5
    },
    {
      "id": 4490102,
      "leadTime": 3
    }
  ]
}'

Response

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