Mirakl Platform for Services APIs

General Notes

Backward compatibility information

Mirakl solutions are updated through continuous delivery to provide new features, security fixes and bug fixes.

New deployed versions are backward compatible, which guarantees the durability of your integration after a Mirakl solution update, on condition that your integration follows these guidelines:

  • Your integration must allow for new fields to be added in API responses. From time to time, we add new fields as part of new features.
  • Do not expect fields to always have the same order in API calls. The order can change when fields are added to APIs.
  • Your integration must allow for new values to be added in enumeration fields. We can add new values in enumeration fields to support new features. We advise that you use strings to deserialize enumeration fields. Alternatively, you can configure your deserializer to accept unknown enumeration values.

While most of our APIs support XML format, we strongly advise you to use JSON format, as our newest APIs are only available in JSON format.

Should you decide to validate our APIs output using XSD files, please note that your XSD should take into account the guidelines defined above. Mirakl does not provide XSD files for its APIs and does not offer support for writing XSD files.

Undocumented attributes

Some APIs may return more data than indicated in the documentation. Do not rely on this undocumented data, there is no guarantee about it.

Authentication

You can authenticate through API by sending your API key in a header.

HTTPS only

All requests must use the HTTPS protocol.

API return codes

Mirakl API uses standard HTTP return codes.

When making HTTP requests, you can check the success or failure status of your request by using the HTTP Status Codes (i.e. 200). You must not use the HTTP Status Messages or Reason-Phrases (i.e. OK), as they are optional and may not be returned in HTTP responses (see RFC9110 for more information).

Our API documentation does not document Reason-Phrases but provides a short contextualized description of HTTP Status Codes.

Success Codes

  • 200: OK - Request succeeded.
  • 201: Created - Request succeeded and resource created.
  • 202: Accepted - Request accepted for processing.
  • 204: No Content - Request succeeded but does not return any content.

Error Codes

  • 400: Bad Request - Parameter errors or bad method usage. Bad usage of the resource. For example: a required parameter is missing, some parameters use an incorrect format, a data query is not in the expected state.
  • 401: Unauthorized - API call without authentication. Add authentication information or use a valid authentication token.
  • 403: Forbidden - Access to the resource is denied. Current user can not access the resource.
  • 404: Not Found - The resource does not exist. The resource URI or the requested resource do not exist for the current user.
  • 405: Method Not Allowed - The HTTP method (GET, POST, PUT, DELETE) is not allowed for this resource. Refer to the documentation for the list of accepted methods.
  • 406: Not Acceptable - The requested response content type is not available for this resource. Refer to the documentation for the list of correct values of the Accept header for this request.
  • 410: Gone - The resource is permanently gone. The requested resource is no longer available and will not be available again.
  • 415: Unsupported Media Type - The entity content type sent to the server is not supported. Refer to the documentation for the list of correct values of the Content-type header to send data.
  • 429: Too many requests - Rate limits are exceeded. The user has sent too many requests in the last hour. Refer to the documentation for the maximum calls count per hour.
  • 500: Internal Server Error - The server encountered an unexpected error.

Rate limits

Mirakl APIs are protected by rate limits. Each API has a dedicated section displaying its rate limit.

If you make too many calls, you might receive an HTTP 429 "Too Many Requests" error. The response will contain a Retry-After header that specifies the number of seconds to wait before making a new request.

Request Content-Type

If an API request supports multiple Content-Types, add a Content-Type header to select the format to use in the request. The API documentation lists the formats an API can consume.

Response Content-Type

If an API response supports multiple Content-Types, add an Accept header to select the format accepted in the response. The API documentation lists the formats an API can produce.

List of values as URL parameters

array type fields indicate a list of values as URL parameters. You can add more parameter=value elements to the URL. Refer to the example in the right panel.

UTF-8 encoding

Text data is encoded in UTF-8.

Locale

If the API returns internationalized data, you can specify the locale parameter.

The Locale format is usually <ISO-639>_<ISO-3166> (e.g. "en_US"). There are some exceptions where the Locale format can be <ISO-639> (e.g. "en"). The locale returned in a response uses this format.

The APIs only accept locales that are equivalent to the languages activated in the back-office.

Date formats

APIs can use different date formats (compliant with ISO 8601):

  • date-time with the pattern YYYY-MM-DDThh:mm:ss[.SSS]±hh:mm.
    • The offset +00:00 can be replaced by Z (the zero UTC offset).
    • All APIs provide date-times in UTC, with the trailing Z.
    • Milliseconds may be omitted if equals to .000.
  • date-time-without-timezone with the pattern YYYY-MM-DDThh:mm:ss[.SSS].
    • The timezone does not appear.
    • Milliseconds may be omitted if equals to .000.
  • time with the pattern hh:mm[:ss][.SSS]±hh:mm. Time only, with timezone
    • The offset +00:00 can be replaced by Z (the zero UTC offset).
    • Seconds may be omitted if equals to :00.
    • Milliseconds may be omitted if equals to .000.

