Skip to content

OR13 - Export orders asynchronously

Request

Description

The API returns a tracking id to be used to query API OR14.
Mirakl recommends to use API OR13 instead of API OR11 as it can handle very large volumes of data.
You must give at least one date range filter: created, last updated date or refunds created date.
API OR13 supports the chunk of the export file into multiple files in order to:

  • respect a maximum megabyte weight using the megabytes_per_chunk parameter.
  • respect a maximum amount of exported items using the items_per_chunk parameter.

Only one export request can be created for all operator users, and one per partner.
Call Frequency
Maximum usage:
- Differential: every 5 minutes
- Full: every 24 hours
Localization

This resource supports locale parameter (see documentation)

Localized output fields will be highlighted with an icon:

Security
Front-Bearer-Token or OAuth-2
Bodyapplication/json
channel_codesArray of strings, [ 0 .. 100 ] items

A list of channel codes

end_datestring, (date-time)

End order creation date for filtering. Must be used with start_date.

end_refund_creation_datestring, (date-time)

End refund creation date to filter on orders with at least one refund created before this date. Must be used with start_refund_creation_date, and cannot be later than a month after start_refund_creation_date.

end_update_datestring, (date-time)

End order update date for filtering. Must be used with start_update_date.

fulfillment_center_codesstring, [ 0 .. 100 ] characters

Code of the fulfillment center

items_per_chunkinteger, (int64), [ 10000 .. 1000000 ]

Maximum number of items included in the generated files

Default:1000000
megabytes_per_chunkinteger, (int64), [ 10 .. 1024 ]

Maximum mega bytes weight for generated files

Default:512
only_null_channelboolean

Return only orders without channel. If true, ignore the channel_codes

Default:false
order_state_codesArray of strings, [ 0 .. 100 ] items

A list of order state's codes

order_tax_modestring

Please note: If the taxes are not specified, the prices with mode TAX_EXCLUDED and with mode TAX_INCLUDED will return the same amounts.
Possible values:

  • TAX_EXCLUDED: the price fields (price, unit price, shipping price, cancellation amount, refund amount and order total prices) do not include taxes.
  • TAX_INCLUDED: the price fields include the tax amount.
  • If this query parameter is not specified, the default order tax mode of the platform is used.
  • Enum: "TAX_INCLUDED", "TAX_EXCLUDED"

    refund_state_codesArray of strings, unique

    Filter on the refund state To be used in combination with filters start_update_date and end_update_date, with a maximum of one month period.

    shop_idsArray of integers, (int64), [ 0 .. 100 ] items

    A list of shop's identifiers

    start_datestring, (date-time)

    Start order creation date for filtering. Must be used with end_date.

    start_refund_creation_datestring, (date-time)

    Start refund creation date to filter on orders with at least one refund created after this date. Must be used with end_refund_creation_date.

    start_update_datestring, (date-time)

    Start order update date for filtering. Mirakl will subtract a time delta to ensure no orders are missed due to network and/or software latency. Must be used with end_update_date.

    tax_recalculation_required_onlyboolean

    If true returns only orders for which taxes must be recalculated on at least one order line. When false it does not impact the result. Must be used with at least one date range filter: created or last updated date, of a maximum duration of one month.

    waiting_funding_confirmationboolean

    If true returns only orders awaiting a funding update. When false it does not impact the result.

    waiting_tax_confirmationboolean

    If true returns only orders awaiting a tax confirmation, When false it does not impact the result.

    curl -i -X POST \
      https://your-instance.mirakl.net/api/orders/async-export \
      -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
      -H 'Content-Type: application/json' \
      -d '{
        "channel_codes": [
          "US"
        ],
        "end_date": "2022-01-31T00:00:00.000Z",
        "end_update_date": "2022-09-19T14:58:22.460Z",
        "fulfillment_center_codes": "fulfillment_center_codes_001",
        "items_per_chunk": 10000,
        "megabytes_per_chunk": 100,
        "only_null_channel": false,
        "order_state_codes": [
          "WAITING_ACCEPTANCE",
          "SHIPPING"
        ],
        "order_tax_mode": "TAX_INCLUDED",
        "refund_state_codes": [
          "WAITING_REFUND"
        ],
        "shop_ids": [
          2310
        ],
        "start_date": "2022-01-01T00:00:00.000Z",
        "start_update_date": "2022-08-20T14:58:22.460Z",
        "tax_recalculation_required_only": true,
        "waiting_funding_confirmation": false,
        "waiting_tax_confirmation": false
      }'

    Responses

    Asynchronous order export tracking creation success

    Bodyapplication/json
    tracking_idstringrequired

    Id to poll in order to track the export's progress

    Response
    { "tracking_id": "tracking_id_001" }