API reference
Apps (OAuth)
Access tokens for App Store apps: exchange an authorization code, read the installation, uninstall.
On this page
Exchange an authorization code for an access token
post
/oauth/tokenCalled by the app's backend with its client credentials (no bearer token). The code is single use and expires 10 minutes after the merchant approved; redirect_uri must be the one the code was issued for. Installs the app (or refreshes the token of an existing installation) and subscribes its webhook topics.
Request body
grant_typestringOne of:
authorization_codeclient_idstringrequiredclient_secretstringrequiredcodestringrequiredredirect_uristringrequired
Example request
curl -X POST "https://api.sellorchard.com/v1/oauth/token" \
-H "Authorization: Bearer $SELLORCHARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": "app_k2m9x7q4w1e8r5t3y6u0i2o4",
"client_secret": "so_secret_...",
"code": "Xf8kQ2...",
"redirect_uri": "https://myapp.example.com/sellorchard/callback"
}'Response200The access token (store it securely; it is not shown again).
ShowHide response schema
access_tokenstringrequiredtoken_typestringscopestringrequiredGranted scopes, space-separated.
installation_idintegerstoreobjectrequiredShowHide child attributes
idstringnamestringdomainstring
{
"access_token": "so_app_...",
"token_type": "bearer",
"scope": "read_products write_orders",
"installation_id": 42,
"store": {
"id": "01JD4Z8T6Q2W9X5V3B7N1M0K8H",
"name": "Orchard Goods",
"domain": "orchard-goods.sellorchard.store"
}
}Error responses
- 400
invalid_requestMalformed request (e.g. a bad cursor). - 401
authenticationMissing, invalid, expired or revoked API key. - 403
permissionThe key lacks the scope, or the store's plan doesn't include the API. - 422
invalid_requestInvalid parameters;errorslists each field. - 429
rate_limitedToo many requests. - 500
serverSomething went wrong on our side; safe to retry with the same Idempotency-Key.
The access token's installation
get
/oauth/installationApp access tokens only (an API key gets 403). The store, the granted scopes and when it was installed.
Example request
curl "https://api.sellorchard.com/v1/oauth/installation" \
-H "Authorization: Bearer $SELLORCHARD_API_KEY"Response200The installation of the access token.
ShowHide response schema
dataobjectrequiredShowHide child attributes
objectstringidintegerstatusstringOne of:
activeuninstalledappobjectstoreobjectscopesarray of stringinstalled_atstring<date-time>uninstalled_atstring<date-time> | null
{
"data": {
"object": "app_installation",
"id": 42,
"status": "active",
"app": {
"client_id": "app_k2m9x7q4w1e8r5t3y6u0i2o4",
"name": "Order Sync",
"slug": "order-sync"
},
"store": {
"id": "01JD4Z8T6Q2W9X5V3B7N1M0K8H",
"name": "Orchard Goods",
"domain": "orchard-goods.sellorchard.store"
},
"scopes": [
"read_products",
"write_orders"
],
"installed_at": "2026-11-02T15:00:00Z",
"uninstalled_at": null
}
}Error responses
- 401
authenticationMissing, invalid, expired or revoked API key. - 403
permissionThe key lacks the scope, or the store's plan doesn't include the API. - 429
rate_limitedToo many requests. - 500
serverSomething went wrong on our side; safe to retry with the same Idempotency-Key.
Uninstall the app
delete
/oauth/installationThe app removes itself from the store: the token stops working at once, its webhook subscriptions are removed and app.uninstalled is sent (uninstalled_by "app").
Example request
curl -X DELETE "https://api.sellorchard.com/v1/oauth/installation" \
-H "Authorization: Bearer $SELLORCHARD_API_KEY"Response200The installation of the access token.
ShowHide response schema
dataobjectrequiredShowHide child attributes
objectstringidintegerstatusstringOne of:
activeuninstalledappobjectstoreobjectscopesarray of stringinstalled_atstring<date-time>uninstalled_atstring<date-time> | null
{
"data": {
"object": "app_installation",
"id": 42,
"status": "active",
"app": {
"client_id": "app_k2m9x7q4w1e8r5t3y6u0i2o4",
"name": "Order Sync",
"slug": "order-sync"
},
"store": {
"id": "01JD4Z8T6Q2W9X5V3B7N1M0K8H",
"name": "Orchard Goods",
"domain": "orchard-goods.sellorchard.store"
},
"scopes": [
"read_products",
"write_orders"
],
"installed_at": "2026-11-02T15:00:00Z",
"uninstalled_at": null
}
}Error responses
- 401
authenticationMissing, invalid, expired or revoked API key. - 403
permissionThe key lacks the scope, or the store's plan doesn't include the API. - 429
rate_limitedToo many requests. - 500
serverSomething went wrong on our side; safe to retry with the same Idempotency-Key.