Skip to content

OR32 - Adjust order line

Request

Description

Update order line actual measurement either upwards or downwards, within the limit defined at the platform level.

Error Codes
CodeDescription
ORDER_ADJUSTMENT_FEATURE_DISABLEDThe order adjustment feature is not enabled
ORDER_LINE_ADJUSTMENT_EQUAL_TO_ORDEREDThe actual measurement equals the ordered measurement
ORDER_LINE_ADJUSTMENT_EXCEEDS_DOWNWARD_LIMITThe downward adjustment exceeds the allowed limit
ORDER_LINE_ADJUSTMENT_EXCEEDS_UPWARD_LIMITThe upward adjustment exceeds the allowed limit
ORDER_LINE_ALREADY_ADJUSTEDThe order line has already been adjusted
ORDER_LINE_ALREADY_REFUNDEDThe order line has already been refunded
ORDER_LINE_DUPLICATE_IDThe order lines list contains duplicate order line IDs
ORDER_LINE_INVALID_STATEOrder lines are not in the expected state for this operation
ORDER_LINE_MISSING_MEASUREMENTThe order line does not have a measurement unit
ORDER_LINE_NOT_FOUNDThe requested order line does not exist or is not associated with the order
ORDER_LINE_PAY_PER_SHIPMENT_NOT_ADJUSTABLEThe order line cannot be adjusted with the current pay-per-shipment state
ORDER_LINE_PAY_PER_SHIPMENT_WAITING_DEBITThe order line is part of a shipment waiting for debit
ORDER_LINE_ZERO_AMOUNTThe order line amount is zero
VALIDATION_ERRORInput validation failed
Call Frequency
Maximum usage: Once per minute, 100 order lines per call
Security
Operator-Bearer-Token or OAuth-2
Bodyapplication/json
order_linesArray of objects, [ 1 .. 100 ] itemsrequired

Order lines to be updated, maximum number of order lines per call: 100

curl -i -X PUT \
  https://your-instance.mirakl.net/api/orders/adjust \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "order_lines": [
      {
        "actual_measurement": 0.85,
        "order_line_id": "ORDER_0014-A-1"
      },
      {
        "actual_measurement": 1,
        "order_line_id": "ORDER_9999-A-1"
      }
    ]
  }'

Responses

OK

Bodyapplication/json
order_lines_adjustedArray of objects

A list of updated order lines and orders in error objects

Response
{ "order_lines_adjusted": [ { … }, { … } ] }