In the patterns:

  • YYYY: years (four-digit)
  • MM: months, 01-12 (two-digit)
  • DD: days, 01-31 (two-digit)
  • T is a delimiter between the date and time
  • hh: hours, 00-23 (two-digit)
  • mm: minutes, 00-59 (two-digit)
  • ss: seconds, 00-60 (two-digit)
  • SSS: milliseconds, 000-999 (three-digit)
  • ±hh:mm: refers to an offset from UTC

For GET requests, use URL encoding (for example, 2019-08-29T02:34:00+02:00 becomes 2019-08-29T02%3A34%3A00%2B02%3A00).

Shop Selection

When calling APIs as a shop, a request parameter shop_id is available. This parameter is useful when a user is associated to multiple shops and should be specified to select the shop to be used by the API.

Offset pagination & sort

Some APIs support offset pagination. In this case, you can use the max and offset parameters:

  • max: The max parameter is used to indicate the maximum number of items returned per page. This parameter is optional. The default value of this parameter is 10. The maximum value of this parameter is 100.
  • offset: The offset parameter is used to indicate the index of the first item (among all the results) in the returned page. This parameter is optional. The default value of this parameter is 0, which means that no offset is applied.

With pagination, the URL of the previous and/or next page can be returned in the header's attribute Link of the response.

When a sort parameter is available on such an API, it can be used to sort the results.

sort: The parameter sort is used to indicate how the results should be sorted. This parameter is optional. The possible values for this parameter are defined in resources. The default value of this parameter is defined in resources.

order: The parameter order is used to indicate the sort direction. This parameter is optional. The possible values ​​for this parameter are asc (default) or desc.

Seek pagination & sort

For better performance and user experience, some APIs support "seek" pagination. This means that you cannot go directly to the N-th page.

Use the optional limit query parameter to indicate the maximum number of items returned per page. The default value is 10. The maximum value is 100.

If there are more results to return, the response contains a next_page_token field. Pass this value in the page_token query parameter to return the next page of results.

The API also returns a previous_page_token when the result is not the first page. Use it the same way as next_page_token.

Values of next_page_token and previous_page_token contain all required parameters to access next and previous page. When using the page_token parameter all other parameters are ignored, regardless of the value given to page_token.

When a sort parameter is available, it must follow the sort=criterion,direction format where:

  • criterion is the name of the criterion to sort by (e.g: date_created, title, ...)
  • direction is the sort direction. Can be one of ASC, DESC
Languages
Servers
URL to be replaced by your Mirakl instance URL
https://your-instance.mirakl.net/

Stores

Operations

Platform Settings

Operations

Invoicing and Accounting

Operations

Services

Operations

Messages

Operations

Orders

Operations

SOR04 - Update an order

Request

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

Booking information to update for this order.

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

Order booking information

can_evaluatebooleanrequired

Indicates if the order can be evaluated by the customer

commercial_order_idstringrequired

Order commercial ID

commissionobject

Order commission

consumptionobjectrequired

Order consumption information

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

Order location

priceobject

Order price

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"
warningsArray of strings

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

Items Enum"PRICE_MISMATCH""SERVICE_INACTIVE""MAX_PER_ORDER_EXCEEDED""STOCK_EXCEEDED""LOCATION_MISMATCH""LOCATION_NOT_COVERING_CLIENT_ADDRESS""DATETIME_REQUEST_OPENING_HOURS_MISMATCH""DATETIME_REQUEST_DURATION_MISMATCH""DATETIME_REQUEST_IN_PAST""PRICING_OPTION_AMOUNT_MISMATCH"
workflowobjectrequired

Order workflow

Response
application/json
{ "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" } }

SOR11 - List orders

Request

Call Frequency
Maximum usage: At each service order page display
Pagination

This resource supports seek pagination (see documentation)

Query
order_idArray of strings

Order ids to include in result.

commercial_order_idArray of strings

Order commercial ids to include in result.

stateArray of strings

Order states to include in result.

Items Enum"WAITING_SCORING""WAITING_ACCEPTANCE""ORDER_ACCEPTED""ORDER_PENDING""ORDER_CONSUMED""ORDER_EXPIRED""ORDER_CANCELLED""ORDER_CLOSED"
customer_idArray of strings

Order customer ids to include in result.

service_codeArray of strings

Order services codes to include in result.

date_created_startstring(date-time)

Creation date to start from.

date_created_endstring(date-time)

Creation date to end with.

date_updated_startstring(date-time)

Last modification date to start from.

date_updated_endstring(date-time)

Last modification date to end with.

refundedArray of stringsunique

Refund completion.

Items Enum"NO""PARTIAL""FULL"
refund_reason_codeArray of stringsunique

Refund reason codes

has_open_incidentboolean

