latestOpenAPI 3.0.32026-08-193973220.1 KB

6a1303364143

Orders

Get the orders

Gets the orders for a given merchant and set of filters. Retrieves all the orders that are neither in state=0 (New Order) nor state=8 (Order not paid).

Orders

Summary of the Product/Listing structure : <img src="https://s3-eu-west-1.amazonaws.com/backmarket-doc-developer/images_to_download/group_order.png" width="100%" height="auto" alt="Product / Listing structure">

Orders workflow diagram : <img src="https://s3-eu-west-1.amazonaws.com/backmarket-doc-developer/images_to_download/orders_workflow.png" width="100%" height="auto" alt="Orders workflow diagram">

Orderlines workflow diagram : <img src="https://s3-eu-west-1.amazonaws.com/backmarket-doc-developer/images_to_download/orderlines_workflow.png" width="100%" height="auto" alt="Orderlines workflow diagram">

When a customer makes a payment on Back Market, an Order is to the merchants concerned. Each Order is composed of one or several Orderlines. An Orderline is defined by a quantity of a specific listing from an order placed by a customer to a specific merchant (Ordeline contains also specific information about the customer: billing, shipping addresses etc.). [cf. Figure: Summary of the Product/Listing structure]

Diagram Summary of the Product/Listing structure, shows an example of a Customer Z who makes a payment to buy 1 Product A and 1 Product B from Merchant X, and 4 Products C from Merchant Y._

Merchants only have to deal with Orderlines inside of an Order. All Orders will be treated automatically by our service. Therefore, the state of an Order cannot be modified by merchants. Merchants receive an Order with the state 1. The processing of an Order is not over until all its Orderlines have reached a <span class="success">final state</span> (cf. Table 6).

During the shipping, all Orderlines are gathered in the same package. Therefore, it is not necessary to specify an Orderline ID when updating an Orderline to the <span class="warning">state 3</span> (All Orderlines of this Order will be set to this state automatically).

Table 5 - Order State

Color-codes for the State: <span class="info">New Order</span>, <span class="warning">Temporary States</span>, <span class="success"> Final States</span>.

<table class="table"> <thead> <tr> <th>State</th> <th>Description</th> </tr> </thead> <tbody> <tr class="info"> <td>0</td> <td> New `Order`. Payment validation is pending. We are doing verifications to check the customer identity. The `Orders` in this `State` must not be shipped. </td> </tr> <tr class="warning"> <td>10</td> <td> `Order` is pending. The customer have ordered but still have time to pay. Merchant has to wait for payment, the `Orders` in this `State` must not be shipped. </td> </tr> <tr class="warning"> <td>1</td> <td> Payment is checked & validated. The merchant has to process (accept or cancel) the `Orderlines`. </td> </tr> <tr class="warning"> <td>3</td> <td> `Order` shipping is pending. The payment and the `Order` (all `Orderlines`) have been validated. The merchant has to ship the package to the customer. </td> </tr> <tr class="success"> <td>8</td> <td> Order is not paid. Payment process has failed, the merchant must ignore this `Order`. </td> </tr> <tr class="success"> <td>9</td> <td> Order processed. The merchant has shipped the package. </td> </tr> </tbody> </table>

Table 6 - States for Orderlines

Color-codes for the Orderlines: <span class="info">New Order</span>, <span class="warning">Temporary States</span>, <span class="success"> Final States</span>.

<table class="table"> <thead> <tr> <th>State</th> <th>Description</th> <th>Possible next states</th> </tr> </thead> <tbody> <tr class="info"> <td>0</td> <td> New `Orderline`. The merchant has to wait for payment confirmation. </td> <td>Not possible</td> </tr> <tr class="warning"> <td>9</td> <td> `Orderline` is on hold. It needs to be validated by one of our partners before being accepted by the merchant. </td> <td>Not possible</td> </tr> <tr class="warning"> <td>8</td> <td> `Orderline` is pending. The customer have ordered but still have time to pay. Merchant has to wait for payment. </td> <td>Not possible</td> </tr> <tr class="warning"> <td>1</td> <td> `Orderline` is paid. The merchant has received the payment and must validate or cancel the `Orderline`. </td> <td>State 2 or 4</td> </tr> <tr class="warning"> <td>2</td> <td> `Orderline` is accepted by the merchant, who must now prepare the `Product` for shipment. </td> <td>State 3 or 5</td> </tr> <tr class="success"> <td>3</td> <td> The merchant has deliver the `Orderline` to the shipping company. The package delivery is in progress. </td> <td>State 6</td> </tr> <tr class="success"> <td>4</td> <td> `Orderline` is cancelled. The customer will be refunded for the `Orderline`. </td> <td>Not possible</td> </tr> <tr class="success"> <td>5</td> <td> Orderline is refunded before shipping. </td> <td>Not possible</td> </tr> <tr class="success"> <td>6</td> <td> Orderline is refunded after shipping. The customer made a refund request. </td> <td>Not possible</td> </tr> <tr class="success"> <td>7</td> <td> Orderline is not paid. The payment has been refused by the bank. </td> <td>Not possible</td> </tr> </tbody> </table>

