Merchant Order

The merchant order is the resource used to manage the order inside the marketplace. It’s possible to retrieve and modify them. The main process to manage orders is displayed below.


Merchant order status

StatusCode(Usually) intiated by
Payment authorized60Application
Confirmed80Merchant
Cancelled2000Merchant OR Application
Processed85Merchant
Finalized110Application


Fetch merchant order

To be done with a merchant token:

  
  GET {{api_url}}/v1/merchant_order/?status=60

The response will contain:

  
  {
  "meta": {
      "limit": 20,
      "next": null,
      "offset": 0,
      "previous": null,
      "total_count": 1
  },
  "objects": [
      {
          "amount": "810.00",
          "amount_vat_included": "972.00",
          "amount_vat_included_before_discount": "972.00",
          "app_discount_amount": "0.00000",
          "app_discount_amount_on_items_vat_included": "0.00",
          "app_discount_amount_on_shipping_vat_included": "0.00",
          "app_discount_amount_vat_included": "0.00",
          "application": {
              "id": 75,
              "name": "test",
              "namespace": "test",
              "pk": 757,
              "resource_uri": "https://api.sandbox.iceberg.technology/v1/application/75/"
        },
          "attributes": {},
          "auto_cancelling_date": null,
          "billing_address": {
              "address": "77 rue de la boetie",
              "address2": "",
              "city": "paris",
              "country": {
                  "code": "FR",
                  "id": 72,
                  "name": "France"
              },
              "first_name": "pavoit",
              "fiscal_number": null,
              "id": 35760,
              "last_name": "sebastien",
              "name": "My address",
              "phone": "012345678",
              "resource_uri": "https://api.sandbox.iceberg.technology/v1/address/35760/",
              "state": null,
              "status": "10",
              "zipcode": "75008"
          },
          "created_on": "2017-03-23T15:36:03+01:00",
          "currency": {
              "code": "EUR",
              "pk": "EUR",
              "resource_uri": "https://api.sandbox.iceberg.technology/v1/currency/EUR/"
          },
          "customer_invoices": [
              {
                  "id": 1004,
                  "pk": 1004,
                  "resource_uri": "https://api.sandbox.iceberg.technology/v1/customer_invoice/1004/"
              }
          ],
          "debug": false,
          "discount_amount": "0.00000",
          "discount_amount_vat_included": "0.00",
          "eco_tax": "0.00",
          "eco_tax_vat_included": "0.00",
          "entered_discount_codes": [],
          "external_id": null,
          "external_manager": null,
          "external_manager_id": null,
          "external_manager_status": null,
          "extra_data": null,
          "id": 34865,
          "incident_status": "pending_merchant",
          "items": [
              {
                  "amount": "800.000000",
                  "amount_vat_included": "960.00",
                  "bundled": false,
                  "color": "",
                  "currency": {
                      "code": "EUR",
                      "pk": "EUR",
                      "resource_uri": "https://api.sandbox.iceberg.technology/v1/currency/EUR/"
                  },
                "discount_amount_financed_by_application_with_tax": "0.00",
                  "discount_amount_vat_included": "0.00",
                  "discounts": [],
                  "external_id": null,
                  "gift": false,
                  "gtin": "",
                  "id": 78103,
                  "item_image_url": "",
                  "item_type": "product",
                  "name": "Veste",
                  "offer_absolute_url": "",
                  "offer_external_id": null,
                  "offer_id": 1522879,
                  "previous_price": 0,
                  "previous_price_without_vat": 0,
                  "price": "800.000000",
                  "product": {
                      "id": 2778359,
                      "pk": 2778359,
                      "resource_uri": "https://api.sandbox.iceberg.technology/v1/product/2778359/"
                  },
                  "product_id": 2778359,
                  "product_offer": {
                      "id": 1522879,
                      "pk": 1522879,
                      "resource_uri": "https://api.sandbox.iceberg.technology/v1/productoffer/1522879/",
                      "stock": 99
                  },
                  "quantity": 1,
                  "resource_uri": "https://api.sandbox.iceberg.technology/v1/order_item/78103/",
                  "shipping": "0.00",
                  "shipping_speed": "standard",
                  "size": "",
                  "sku": "sebsku5",
                  "status": "120",
                  "status_localized": "Return in progress",
                  "variation": "",
                  "variation_external_id": "",
                  "variation_kind": "",
                  "variation_sku": "",
                  "variation_stock": null,
                  "vat": "160.000000"
              }
          ],
          "items_count": 1,
          "last_modified": "2017-10-08T21:08:49.633753+02:00",
          "merchant": {
              "id": 8600,
              "name": "Marchand Sandbox 2",
              "resource_uri": "https://api.sandbox.iceberg.technology/v1/merchant/8600/",
              "slug": "marchand_sandbox_2"
          },
          "merchant_comment": "",
          "order": {
              "cart_id": 89639,
              "created_on": "2017-03-23T15:36:03+01:00",
              "external_id": null,
              "id": 26596,
              "id_number": "170323V1265964",
              "last_updated": "2017-05-11T17:22:53+02:00",
              "payment": {
                  "collected_amount": "1037.20",
                  "external_id": null,
                  "id": 34604,
                  "payment_backend": "external",
                  "remaining_to_collect": "0.00",
                  "status": "100",
                  "status_localized": "Partially Refunded"
              },
              "resource_uri": "https://api.sandbox.iceberg.technology/v1/order/26596/",
              "shipping_speed": "standard",
              "status": "120",
              "status_localized": "Return in progress"
          },
          "price": "800.00",
          "price_vat_included": "960.00",
          "received": null,
          "refunded_amount": "0.00",
          "resource_uri": "https://api.sandbox.iceberg.technology/v1/merchant_order/34865/",
          "shipping": "10.00",
          "shipping_address": {
              "address": "77 rue de la boetie",
              "address2": "",
              "city": "paris",
              "country": {
                  "code": "FR",
                  "id": 72,
                  "name": "France"
              },
              "first_name": "pavoit",
              "fiscal_number": null,
              "id": 35760,
              "last_name": "sebastien",
              "name": "My address",
              "phone": "0123456789",
              "resource_uri": "https://api.sandbox.iceberg.technology/v1/address/35760/",
              "state": null,
              "status": "10",
              "zipcode": "75008"
          },
          "shipping_vat_included": "12.00",
          "starred": false,
          "status": "120",
          "status_localized": "Return in progress",
          "user": {
              "display_name": "pavoit sebastien",
              "email": "",
              "first_name": "pavoit",
              "id": 27541,
              "last_name": "sebastien",
              "resource_uri": "https://api.sandbox.iceberg.technology/v1/user/27541/",
              "username": "pavoit_sebastien"
          },
          "vat": "162.00",
          "vat_on_eco_tax": "0.00",
          "vat_on_products": "160.00",
          "vat_on_shipping": "2.00",
          "vat_rate_on_shipping": "20.00"
      }
  ]
  }

