Skip to content

SOR04 - Update an order

Request

Description

Note: closed or cancelled order cannot be updated.

Path
order_idstringrequired

The identifier of the order to be updated

Query
shop_idinteger, (int64)

Use this parameter when your user has access to several shops. If not specified, the shop_id from your default shop will be used.

Bodyapplication/json
bookingobject
custom_attribute_valuesArray of objects

Order custom attribute values to update.
Only specified custom attribute values will be updated. In order to delete a custom attribute value, set it to null.

priceobject

New price for this order.

curl -i -X PUT \
  'https://your-instance.mirakl.net/api/mms/orders/{order_id}?shop_id=0' \
  -H 'Content-Type: application/json' \
  -d '{
    "custom_attribute_values": [
      {
        "code": "EQUIPT_TO_BRING",
        "type": "TEXT",
        "value": "a picnic"
      },
      {
        "code": "AGE_MIN",
        "type": "INTEGER"
      }
    ],
    "price": {
      "amount": 20
    }
  }'

Responses

OK

Bodyapplication/json
bookingobjectrequired
can_evaluatebooleanrequired

Indicates if the order can be evaluated by the customer

commercial_order_idstringrequired

Order commercial ID

commissionobject

Order commission

consumptionobjectrequired
currency_codestringrequired

Order currency ISO Code

custom_attribute_valuesArray of objectsrequired

Custom attribute values defined on the order

customerobject

Customer who purchased the service.
The node customer is not present when:

  • the order is not yet accepted
  • the order is cancelled or closed and was never accepted

customer_notification_emailstring

Anonymized customer email usable for notifications that do not expect an answer

date_acceptedstring, (date-time)

Order acceptance date

date_createdstring, (date-time)required

Order creation date

date_updatedstring, (date-time)required

Order last modification date

has_open_incidentboolean

true if order has an incident open

idstringrequired

Order ID

locationobjectrequired
priceobject
refundsArray of objects

The list of refunds, sorted by creation date in ascending order

serviceobjectrequired

The service that was purchased

statestringrequired

Order state

Enum: "WAITING_SCORING", "SCORING_OK", "SCORING_KO", "WAITING_ACCEPTANCE", "ORDER_ACCEPTED", "ORDER_REFUSED", "ORDER_PENDING", "ORDER_CONSUMED", "ORDER_EXPIRED", "ORDER_CLOSED", "ORDER_CANCELLED"

warningsArray of strings

A list of warnings that should be checked before validating the order

workflowobjectrequired

Order workflow

Response
{ "booking": { "type": "NO_BOOKING" }, "can_evaluate": false, "commercial_order_id": "ZWXUBOH3", "consumption": { "date_consumed": "2017-08-10T12:40:18Z", "date_expiration": "2017-08-03T00:30:18Z", "type": "VOUCHER" }, "currency_code": "CAD", "custom_attribute_values": [ { … } ], "customer": { "billing_address": { … }, "civility": "Mr.", "email": "william.matos@email.com", "first_name": "William", "id": "578-78-7497", "last_name": "Matos", "locale": "de_DE", "phone_number": "0607080910" }, "date_created": "2017-06-03T00:30:18Z", "date_updated": "2017-06-03T00:30:18Z", "has_open_incident": false, "id": "ZWXUBOH3-2", "location": { "shop_locations": [ … ], "type": "AT_SHOP_LOCATION" }, "price": { "amount": 32.95, "options": [ … ], "quantity": 1, "type": "FIXED_PRICE" }, "refunds": [ { … } ], "service": { "category": { … }, "code": "FINE_DINNER_AT_ANGELO'S", "custom_attribute_values": [ … ], "medias": [ … ], "model": { … }, "title": "Fine dinner at Angelo's" }, "state": "ORDER_PENDING", "warnings": [ "PRICE_MISMATCH" ], "workflow": { "type": "PAY_ON_ACCEPTANCE" } }