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": 48,
    "uuid": "3347c171-de7a-45b7-a53c-85543a3de6f9",
    "code": "#000134",
    "status": "created",
    "payment_status": "paid",
    "shipping_status": "not_dispatched",
    "currency": "EUR",
    "shipping_method_id": 5,
    "shipping_method_option": null,
    "gateway_code": "makecommerce",
    "gateway_name": "Maksekeskus",
    "payment_method": "swedbank",
    "items_subtotal_amount": "1658.42",
    "items_original_amount": "2475.25",
    "items_tax_amount": "16.58",
    "shipping_subtotal_amount": "3.5",
    "shipping_original_amount": "3.5",
    "shipping_tax_amount": "0.7",
    "shipping_total_amount": "4.2",
    "shipping_tax_rate": "20.0",
    "total_amount": "1679.2",
    "item_amounts": [
      {
        "subtotal_amount": "1658.42",
        "original_amount": "2475.25",
        "tax_rate": "1.0",
        "tax_amount": "16.58",
        "total_amount": "1675.0"
      }
    ],
    "tax_amounts": [
      {
        "subtotal_amount": "1658.42",
        "tax_rate": "1.0",
        "tax_amount": "16.58"
      },
      {
        "subtotal_amount": "3.5",
        "tax_rate": "20.0",
        "tax_amount": "0.7"
      }
    ],
    "discount_code": "XMAS",
    "return_url": "http://helloworld.voog.com",
    "note": null,
    "issued_date": "2017-12-18",
    "value_date": "2017-12-18",
    "paid_at": null,
    "completed_at": null,
    "created_at": "2017-12-18T14:00:26.000Z",
    "updated_at": "2017-12-18T14:00:26.000Z",
    "shipping_method": {
      "id": 5,
      "name": "Postal Service",
      "description": "Send via mail",
      "amount": "3.5",
      "tax_rate": "20.0",
      "option": null
    },
    "discount": {
      "code": "XMAS",
      "applies_to": "products",
      "discount_type": "percentage",
      "amount": "33.0",
      "currency": "EUR",
      "discount_objects": [
        {
          "target_id": 18,
          "target_type": "product"
        },
        {
          "target_id": 206,
          "target_type": "product"
        }
      ],
      "id": 3
    },
    "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": 88,
        "kind": "payment",
        "status": "paid",
        "product_id": 207,
        "note": null,
        "price": "1658.42",
        "original_price": "2475.25",
        "quantity": 1,
        "amount": "1675.0",
        "subtotal_amount": "1658.42",
        "tax_amount": "16.58",
        "tax_rate": "1.0",
        "created_at": "2017-12-18T14:00:26.000Z",
        "updated_at": "2017-12-18T14:00:26.000Z",
        "has_item_discount": true,
        "product": {
          "id": 207,
          "is_variant": true,
          "name": "Ion drive",
          "variant_attributes_text": "Thrust: 950kN",
          "variant_attributes": [
            {
              "variant_type": {
                "id": 11,
                "name": "Thrust"
              },
              "variant_value": {
                "id": 30,
                "name": "950kN"
              }
            }
          ]
        },
        "product_name": "Ion drive"
      }
    ],
    "urls": {
      "url": "http://helloworld.voog.com/admin/api/ecommerce/v1/orders/48",
      "invoice_url": "http://helloworld.voog.com/admin/api/ecommerce/v1/invoices/3347c171-de7a-45b7-a53c-85543a3de6f9"
    }
  }
]

Filter attributes

Read more about filters.

  • Object order attributes: id, uuid, code, billing_address_id, shipping_address_id, status, payment_status, discount_code, 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, shipping_original_amount, items_subtotal_amount, items_tax_amount, total_amount, tax_rate, note, issued_date, value_date, paid_at, completed_at, created_at, updated_at.

Get data for a single order

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

Example request:

GET http://helloworld.voog.com/admin/api/ecommerce/v1/orders/48

Example response:

Status: 200 OK
{
  "id": 48,
  "uuid": "3347c171-de7a-45b7-a53c-85543a3de6f9",
  "code": "#000134",
  "status": "created",
  "payment_status": "paid",
  "shipping_status": "not_dispatched",
  "currency": "EUR",
  "shipping_method_id": 5,
  "shipping_method_option": null,
  "gateway_code": "makecommerce",
  "gateway_name": "Maksekeskus",
  "payment_method": "swedbank",
  "items_subtotal_amount": "1658.42",
  "items_original_amount": "2475.25",
  "items_tax_amount": "16.58",
  "shipping_subtotal_amount": "3.5",
  "shipping_original_amount": "3.5",
  "shipping_tax_amount": "0.7",
  "shipping_total_amount": "4.2",
  "shipping_tax_rate": "20.0",
  "total_amount": "1679.2",
  "item_amounts": [
    {
      "subtotal_amount": "1658.42",
      "original_amount": "2475.25",
      "tax_rate": "1.0",
      "tax_amount": "16.58",
      "total_amount": "1675.0"
    }
  ],
  "tax_amounts": [
    {
      "subtotal_amount": "1658.42",
      "tax_rate": "1.0",
      "tax_amount": "16.58"
    },
    {
      "subtotal_amount": "3.5",
      "tax_rate": "20.0",
      "tax_amount": "0.7"
    }
  ],
  "discount_code": "XMAS",
  "return_url": "http://helloworld.voog.com",
  "note": null,
  "issued_date": "2017-12-18",
  "value_date": "2017-12-18",
  "paid_at": null,
  "completed_at": null,
  "created_at": "2017-12-18T14:00:26.000Z",
  "updated_at": "2017-12-18T14:00:26.000Z",
  "shipping_method": {
    "id": 5,
    "name": "Postal Service",
    "description": "Send via mail",
    "amount": "3.5",
    "tax_rate": "20.0",
    "option": null
  },
  "discount": {
    "code": "XMAS",
    "applies_to": "products",
    "discount_type": "percentage",
    "amount": "33.0",
    "currency": "EUR",
    "discount_objects": [
      {
        "target_id": 18,
        "target_type": "product"
      },
      {
        "target_id": 206,
        "target_type": "product"
      }
    ],
    "id": 3
  },
  "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": 88,
      "kind": "payment",
      "status": "paid",
      "product_id": 207,
      "note": null,
      "price": "1658.42",
      "original_price": "2475.25",
      "quantity": 1,
      "amount": "1675.0",
      "subtotal_amount": "1658.42",
      "tax_amount": "16.58",
      "tax_rate": "1.0",
      "created_at": "2017-12-18T14:00:26.000Z",
      "updated_at": "2017-12-18T14:00:26.000Z",
      "has_item_discount": true,
      "product": {
        "id": 207,
        "is_variant": true,
        "name": "Ion drive",
        "variant_attributes_text": "Thrust: 950kN",
        "variant_attributes": [
          {
            "variant_type": {
              "id": 11,
              "name": "Thrust"
            },
            "variant_value": {
              "id": 30,
              "name": "950kN"
            }
          }
        ]
      },
      "product_name": "Ion drive"
    }
  ],
  "urls": {
    "url": "http://helloworld.voog.com/admin/api/ecommerce/v1/orders/48",
    "invoice_url": "http://helloworld.voog.com/admin/api/ecommerce/v1/invoices/3347c171-de7a-45b7-a53c-85543a3de6f9"
  }
}

Update attributes of a single order

PUT /admin/api/ecommerce/v1/orders/:id

This request updates the order with provided attributes.

Example request:

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

Example data:

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

Example response:

Status: 200 OK
{
  "id": 48,
  "uuid": "3347c171-de7a-45b7-a53c-85543a3de6f9",
  "code": "#000134",
  "status": "archived",
  "payment_status": "paid",
  "shipping_status": "dispatched",
  "currency": "EUR",
  "shipping_method_id": 5,
  "shipping_method_option": null,
  "gateway_code": "makecommerce",
  "gateway_name": "Maksekeskus",
  "payment_method": "swedbank",
  "items_subtotal_amount": "1658.42",
  "items_original_amount": "2475.25",
  "items_tax_amount": "16.58",
  "shipping_subtotal_amount": "3.5",
  "shipping_original_amount": "3.5",
  "shipping_tax_amount": "0.7",
  "shipping_total_amount": "4.2",
  "shipping_tax_rate": "20.0",
  "total_amount": "1679.2",
  "item_amounts": [
    {
      "subtotal_amount": "1658.42",
      "original_amount": "2475.25",
      "tax_rate": "1.0",
      "tax_amount": "16.58",
      "total_amount": "1675.0"
    }
  ],
  "tax_amounts": [
    {
      "subtotal_amount": "1658.42",
      "tax_rate": "1.0",
      "tax_amount": "16.58"
    },
    {
      "subtotal_amount": "3.5",
      "tax_rate": "20.0",
      "tax_amount": "0.7"
    }
  ],
  "discount_code": "XMAS",
  "return_url": "http://helloworld.voog.com",
  "note": null,
  "issued_date": "2017-12-18",
  "value_date": "2017-12-18",
  "paid_at": null,
  "completed_at": null,
  "created_at": "2017-12-18T14:00:26.000Z",
  "updated_at": "2017-12-18T14:00:26.000Z",
  "shipping_method": {
    "id": 5,
    "name": "Postal Service",
    "description": "Send via mail",
    "amount": "3.5",
    "tax_rate": "20.0",
    "option": null
  },
  "discount": {
    "code": "XMAS",
    "applies_to": "products",
    "discount_type": "percentage",
    "amount": "33.0",
    "currency": "EUR",
    "discount_objects": [
      {
        "target_id": 18,
        "target_type": "product"
      },
      {
        "target_id": 206,
        "target_type": "product"
      }
    ],
    "id": 3
  },
  "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": 88,
      "kind": "payment",
      "status": "paid",
      "product_id": 207,
      "note": null,
      "price": "1658.42",
      "original_price": "2475.25",
      "quantity": 1,
      "amount": "1675.0",
      "subtotal_amount": "1658.42",
      "tax_amount": "16.58",
      "tax_rate": "1.0",
      "created_at": "2017-12-18T14:00:26.000Z",
      "updated_at": "2017-12-18T14:00:26.000Z",
      "has_item_discount": true,
      "product": {
        "id": 207,
        "is_variant": true,
        "name": "Ion drive",
        "variant_attributes_text": "Thrust: 950kN",
        "variant_attributes": [
          {
            "variant_type": {
              "id": 11,
              "name": "Thrust"
            },
            "variant_value": {
              "id": 30,
              "name": "950kN"
            }
          }
        ]
      },
      "product_name": "Ion drive"
    }
  ],
  "urls": {
    "url": "http://helloworld.voog.com/admin/api/ecommerce/v1/orders/48",
    "invoice_url": "http://helloworld.voog.com/admin/api/ecommerce/v1/invoices/3347c171-de7a-45b7-a53c-85543a3de6f9"
  }
}

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).