where (for each returned items):

  • id: the identifier of the merchant order
  • status: the status of the merchant order
  • external_id: the external identifier of the merchant order

Main filters:

  • status
  • external_id


Cancel a merchant order item

  
  POST {{api_url}}/v1/order_item/{{ITEM_ID}}/cancel/

with an empty body.


Cancel a merchant order

  
  POST {{api_url}}/v1/merchant_order/{{MERCHANT_ORDER_ID}}/cancel/

with an empty body.


Confirm a merchant order

  
  POST {{api_url}}/v1/merchant_order/{{MERCHANT_ORDER_ID}}/confirm/

with an empty body.

Note :

To partially confirm a merchant order: At first, cancel items and then confirm the merchant order.


Mark a merchant order as processed

  
  POST {{api_url}}/v1/merchant_order/{{MERCHANT_ORDER_ID}}/process/

with an empty body.


Process an order item

  
  POST {{api_url}}/v1/order_item/{{ITEM_ID}}/process/

with an empty body.

Note :

Process actions are only flagging actions on the order. It triggers the initialization of parcels. Parcels are the object carrying the shipping workflow information (see section “Package Tracking”).


List status history of a merchant order

  
  GET {{api_url}}/v1/merchant_order/{{MERCHANT_ORDER_ID}}/logs/


Retrieve the shipping address

The shipping address is an attribute of the merchant order as described below.

In some specific case, marketplace use the attribute option of the shipping_option resource to store the address of a click and collect place. To retrieve this information, use the following API call:

  
  GET {{api_url}}/v1/merchant_order/{{MERCHANT_ORDER_ID}}/shipping_options/

The options attribute of the provided object contains additional useful informations. Ask the marketplace operator to verify this object structure:

  
  ...
  "options": {
  "address1": "60 rue du stade",
  "address2": "  ",
  "addressName": "Domicile",
  "carrierName": null,
  "carrierPickupPointId": null,
  "city": "ORLEANS",
  "company": null,
  "country": "France",
  "countryCode": "FR",
  "email": "[email protected]",
  "firstName": "emely",
  "lastName": "Myname",
  "phone": "123456789",
  ...

Note :

The keys of the fields, and their values are not following any standard.