Developers

Orders

Summary of order endpoints

All endpoints take optional query parameters that enhance the response objects:

  • include — enhance the response objects (e.g. include=variants,translations). Supported values are:
    • variants - includes order variants.
    • items - includes order item lines.
    • shipping_address - includes order's shipping_address.
    • billing_address - includes order's billing_address.
    • translations — includes translations for all translatable objects and keys.
  • language_code — display all top-level values in the given language context.

List all available orders for the current site

Get list of orders for current site.

GET /admin/api/ecommerce/v1/orders

Example response:

Status: 200 OK
[
  {
    "id": 1,
    "uuid": "c1e30dd5-d99f-4699-bea3-bf5cde9128ef",
    "code": "#1",
    "status": "created",
    "payment_status": "paid",
    "shipping_status": "not_dispatched",
    "currency": "EUR",
    "shipping_method_id": 2,
    "shipping_method_option": "option 1",
    "gateway_code": "makecommerce",
    "gateway_name": "Maksekeskus",
    "payment_method": "swedbank",
    "items_subtotal_amount": "12.5",
    "items_tax_amount": "2.5",
    "shipping_subtotal_amount": "2.5",
    "shipping_tax_amount": "0.5",
    "shipping_total_amount": "3.0",
    "shipping_tax_rate": "20.0",
    "total_amount": "18.0",
    "item_amounts": [
      {
        "subtotal_amount": "12.5",
        "tax_rate": "20.0",
        "tax_amount": "2.5",
        "total_amount": "15.0"
      }
    ],
    "tax_amounts": [
      {
        "subtotal_amount": "15.0",
        "tax_rate": "20.0",
        "tax_amount": "3.0"
      }
    ],
    "return_url": "https://helloworld.voog.com/products/product-1",
    "note": null,
    "issued_date": "2017-04-11",
    "value_date": "2017-04-12",
    "completed_at": null,
    "created_at": "2017-04-11T07:52:44.000Z",
    "updated_at": "2017-04-11T07:55:17.000Z",
    "shipping_method": {
      "id": 2,
      "name": "Advanced shipping",
      "description": "Advanced shipping with multiple options",
      "amount": "2.5",
      "tax_rate": "20.0",
      "option": "option 1"
    },
    "billing_address": {
      "name": "John Doe",
      "company_name": "",
      "address1": "Main Street 1",
      "address2": "",
      "city": "Tallinn",
      "zip_code": "11612",
      "state": null,
      "country_code": "ee",
      "phone": "1234567",
      "instructions": ""
    },
     "shipping_address": {
      "name": "John Doe",
      "company_name": "",
      "address1": "Main Street 1",
      "address2": "",
      "city": "Tallinn",
      "zip_code": "11612",
      "state": null,
      "country_code": "ee",
      "phone": "1234567",
      "instructions": ""
    },
    "customer": {
      "name": "John Doe",
      "email": "john@doe.com",
      "phone": "1234567"
    },
    "items": [
      {
        "id": 1,
        "kind": "payment",
        "status": "paid",
        "product_id": 1,
        "note": null,
        "price": "12.5",
        "quantity": 1,
        "amount": "15.0",
        "subtotal_amount": "12.5",
        "tax_amount": "2.5",
        "tax_rate": "20.0",
        "created_at": "2017-03-24T08:46:22.000Z",
        "updated_at": "2017-03-24T08:46:22.000Z",
        "product": {
          "id": 1,
          "is_variant": true,
          "name": "Sample product",
          "variant_attributes_text": "Color: Red",
          "variant_attributes": [
            "variant_type": {
              "id": 1,
              "name": "Color"
            },
            "variant_value": {
              "id": 1,
              "name": "Red"
            }
          ]
        },
        "product_name": "Sample product"
      }
    ],
    "urls": {
      "url": "https://helloworld.voog.com/admin/api/ecommerce/v1/orders/1",
      "invoice_url": "https://helloworld.voog.com/admin/api/ecommerce/v1/invoices/c1e30dd5-d99f-4699-bea3-bf5cde9128ef"
    }
  }
]

Filter attributes

Read more about filters.

  • Object order attributes: id, uuid, code, billing_address_id, shipping_address_id, status, payment_status, shipping_status, shipping_method_id, shipping_method_option, payment_method, gateway_name, gateway_code, currency, shipping_subtotal_amount, shipping_tax_rate, shipping_tax_amount, shipping_total_amount, items_subtotal_amount, items_tax_amount, total_amount, tax_rate, note, issued_date, value_date, completed_at, created_at, updated_at.

Get data for a single order

GET /admin/api/ecommerce/v1/orders/1?include=items,shipping_address,billing_address

Example request:

GET http://helloworld.voog.co/admin/api/ecommerce/v1/orders/1

