Update an Order

You can only update custom data, shipping and shipping_address on orders. Everything else inside the order object is immutable.

You can only update order shipping and shipping_address, if the order has not been fulfilled.

put
Update by ID

https://api.moltin.com/v2/orders/:id
Request
Response
Path Parameters
id
required
string
The ID of the order you wish to update
Headers
Authorization
required
string
The Bearer token to grant access to the API
Body Parameters
type
required
string
order
200: OK
{
"data": {
"type": "order",
"id": "369ad4a4-ee67-48b0-x347-t50a6e61d83d",
"status": "incomplete",
"payment": "unpaid",
"shipping": "unfulfilled",
"customer": {
"name": "Mr John Doe",
"email": "johndoe@example.com"
},
"shipping_address": {
"first_name": "James",
"last_name": "Doe",
"phone_number": "",
"company_name": "",
"line_1": "2nd Floor British India House",
"line_2": "15 Carliol Square",
"city": "Newcastle Upon Tyne",
"postcode": "NE1 6UF",
"county": "Tyne & Wear",
"country": "United Kingdom",
"instructions": ""
},
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"company_name": "",
"line_1": "2nd Floor British India House",
"line_2": "15 Carliol Square",
"city": "Newcastle Upon Tyne",
"postcode": "NE1 6UF",
"county": "Tyne & Wear",
"country": "United Kingdom"
},
"links": {},
"meta": {
"display_price": {
"with_tax": {
"amount": 237500,
"currency": "USD",
"formatted": "$2175.00"
},
"without_tax": {
"amount": 237500,
"currency": "USD",
"formatted": "$2175.00"
}
},
"timestamps": {
"created_at": "2018-04-16T10:11:59.715Z",
"updated_at": "2018-04-16T10:11:59.715Z"
}
},
"relationships": {
"items": {
"data": [
{
"type": "item",
"id": "de9fddf5-011b-4485-abf8-ebb8f53c39ff"
}
]
}
}
}
}
cURL
JavaScript SDK
curl -X PUT https://api.moltin.com/v2/orders/:id \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type": "order"
"shipping_address": {
"first_name": "John"
}
}
}'
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X',
client_secret: 'X'
})
const id = 'XXXX'
const order = {
shipping_address: {
first_name: "John"
}
}
Moltin.Orders.Update(id, order).then(order => {
// Do something
})