Table 7 - Order model

<table class="table"> <thead> <tr> <th>Field name</th> <th>Type/Size</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>order_id</td> <td>Int</td> <td>Unique id of the `Order`. Used to update `Orderline(s)` of an `Order` .</td> </tr> <tr> <td>merchant_id</td> <td>Int</td> <td>Unique id of the merchant.</td> </tr> <tr> <td>shipping_address</td> <td>Address</td> <td>Shipping address: please refer to the Table 8 for address description.</td> </tr> <tr> <td>billing_address</td> <td>Address</td> <td>Billing address: please refer to the Table 8 for address description.</td> </tr> <tr> <td>price</td> <td>Decimal</td> <td>`Order` total price (including taxes) without the shipping price.</td> </tr> <tr> <td>shipping_price</td> <td>Decimal</td> <td>Shipping total price (including taxes).</td> </tr> <tr> <td>currency</td> <td>String/3</td> <td>Used currency.</td> </tr> <tr> <td>shipper</td> <td>String/200</td> <td>Designated shipping company.</td> </tr> <tr> <td>tracking_number</td> <td>String/200</td> <td>Tracking number of the package.</td> </tr> <tr> <td>tracking_url</td> <td>String/300</td> <td>Tracking Url of the package.</td> </tr> <tr> <td>date_creation</td> <td>Datetime</td> <td>Date of the Order in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339#section-5) format</td> </tr> <tr> <td>date_modification</td> <td>Datetime</td> <td>Date of the last modification in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339#section-5) format</td> </tr> <tr> <td>date_payment</td> <td>Datetime</td> <td>Date of the payment in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339#section-5) format</td> </tr> <tr> <td>date_shipping</td> <td>Datetime</td> <td>Date of the shipping in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339#section-5) format</td> </tr> <tr> <td>state</td> <td>Enum (Int)</td> <td>Refere to Table 5 for the Order states details.</td> </tr> <tr> <td>orderlines</td> <td>Array[OrderLine]</td> <td>List of `Orderlines` indexed by SKU (stock keeping unit).</td> </tr> <tr> <td>country_code</td> <td>Enum (String)</td> <td> <div>Accepted-values:</div> <div>fr-fr: France (default)</div> <div>fr-be: Belgium</div> <div>es-es: Spain</div> <div>de-at: Austria</div> <div>de-de: Germany</div> <div>it-it: Italy</div> <div>ja-jp: Japan</div> <div>en-au: Australia</div> <div>en-gb: United Kingdom</div> <div>en-us: United States</div> <div>nl-nl: Netherlands</div> <div>pt-pt: Portugal</div> <div>en-ie: Ireland</div> <div>el-gr: Greece</div> <div>sk-sk: Slovakia</div> <div>sv-se: Sweden</div> </td> </tr> </tbody> </table>

Table 8 - Address model

<table class="table"> <thead> <tr> <th>Field name</th> <th>Type/Size</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>company</td> <td>String/254</td> <td>Company name.</td> </tr> <tr> <td>last_name</td> <td>String/200</td> <td>Last name.</td> </tr> <tr> <td>last_name_pronunciation</td> <td>String/200</td> <td>Last name pronunciation. This field is only used to handle Kana names for Japan.</td> </tr> <tr> <td>first name</td> <td>String/200</td> <td>First name.</td> </tr> <tr> <td>first_name_pronunciation</td> <td>String/200</td> <td>First name pronunciation. This field is only used to handle Kana names for Japan.</td> </tr> <tr> <td>street</td> <td>String/254</td> <td>Street number and designation.</td> </tr> <tr> <td>street2</td> <td>String/254</td> <td>Floor, door code.</td> </tr> <tr> <td>postal_code</td> <td>String/10</td> <td>Zip code.</td> </tr> <tr> <td>city</td> <td>String/200</td> <td>City.</td> </tr> <tr> <td>country</td> <td>String/100</td> <td>Country.</td> </tr> <tr> <td>phone</td> <td>String/14</td> <td>Phone number.</td> </tr> <tr> <td>email</td> <td>String/200</td> <td>Email address.</td> </tr> </tbody> </table>

Table 9 - OrderLine model

