Skip to content

Admin API

Getting Started

At the core of 29 Next is the Admin API. It provides RESTful access to products, customers, orders, transactions, support tickets, and more all in JSON format.

Admin API Path
https://<store>.29next.store/api/admin/

Use API Explorer

Access the API explorer on your store at https://<store>.29next.store/api/admin/ to explore the API methods available.

See Full Admin API Reference

Authentication

The Admin API uses Oauth 2 authorization protocol to manage access to your store's resources. Oauth Apps (and associated access tokens) can be tailored with object-level permission to ensure that each integrated service only has access to necessary objects.

Before using the Admin API, you'll need to create a store and create an OAuth App necessary for API access. To create an OAuth App, navigate to Settings > API Access and create a new Oauth App with applicable permissions to retrieve your Access Token. It is recommended to create unique Oauth Apps per external system so that you can revoke as needed.

Use your Oauth App Access Token in the request headers to access the API.

curl -X GET -H "Authorization: Bearer <YOUR API TOKEN>" GET "https://<store>.29next.store/api/admin/" -H "accept: application/json"
import requests
oauth_access_token = '<YOUR OAUTH TOKEN>'
headers = {'Authorization': 'Bearer ' + oauth_access_token }
request = requests.get("https://<store>.29next.store/api/admin/orders/", headers=headers)

API Tokens Are Deprecated

Legacy API Tokens are now deprecated in favor of Oauth App Tokens. If you are currently using Legacy API Tokens, it's recommended to update your integration as they will be removed at a future date.

Permissions

Admin API access is controlled granularly by Scopes that are associated with each OAuth App and associated Access Tokens.

Scope Detail
admin:read Access to list and view all data
admin:write Access to create and update all data
carts:read Access to list and view carts
carts:write Access to create and update carts
catalogue:read Access to list and view catalogue related objects
catalogue:write Access to create and update catalogue related objects
disputes:read Access to list and view disputes
disputes:write Access to create and update disputes
orders:read Access to list and view all orders
orders:write Access to create and update orders
subscriptions:read Access to list and view all subscriptions
subscriptions:write Access to create and update subscriptions
themes:read Access to list and view all themes
transactions:read Access to list and view all transactions
transactions:write Access to create and update transactions
tickets:read Access to list and view all tickets
tickets:write Access to create and update tickets
themes:write Access to create and update themes
users:read Access to list and view all users
users:write Access to create and update users
webhooks:read Access to list and view all webhooks
webhooks:write Access to create and update webhooks

Basic Examples

Create Customer

Create a new customer in your store.

import requests
oauth_access_token = '<YOUR OAUTH TOKEN>'
headers = {'Authorization': 'Bearer ' + oauth_access_token }

data = {
    'email': 'john@example.co',
    'first_name': 'John',
    'last_name': 'Test',
    'phone_number': '+18125559988',
    'language': 'en',
    "accepts_marketing": True
}

request = requests.post(
    "https://<store>.29next.store/api/admin/orders/", headers=headers, data=data)

Create Order

Create an order with PayPal One-click flow.

import requests
oauth_access_token = '<YOUR OAUTH TOKEN>'
headers = {'Authorization': 'Bearer ' + oauth_access_token }

data = {
    'lines': [
        {
            'stockrecord_id': 1,
            'quantity': 1
        }
    ],
    'payment_method': 'paypal',
    'payment_details': {
        'payment_return_url': '<YOUR PAYMENT RETURN URL>' // see redirect method guides
}

request = requests.post(
    "https://<store>.29next.store/api/admin/orders/", headers=headers, data=data)