Example response:

Status: 200 OK
{
  "id": 1,
  "uuid": "c1e30dd5-d99f-4699-bea3-bf5cde9128ef",
  "code": "#1",
  "status": "created",
  "payment_status": "paid",
  "shipping_status": "not_dispatched",
  "currency": "EUR",
  "shipping_method_id": 2,
  "shipping_method_option": "option 1",
  "gateway_code": "makecommerce",
  "gateway_name": "Maksekeskus",
  "payment_method": "swedbank",
  "items_subtotal_amount": "12.5",
  "items_tax_amount": "2.5",
  "shipping_subtotal_amount": "2.5",
  "shipping_tax_amount": "0.5",
  "shipping_total_amount": "3.0",
  "shipping_tax_rate": "20.0",
  "total_amount": "18.0",
  "item_amounts": [
    {
      "subtotal_amount": "12.5",
      "tax_rate": "20.0",
      "tax_amount": "2.5",
      "total_amount": "15.0"
    }
  ],
  "tax_amounts": [
    {
      "subtotal_amount": "15.0",
      "tax_rate": "20.0",
      "tax_amount": "3.0"
    }
  ],
  "return_url": "https://helloworld.voog.com/products/product-1",
  "note": null,
  "issued_date": "2017-04-11",
  "value_date": "2017-04-12",
  "completed_at": null,
  "created_at": "2017-04-11T07:52:44.000Z",
  "updated_at": "2017-04-11T07:55:17.000Z",
  "shipping_method": {
    "id": 2,
    "name": "Advanced shipping",
    "description": "Advanced shipping with multiple options",
    "amount": "2.5",
    "tax_rate": "20.0",
    "option": "option 1"
  },
  "customer": {
    "name": "John Doe",
    "email": "john@doe.com",
    "phone": "1234567"
  },
  "urls": {
    "url": "https://helloworld.voog.com/admin/api/ecommerce/v1/orders/1",
    "invoice_url": "https://helloworld.voog.com/admin/api/ecommerce/v1/invoices/c1e30dd5-d99f-4699-bea3-bf5cde9128ef"
  }
}

Update attributes of a single order

PUT /admin/api/ecommerce/v1/orders/1

This request updates the order with provided attributes.

Example request:

PUT http://helloworld.voog.co/admin/api/ecommerce/v1/orders/1

Example data:

{
  "status": "archived",
  "shipping_status": "dispatched"
}

Example response:

Status: 200 OK
{
  "id": 1,
  "uuid": "c1e30dd5-d99f-4699-bea3-bf5cde9128ef",
  "code": "#1",
  "status": "archived",
  "payment_status": "paid",
  "shipping_status": "dispatched",
  "currency": "EUR",
  "shipping_method_id": 2,
  "shipping_method_option": "option 1",
  "gateway_code": "makecommerce",
  "gateway_name": "Maksekeskus",
  "payment_method": "swedbank",
  "items_subtotal_amount": "12.5",
  "items_tax_amount": "2.5",
  "shipping_subtotal_amount": "2.5",
  "shipping_tax_amount": "0.5",
  "shipping_total_amount": "3.0",
  "shipping_tax_rate": "20.0",
  "total_amount": "18.0",
  "item_amounts": [
    {
      "subtotal_amount": "12.5",
      "tax_rate": "20.0",
      "tax_amount": "2.5",
      "total_amount": "15.0"
    }
  ],
  "tax_amounts": [
    {
      "subtotal_amount": "15.0",
      "tax_rate": "20.0",
      "tax_amount": "3.0"
    }
  ],
  "return_url": "https://helloworld.voog.com/products/product-1",
  "note": null,
  "issued_date": "2017-04-11",
  "value_date": "2017-04-12",
  "completed_at": null,
  "created_at": "2017-04-11T07:52:44.000Z",
  "updated_at": "2017-04-11T07:55:17.000Z",
  "shipping_method": {
    "id": 2,
    "name": "Advanced shipping",
    "description": "Advanced shipping with multiple options",
    "amount": "2.5",
    "tax_rate": "20.0",
    "option": "option 1"
  },
  "customer": {
    "name": "John Doe",
    "email": "john@doe.com",
    "phone": "1234567"
  },
  "urls": {
    "url": "https://helloworld.voog.com/admin/api/ecommerce/v1/orders/1",
    "invoice_url": "https://helloworld.voog.com/admin/api/ecommerce/v1/invoices/c1e30dd5-d99f-4699-bea3-bf5cde9128ef"
  }
}

Parameters

  • status — Order status, one of (created, cancelled, archived).
  • payment_status — Payment status, one of (unpaid, paid, pending, cancelled).
  • shipping_status — Shipping status, one of (dispatched, not_dispatched).