If true returns only orders with open incidents, if false returns orders without open incidents. Default to all

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.

curl -i -X GET \
  'https://your-instance.mirakl.net/api/mms/orders?commercial_order_id=string&customer_id=string&date_created_end=2019-08-24T14%3A15%3A22Z&date_created_start=2019-08-24T14%3A15%3A22Z&date_updated_end=2019-08-24T14%3A15%3A22Z&date_updated_start=2019-08-24T14%3A15%3A22Z&has_open_incident=true&order_id=string&refund_reason_code=string&refunded=NO&service_code=string&shop_id=0&state=WAITING_SCORING'

Responses

OK

Bodyapplication/json
dataArray of objectsrequired

Page of data

next_page_tokenstring

Token to access the next page. Absent if the current page is the last one.

previous_page_tokenstring

Token to access the previous page. Absent if the current page is the first one.

Response
application/json
{ "data": [ {}, {}, {} ], "next_page_token": "bGltaXQ9MyZhZnRlcj1aV1hVQk9IMy0zJnNvcnQ9ZGF0ZV9jcmVhdGVkLERFU0M=.v2Z_ZN1SbcKeF3W_dSA6QLIqGc54HVLAZhK22IuUFfI=" }

SOR21 - Accept an order in <code>WAITING_ACCEPTANCE</code> state

Request

Call Frequency
Maximum usage: For each new service order
Path
order_idstringrequired

The identifier of the order to be accepted.

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.

curl -i -X PUT \
  'https://your-instance.mirakl.net/api/mms/orders/{order_id}/accept?shop_id=0'

Responses

No Content

SOR22 - Refuse an order in <code>WAITING_ACCEPTANCE</code> state

Request

Call Frequency
Maximum usage: For each new service order
Path
order_idstringrequired

The identifier of the order to be refused.

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.

curl -i -X PUT \
  'https://your-instance.mirakl.net/api/mms/orders/{order_id}/refuse?shop_id=0'

Responses

No Content

SOR25 - Consume an order in <code>ORDER_PENDING</code> state

Request

Call Frequency
Maximum usage: At each customer service consumption confirmation
Path
order_idstringrequired

The identifier of the order to be consumed.

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
date_consumedstring(date-time)

Service consumption date. Required only when the Order consumption must be confirmed by Shop

voucher_codestring

Service voucher code. Required only when the Order consumption requires a voucher

curl -i -X PUT \
  'https://your-instance.mirakl.net/api/mms/orders/{order_id}/consume?shop_id=0' \
  -H 'Content-Type: application/json' \
  -d '{
    "date_consumed": "2020-10-14T14:51:37Z"
  }'

Responses

No Content

SOR28 - Request refund on order

Request

Call Frequency
Maximum usage: At each service refund request
Path
order_idstringrequired

The identifier of the order to be refunded.

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
amountnumber(with decimals)required

The amount to be refunded

currency_codestringrequired

The currency used by the shop (iso format)

optionsArray of objects

The options to be refunded. This field is required if the order has options.

reason_codestringrequired

The reason code of the refund

taxesArray of objects

The taxes to be refunded. This field is required if the order has taxes.

curl -i -X PUT \
  'https://your-instance.mirakl.net/api/mms/orders/{order_id}/refund?shop_id=0' \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": "50.00",
    "currency_code": "EUR",
    "reason_code": "AGREEMENT_FOUND",
    "taxes": [
      {
        "amount": "2.50",
        "code": "ECO_TAX"
      }
    ]
  }'

Responses

Created

SOR51 - Get the evaluation of an order

Request

Call Frequency
Maximum usage: At each order evaluation page display
Localization

This resource supports locale parameter (see documentation)

Localized output fields will be highlighted with an icon:

Path
order_idstringrequired
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.

curl -i -X GET \
  'https://your-instance.mirakl.net/api/mms/orders/{order_id}/evaluation?shop_id=0'

Responses

OK

Bodyapplication/json
assessmentsArray of objectsrequired

List of assessments

commentstring

Evaluation comment

customer_idstringrequired

Identifier of the customer who posted the evaluation

datestring(date-time)required

Evaluation creation date

firstnamestringrequired

First name of the customer who posted the evaluation

gradeinteger(int32)required

Evaluation grade

last_updated_datestring(date-time)required

Evaluation last updated date

lastnamestringrequired

Last name of the customer who posted the evaluation

replyobject
visiblebooleanrequired

Whether the evaluation is visible or not

Response
application/json
{ "assessments": [ {}, {}, {}, {} ], "comment": "Great seller, I recommend!", "customer_id": "CUST-01", "date": "2019-08-28T09:41:02.621Z", "firstname": "Gertrude", "grade": 5, "last_updated_date": "2019-08-28T09:41:02.621Z", "lastname": "Durand", "reply": { "comment": "Owww thks", "date": "2019-06-25T16:00:00Z", "type": "SHOP" }, "visible": true }