Skip to content

OR31 - Update the custom fields of an order and its order lines

Request

Description

Only specified custom field values will be updated.
In order to delete an custom field's value, set it to null or an empty string. Note that you may not delete the value of a required custom field value.
Output will return information on the status of the update attempt by giving:

  • either all of the order and its order lines custom field values after the update
  • or in case of errors, the list of errors and the body of the initial call

Call Frequency
Maximum usage: 5 calls per second
Security
Front-Bearer-Token or OAuth-2
Path
order_idstringrequired

Order identifier

Bodyapplication/json
order_additional_fieldsArray of objects

Order custom fields

order_linesArray of objects

Order lines custom fields

curl -i -X PUT \
  'https://your-instance.mirakl.net/api/orders/{order_id}/additional_fields' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "order_additional_fields": [
      {
        "code": "ecotax",
        "value": [
          "15"
        ]
      }
    ],
    "order_lines": [
      {
        "order_line_additional_fields": [
          {
            "code": "delivery-countries",
            "value": [
              "Canada"
            ]
          }
        ],
        "order_line_id": "Order_00014-A-1"
      }
    ]
  }'

Responses

OK

Bodyapplication/json
order_update_errorsobject

Error report of an invalid request, with the body of the initial call

order_update_resultobject

Order and order line custom fields values after the update has been processed

Response
{ "order_update_result": { "order_additional_fields": [ … ], "order_lines": [ … ] } }