Edit an existing order with the Admin API
Last updated
let response = pm.response.json()
if (response.order.line_items[0].length > 0) pm.globals.set("line_item_id", response.order.line_items[0].id){
"is_send_email": true,
"line_items": [
{ "id": {{line_item_id}},
"name": "New Item",
"properties": "Color",
"quantity": 15,
"require_shipping": true,
"restock": true,
"variant_id": 0
}
],
"reason": "Need more quantity"
}let response = pm.response.json()
if (response.order.line_items[0].length > 0) {
pm.globals.set("line_item_id", response.order.line_items[0].id)
}{
"is_send_email": true,
"line_items": [
{
"id": 0,
"is_custom": true,
"name": "string",
"price": 20,
"properties": "string",
"quantity": 10,
"require_shipping": true,
"restock": true,
"variant_id": 0
}
],
"reason": "We need more item"
}{
"amount": "20",
"currency": "USD",
"email": true,
"reason": "customer",
"refund": {},
"restock": true
}https://shop-name.onshopbase.com/admin/orders/{order_id}/open.json