Get Order Items
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. |
x-moltin-customer-token | Optional | string | A customer token to access a specific customer order. |
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 => {
// Do something
})
// Or using includes
Moltin.Orders.With('items').All().then(orders => {
// Do something
})
Response Example
200 OK
"data": {
"type": "order_item",
"id": "7d96d30e-d833-4752-bef7-1f13a3304d49",
"quantity": 1,
"product_id": "083a5232-3923-4f01-a45a-767399652738",
"name": "Product 083a5232-3923-4f01-a45a-767399652738",
"sku": "IFD-1",
"unit_price": {
"amount": 10000,
"currency": "USD",
"includes_tax": false
},
"value": {
"amount": 10000,
"currency": "USD",
"includes_tax": false
},
"discounts": [
{
"amount": {
"amount": -1000,
"currency": "USD",
"includes_tax": false
},
"code": "10_OFF",
"id": "b368b634-dc1a-4e01-a90c-81221be9e80c"
}
],
"links": {},
"meta": {
"display_price": {
"with_tax": {
"unit": {
"amount": 9000,
"currency": "USD",
"formatted": "$90.00"
},
"value": {
"amount": 9000,
"currency": "USD",
"formatted": "$90.00"
}
},
"without_tax": {
"unit": {
"amount": 9000,
"currency": "USD",
"formatted": "$90.00"
},
"value": {
"amount": 9000,
"currency": "USD",
"formatted": "$90.00"
}
},
"tax": {
"unit": {
"amount": 0,
"currency": "USD",
"formatted": "$0"
},
"value": {
"amount": 0,
"currency": "USD",
"formatted": "$0"
}
},
"discount": {
"unit": {
"amount": -1000,
"currency": "USD",
"formatted": "$10.00"
},
"value": {
"amount": -1000,
"currency": "USD",
"formatted": "$10.00"
}
},
"without_discount": {
"unit": {
"amount": 10000,
"currency": "USD",
"formatted": "$10,000"
},
"value": {
"amount": 10000,
"currency": "USD",
"formatted": "$10,000"
}
},
"discounts": {
"10_OFF": {
"amount": -1000,
"currency": "USD",
"formatted": "-$10.00"
}
}
}
},
"timestamps": {
"created_at": "2022-07-27T02:22:55Z",
"updated_at": "2022-07-27T02:22:55Z"
}
},
"relationships": {
"cart_item": {
"data": {
"type": "cart_item",
"id": "e7543520-d085-408b-9c70-bc3a85c762c9"
}
}
},
"catalog_id": "default",
"catalog_source": "legacy"
}
]
}
}