Shops
The Shops resource allows a user to manage their BoxC shop, or connect and manage their third party shops. Fulfilled orders will have their tracking information sent back to their shop when orders are linked to a third party shop (e.g. Shopify) if possible. A shop with orders or SKUs cannot be deleted.
Shop Connector
The BoxC API has a separate shop connector that handles the authorization paradigm for third party shops. The process may be different depending on the type of shop. For instance, the authorization process for Shopify works as follows.
- The user creates a new shop in their account by using
POST /shops
and taking note of their shop'sid
. - They visit https://api.boxc.com/v1/shops/{id}/connect where {id} is the
id
from above, and follow the instructions there. It will tell them to follow a link to authorize BoxC's Shopify application for their Shopify account. - Once they grant permission to BoxC they will be redirected back to a success page where it completes the authorization flow and saves the new access token for their Shopify shop.
- The user can now manully create orders for their shop or wait for the system to import orders.
Shop Types
Below is a table of third party shops supported by the system, along with the rules used to choose which orders are imported automatically. Orders that don't match the criteria will need to be created manually.
Type | Rules |
---|---|
Shopify |
|
Actions
GET /shops |
Retrieves a paginated list of shops |
GET /shops/{id} |
Retrieves a shop |
GET /shops/{id}/connect |
Initializes the shop authorization process |
POST /shops |
Creates a shop |
PUT /shops/{id} |
Updates a shop |
DELETE /shops/{id} |
Deletes a shop |
Properties
active |
|
connected |
|
created |
|
expires |
|
id |
|
name |
|
settings |
{ "settings": { "default_service": "BoxC Plus", "delay_processing": 24, "packing_slip": false, "partial_fulfillment": true } } Array - Default settings for the shop. Not all settings apply for every shop type. Required. default_service: String - Orders imported from integrated third party shops like Shopify will inherit this setting as their shipping service. If the default service isn't available then it will be downgraded. Required.delay_processing: Integer - The number of hours an order should remain unprocessed in the system before packing. Orders will be processed if their created value plus the shop's delay_processing value is greater than the current time. Max: 240. Required. packing_slip: Boolean - Whether or not orders imported from an external shop (e.g. a Shopify store) should include a packing slip in the shipment. Additional fees may apply. Default: false. Required. partial_fulfillment: Boolean - Whether or not orders imported from an external shop (e.g. a Shopify store) should be partially fulfilled by default. Default: false. Required. |
type |
|
limit |
The number of results to return. Max: 100. Default: 50. |
order |
The order of the results. Options are "asc" for ascending (default), or "desc" for descending. |
name |
Filter that searches for shops with a similar name. Default: none. |
page |
The page number of the results. Default is 1. |
GET /shops?page=1&limit=50&order=asc&name=PhoneBlox
HTTP/1.1 200 OK
{ "shops": [ { "active": true, "connected": true, "created": "2016-03-01 22:15:35", "expires": null, "id": "my-shop", "name": "PhoneBlox", "settings": { "default_service": "BoxC Priority", "delay_processing": 48, "packing_slip": true, "partial_fulfillment": false }, "type": "BoxC" }, { "active": false, "connected": false, "created": "2016-01-01 08:09:23", "expires": null, "id": "myOtherShop", "name": "PhoneBlox Shopify", "settings": { "default_service": "BoxC Priority", "delay_processing": 0, "partial_fulfillment": true }, "type": "Shopify" } ], "total_pages": 0, "total_shops": 0 }
GET /shops/my-shop
HTTP/1.1 200 OK
{ "shop": { "active": true, "connected": true, "created": "2016-03-01 22:15:35", "expires": null, "id": "my-shop", "name": "Appleseeds", "settings": { "default_service": "BoxC Priority", "delay_processing": 48, "packing_slip": true, "partial_fulfillment": false }, "type": "BoxC" } }
GET /shops/my-shop/connect
HTTP/1.1 200 OK
This action returns a web page.
POST /shops
{ "shop": { "active": true, "id": "my-shop", "name": "Appleseeds", "settings": { "default_service": "BoxC Priority", "delay_processing": 48, "packing_slip": true, "partial_fulfillment": false }, "type": "BoxC" } }
HTTP/1.1 201 Created
{ "shop": { "active": true, "connected": true, "created": "2016-03-01 22:15:35", "expires": null, "id": "my-shop", "name": "Appleseeds", "settings": { "default_service": "BoxC Priority", "delay_processing": 48, "packing_slip": true, "partial_fulfillment": false }, "type": "BoxC" } }
PUT /shops/my-shop
{ "shop": { "active": false, "name": "Appleseeds - Inactive", "settings": { "default_service": "BoxC Priority", "delay_processing": 0, "packing_slip": false, "partial_fulfillment": false } } }
HTTP/1.1 200 OK
{ "shop": { "active": false, "connected": true, "created": "2016-03-01 22:15:35", "expires": null, "id": "my-shop", "name": "Appleseeds - Inactive", "settings": { "default_service": "BoxC Priority", "delay_processing": 0, "packing_slip": false, "partial_fulfillment": false }, "type": "BoxC" } }
DELETE /shops/my-shop
HTTP/1.1 200 OK