Edit an existing order with the Admin API
Last updated
Was this helpful?
Last updated
Was this helpful?
Apps can edit any order created by a Shopbase channel (for example, POS, online store, or draft orders) or any orders the app created through the API.
This guide explains how to use the Admin API to edit an existing order. For example, you might add new items to a customer’s order or alter the quantity of line items.
You can make the following edits to an order:
Adjust quantity of a line item
Add new custom line items
Delete an order
Cancel an order
Open-Close a closed order
To use the Admin API to edit orders, your app needs to request the write_order_edits
access scope for a Shopbase store. For more information on requesting access scopes when your app is installed, see .
In Manage orders with the Rest Admin API, we learned how to create a new order and get its ID for future use. If you need to retrieve all the information related to a specific order, then do the following steps
Step 1: Send a GET method to this request URL
Step 2: Save the request method for later use with Postman:
Step 3: Get the first line item's id properties for later adjustment.
You can adjust the quantity of a line item to an order by passing the item id:
PUT https://shop-name.onshopbase.com/admin/orders/{order_id}/adjust.json
SAMPLE
See the request in action with Postman:
You can adjust the quantity of a line item to an order by passing:
PUT https://shop-name.onshopbase.com/admin/orders/{order_id}/adjust.json
SAMPLE
Deleting an order is truly simple. You can remove an existing order by passing:
DELETE https://shop-name.onshopbase.com/admin/orders/{order_id}.json
POST https://shop-name.onshopbase.com/admin/orders/{order_id}/cancel.json
SAMPLE
To open or close an order, pass the following POST method:
POST
GET
We have already learned how to get your API credential in .
Make sure you already has a set payment method before cancelling the order. For instruction on creating a payment method using Shopbase Api, read