Manage orders with the REST Admin API
Last updated
Was this helpful?
Last updated
Was this helpful?
You can use the REST Admin API to create orders and transactions to validate your app's behavior.
To best understand this guide, you can familiarize yourself with the concepts of and .
Transactions are associated to orders and occur each time there is an exchange of money. Transactions are processed by payment providers, and involve the transfer of money from the issuer account (the customer's credit card) to the acquirer (the merchant's bank account). For more information, see .
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 . To make things easy for you, we have also included a guideline on .
To test orders, create an order with an authorization transaction by sending a POST request to the resource:
POST https://shop-name.onshopbase.com/admin/orders.json
To be more specific, we can take a look at how we can use Postman to create this order
STEP 2: Send the POST Request with Postman
STEP 3: Save this request into a collection and extract the Order ID as a variable
After creating an order, the returned Order object includes an ID. You can use the order ID to create a transaction.
POST https://shop-name.onshopbase.com/admin/orders/{order_id}/transactions.json
GET https://shop-name.onshopbase.com/admin/orders/{order_id}/transactions.json
Let's also look at how this request is handled by using Postman:
STEP 1: Use the same API Credential from the above instruction to create a new POST Request. Set `{{order_id}}` parameter in the request url as below:
STEP 2: Save the request call into a collection for future's use.
STEP 1: Create your Shopbase's API Credentials by following the .
After you create the transaction, you can then use the order ID to get its transactions and transaction IDs. To retrieve the transactions, send a GET request to the .