The Order Item Object
Parameters
Attribute | Type | Description |
id | string | The unique identifier for this order item. |
type | string | The type represents the object being returned. |
product_id | string | The unique identifier for this order item. |
name | string | The name of this order item. |
sku | string | The SKU code for the order item. |
quantity | integer | The quantity of this item were ordered. |
unit_price | object | The unit price object. |
value | object | The value object. |
links | object | The links object. |
meta | object | The meta object. |
relationships | object | The relationships object. |
catalog_source | string | The catalog source. Always pimor legacy`. |
catalog_id | string | The unique identifier of the catalog associated with the product is shown if catalog_source=pim is set. |
Sample object
{
"data": [
{
"type": "order_item",
"id": "eb9f1a75-c438-457d-b474-e2286e81b94b",
"quantity": 1,
"product_id": "bf8a9d62-6ca9-45f6-85eb-f0d1d9ae7fdd",
"name": "Woodsy",
"sku": "WDLP100BRO",
"unit_price": {
"amount": 40000,
"currency": "USD",
"includes_tax": true
},
"value": {
"amount": 40000,
"currency": "USD",
"includes_tax": true
},
"links": {},
"meta": {
"display_price": {
"with_tax": {
"unit": {
"amount": 40000,
"currency": "USD",
"formatted": "$400.00"
},
"value": {
"amount": 40000,
"currency": "USD",
"formatted": "$400.00"
}
},
"without_tax": {
"unit": {
"amount": 40000,
"currency": "USD",
"formatted": "$400.00"
},
"value": {
"amount": 40000,
"currency": "USD",
"formatted": "$400.00"
}
},
"tax": {
"unit": {
"amount": 40000,
"currency": "USD",
"formatted": "$400.00"
},
"value": {
"amount": 40000,
"currency": "USD",
"formatted": "$400.00"
}
}
},
"timestamps": {
"created_at": "2018-05-24T09:14:58.18733387Z",
"updated_at": "2018-05-24T09:14:58.18733387Z"
}
},
"relationships": {
"cart_item": {
"data": {
"type": "cart_item",
"id": "4c66bfa9-f9a7-4b6b-9e38-3fad4a8ae8bd"
}
}
},
"catalog_id": "92073438-7640-4ace-9670-c8c5c1a89cd7",
"catalog_source": "pim"
}
]
}
The unit price object
Attribute | Type | Description |
unit_price.amount | integer | The singular price of this item. |
unit_price.currency | string | The unit price currency of this item. |
unit_price.includes_tax | boolean | Is the price inclusive of tax. |
The value object
Attribute | Type | Description |
value.amount | integer | The total price for this item (quantity * unit_price.amount ). |
value.currency | string | The value currency of this item. |
value.includes_tax | boolean | Is the price inclusive of tax. |
The links object
The meta object
Attribute | Type | Description |
meta.display_price | object | Formatted display prices based on the currency settings for this request. |
meta.display_price.with_tax | object | Tax inclusive totals. |
meta.display_price.with_tax.unit | object | Tax inclusive totals for a single instance of this order item. |
meta.display_price.with_tax.unit.amount | integer | The raw price of a single instance this order item (inc tax). |
meta.display_price.with_tax.unit.currency | string | The currency set for this order item. |
meta.display_price.with_tax.unit.formatted | string | The tax inclusive formatted total of this order item line based on the currency. |
meta.display_price.with_tax.value | object | Tax inclusive totals for this order item based on the quantity. |
meta.display_price.with_tax.value.amount | integer | The raw total price this order item (inc tax). |
meta.display_price.with_tax.value.currency | string | The currency set for this order item. |
meta.display_price.with_tax.value.formatted | string | The tax inclusive formatted total of this order item line based on the currency. |
meta.display_price.without_tax | object | Tax exclusive totals. |
meta.display_price.without_tax.unit | object | Tax exclusive totals for a single instance of this order item. |
meta.display_price.without_tax.unit.amount | integer | The raw price of a single instance this order item (ex tax). |
meta.display_price.without_tax.unit.currency | string | The currency set for this order item. |
meta.display_price.without_tax.unit.formatted | string | The tax exclusive formatted total of this order item line based on the currency. |
meta.display_price.without_tax.value | object | Tax exclusive totals for this order item based on the quantity. |
meta.display_price.without_tax.value.amount | integer | The raw total price for this order item (ex tax). |
meta.display_price.without_tax.value.currency | string | The currency set for this order item. |
meta.display_price.without_tax.value.formatted | string | The tax exclusive formatted total of this order item line based on the currency. |
meta.display_price.tax | object | Tax totals. |
meta.display_price.tax.unit | object | Tax totals for a single instance of this order item. |
meta.display_price.tax.unit.amount | integer | The subtotal of the added tax value for a single instance of this order item. |
meta.display_price.tax.unit.currency | string | The currency set for the tax. |
meta.display_price.tax.unit.formatted | string | The formatted value for the tax subtotal. |
meta.display_price.tax.value | object | Tax totals for this order item based on the quantity. |
meta.display_price.tax.value.amount | integer | The subtotal of the added tax value. |
meta.display_price.tax.value.currency | string | The currency set for the tax. |
meta.display_price.tax.value.formatted | string | The formatted value for the tax subtotal. |
meta.timestamps | object | Timestamps for this product. |
meta.timestamps.created_at | string | The creation date of this product. |
meta.timestamps.updated_at | string | The last updated date of this product. |
The relationships object
Attribute | Type | Description |
relationships.cart_item | object | The cart item. |
relationships.cart_item.data | object | The associated cart. |
relationships.cart_item.data.type | string | The type represents the object being returned. |
relationships.cart_item.data.id | string | The unique identifier for this cart item. |
relationships.taxes | object | The taxes object. |
relationships.taxes.data | array | Array of tax items associated with the order item. |
relationships.taxes.data.type | string | The type represents the object being returned. |
relationships.taxes.data.id | string | The unique identifier for this tax item. |
GET
Get order items
https://api.moltin.com/v2/orders/:id/items
Parameters
Path parameters
Name | Required | Type | Description |
id | Required | string | The ID of the order. |
Headers
Name | Required | Type | Description |
Authorization | Required | string | The Bearer token required to get access to the API. |
Request examples
Curl
curl -X GET https://api.moltin.com/v2/orders/:id/items \
-H "Authorization: Bearer XXXX"
JavaScript SDK
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X',
client_secret: 'X'
})
const orderId = 'XXXX'
Moltin.Orders.Items(orderId).then(items => {
})
Moltin.Orders.With('items').All().then(orders => {
})
Response
200 OK
{
"data": [
{
"type": "order_item",
"id": "e8e2655f-3365-49f9-a2f0-1360a295019b",
"quantity": 1,
"product_id": "bf8a9d62-6ca9-45f6-85eb-f0d1d9ae7fdd",
"name": "Woodsy",
"sku": "WDLP100BRO",
"unit_price": {
"amount": 0,
"currency": "GBP",
"includes_tax": false
},
"value": {
"amount": 0,
"currency": "GBP",
"includes_tax": false
},
"links": {},
"meta": {
"display_price": {
"with_tax": {
"unit": {
"amount": 0,
"currency": "GBP",
"formatted": "£0"
},
"value": {
"amount": 0,
"currency": "GBP",
"formatted": "£0"
}
},
"without_tax": {
"unit": {
"amount": 0,
"currency": "GBP",
"formatted": "£0"
},
"value": {
"amount": 0,
"currency": "GBP",
"formatted": "£0"
}
},
"tax": {
"unit": {
"amount": 0,
"currency": "GBP",
"formatted": "£0"
},
"value": {
"amount": 0,
"currency": "GBP",
"formatted": "£0"
}
}
},
"timestamps": {
"created_at": "2018-04-30T10:26:13.342815487Z",
"updated_at": "2018-04-30T10:26:13.342815487Z"
}
},
"relationships": {
"cart_item": {
"data": {
"type": "cart_item",
"id": "62d93144-74ab-4acc-9151-0c96d683c201"
}
},
"taxes": {
"data": [
{
"type": "tax_item",
"id": "6c111e80-9254-4592-b9f4-a30f22b5a8c4"
}
]
}
},
"catalog_id": "92073438-7640-4ace-9670-c8c5c1a89cd7",
"catalog_source": "pim"
}
]
}