<table class="table"> <thead> <tr> <th>Field name</th> <th>Type/Size</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>listing</td> <td>Listing</td> <td>`Listing` that matches the `Orderline`.</td> </tr> <tr> <td>quantity</td> <td>Int</td> <td>Quantity of products ordered</td> </tr> <tr> <td>price</td> <td>Decimal</td> <td>Unitary price (including taxes) of the `Listing` without shipping costs.</td> </tr> <tr> <td>shipping_price</td> <td>Decimal</td> <td>Unitary price of the shipping (including taxes).</td> </tr> <tr> <td>currency</td> <td>String/3</td> <td>Used currency.</td> </tr> <tr> <td>state</td> <td>Enum (Int)</td> <td>Refere to Table 6 for Orderlines states description.</td> </tr> <tr> <td>return_reason</td> <td>Enum (Int)</td> <td> <div>0: Stock mistake.</div> <div>1: Withdrawal during the legal 14 day period.</div> <div>11: Does not live at provided address.</div> <div>12: The parcel did not reach its destination.</div> <div>13: Lost parcel.</div> <div>21: Faulty product on opening of the package.</div> <div>22: Failure during first use.</div> <div>23: Failure during warranty period.</div> <div>24: Non-compliant product.</div> <div>25: Other.</div> </td> </tr> <tr> <td>return_message</td> <td>String/500</td> <td>Message sent to the customer for a cancellation or a refund.</td> </tr> <tr> <td>backcare</td> <td>Bool</td> <td>True if this orderline is covered by the Backcare service</td> </tr> <tr> <td>backcare_price</td> <td>Int</td> <td>The backcare price in cents.</td> </tbody> </table>
get/ws/orders

Query parameters

date_creationstring date-time

Filter to get orders by their date of creation in RFC3339 format

date_modificationstring date-time

Filter to get orders by their date of last modification in RFC3339 format

country_code'fr-fr' | 'fr-be' | 'es-es' | 'de-de' | 'de-at' | 'it-it' | 'ja-jp' | 'en-au' | 'en-gb' | 'en-us' | 'nl-nl' | 'pt-pt' | 'en-ie' | 'el-gr' | 'sk-sk' | 'sv-se'
Example:fr-fr

Filter on the order country of origin

state0 | 10 | 1 | 3 | 8 | 9

Order state.

StateDescription
0New order. Payment validation is pending. We are doing verifications to check the customer identity. The orders in this state must not be shipped.
10Order is pending. The customer has ordered but still has time to pay. The merchant has to wait for payment, and the orders in this state must not be shipped.
1Payment is checked and validated. The merchant has to process (accept or cancel) the orderlines.
3Order shipping is pending. The payment and the order (i.e. all orderlines) have been validated. The merchant has to ship the package to the customer.
8Order is not paid. Payment process has failed, and the merchant must ignore this order.
9Order processed. The merchant has shipped the package.
Example:1

Filter on the order state. See OrderState object for more details.

pageinteger

The page number for pagination

page-sizeinteger

The page size for pagination

Response

Return the orders matching the filter in the query parameters

countinteger
nextstring nullable
previousstring nullable

Example response

{
  "count": 25,
  "next": "https://www.backmarket.fr/bm/merchants/users?page=3",
  "previous": "https://www.backmarket.fr/bm/merchants/users?page=1",
  "results": [
    {
      "order_id": 5978,
      "delivery_mode": "HOME_DELIVERY",
      "shipping_address": {
        "id": 1,
        "country": "FR",
        "city": "Paris",
        "postalCode": "75003",
        "firstName": "Victor",
        "lastName": "Hugo",
        "company": "backmarket",
        "phoneNumber": "+33639981234",
        "state": "California",
        "street": "3, Imaginary Street",
        "street2": "Apartement X"
      },
      "billing_address": {
        "id": 1,
        "country": "FR",
        "city": "Paris",
        "postalCode": "75003",
        "firstName": "Victor",
        "lastName": "Hugo",
        "company": "backmarket",
        "phoneNumber": "+33639981234",
        "state": "California",
        "street": "3, Imaginary Street",
        "street2": "Apartement X"
      },
      "delivery_note": "https://example.com/delivery_note/1519221434.69.pdf",
      "expected_dispatch_date": "2022-04-29T09:35:24",
      "tracking_number": "my_tracking_number",
      "tracking_url": "http://www.colissimo.fr/my_tracking_url",
      "shipper_display": "Colissimo",
      "date_creation": "2022-04-29T09:35:24.123456Z",
      "date_modification": "2022-04-29T09:35:24Z",
      "date_shipping": "2022-04-29T09:35:24.123456Z",
      "date_payment": "2022-04-29T09:35:24.123Z",
      "state": 1,
      "orderlines": [
        {
          "id": 37195,
          "date_creation": "2022-04-29T09:35:24.123456Z",
          "state": 1,
          "price": "229.0",
          "shipping_price": "0.00",
          "shipping_delay": 48,
          "currency": "EUR",
          "listing": "IPHONE416GONLIB0",
          "listing_id": 142,
          "orderline_fee": "22.9",
          "product": "Apple Iphone 4 16 Go - Noir - D\\u00e9bloqu\\u00e9",
          "quantity": 2,
          "brand": "apple",
          "product_id": 141,
          "backcare": true,
          "backcare_price": 500,
          "sales_taxes": "25.8",
          "imei": "011415009346880",
          "condition": 10
        }
      ],
      "price": "299.25",
      "shipping_price": "5.99",
      "currency": "EUR",
      "country_code": "fr-fr",
      "payment_method": "PAYPAL",
      "sales_taxes": "25.8"
    }
  ]
}