Skip to content

API Overview

The Gateway REST API provides comprehensive access to integration management, order synchronization, and platform connectivity. This page provides an overview of the API structure, capabilities, and usage patterns.

All API requests are made to:

https://<GATEWAY_URL>/api

Where <GATEWAY_URL> is your Gateway deployment domain.

The Gateway API has two versions:

VersionPrefixStatusPrimary Use
1.0/api/1.0/*LegacyUser-based operations, backwards compatibility
2.0/api/2.0/*CurrentModern endpoint structure, recommended for new integrations

[!IMPORTANT] All new integrations should use API v2.0. Version 1.0 is maintained for backwards compatibility only.

Learn more about API versioning →


The Gateway API is organized into three main endpoint groups:

Authentication: Password Grant OAuth2 (auth:api)

Purpose: User management and OAuth client administration

Common Operations:

  • Manage users (CRUD)
  • Create OAuth clients -Configure apps and services
  • Claim integrations

Example:

Terminal window
GET /api/2.0/user/apps

View authentication details →


Authentication: Client Credentials Grant (client_credentials + auth.app)

Purpose: Application-level integration management

Common Operations:

  • List and manage integrations
  • Execute integration actions
  • Manage accounts
  • Create intent tokens
  • View services and flows

Example:

Terminal window
GET /api/2.0/app/integrations
POST /api/2.0/app/integrations/{id}/action

Explore app functions →


3. WEBCOMPONENT Endpoints (/api/2.0/webcomponent/*)

Section titled “3. WEBCOMPONENT Endpoints (/api/2.0/webcomponent/*)”

Authentication: Account-based (auth.account:webcomponent:*)

Purpose: Account-scoped operations for embedded web components

Common Operations:

  • List account integrations
  • Install/uninstall integrations
  • Manage schedules
  • View logs
  • Upload logos

Example:

Terminal window
GET /api/2.0/webcomponent/integrations
POST /api/2.0/webcomponent/integrations/{id}/install

All requests must include:

Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

For POST, PUT, and PATCH requests, send data as JSON:

{
"name": "My Shopify Integration",
"shop": "mystore.myshopify.com"
}

All successful responses return JSON:

{
"data": {
"id": 1,
"name": "Shopify",
"type": "SHOPIFYV2"
}
}

For list endpoints, data is an array with pagination metadata:

{
"data": [
{ "id": 1, "name": "Integration 1" },
{ "id": 2, "name": "Integration 2" }
],
"meta": {
"current_page": 1,
"from": 1,
"to": 2,
"per_page": 15,
"total": 50,
"last_page": 4
},
"links": {
"first": "https://<GATEWAY_URL>/api/2.0/app/integrations?page=1",
"last": "https://<GATEWAY_URL>/api/2.0/app/integrations?page=4",
"prev": null,
"next": "https://<GATEWAY_URL>/api/2.0/app/integrations?page=2"
}
}

Errors return appropriate HTTP status codes with descriptive messages:

{
"message": "The given data was invalid.",
"errors": {
"name": ["The name field is required."],
"shop": ["The shop field is required."]
}
}

CodeMeaningDescription
200OKRequest succeeded
201CreatedResource created successfully
204No ContentRequest succeeded, no content returned
400Bad RequestInvalid request parameters
401UnauthorizedInvalid or missing authentication
403ForbiddenAuthenticated but not authorized
404Not FoundResource not found
422Unprocessable EntityValidation errors
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error

List endpoints support pagination via query parameters:

Request:

Terminal window
GET /api/2.0/app/integrations?page=2&per_page=25

Query Parameters:

  • page - Page number (default: 1)
  • per_page - Items per page (default: 15, max: 100)

Response includes navigation links:

{
"links": {
"first": "?page=1",
"last": "?page=10",
"prev": "?page=1",
"next": "?page=3"
}
}

API requests are rate-limited based on authentication method:

Authentication MethodLimit
Password Grant60 requests/minute
Client Credentials100 requests/minute
Account Token120 requests/minute

Rate limit headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 98
X-RateLimit-Reset: 1640000000

When rate limited, you’ll receive:

{
"message": "Too Many Requests"
}

HTTP Status: 429 Too Many Requests


All timestamps use ISO 8601 format in UTC:

2024-01-15T10:30:00.000000Z

Use JSON boolean values:

{
"active": true,
"mutable": false
}

Nullable fields return null when empty:

{
"description": null
}

Some endpoints support filtering:

Terminal window
GET /api/2.0/app/integrations?status=ACTIVE

Use sort parameter where supported:

Terminal window
GET /api/2.0/app/integrations?sort=-created_at
  • field - Ascending order
  • -field - Descending order

Some endpoints support including related resources:

Terminal window
GET /api/2.0/app/integrations?include=service,schedules

Some operations are idempotent by nature:

  • GET - Always idempotent
  • PUT - Idempotent (full resource replacement)
  • DELETE - Idempotent (deleting already-deleted resource returns 404)
  • POST - Generally NOT idempotent (creates new resources)

For critical POST operations, use unique identifiers to prevent duplicates.


The Gateway API supports Cross-Origin Resource Sharing (CORS) for browser-based applications.

Allowed headers:

  • Authorization
  • Content-Type
  • Accept
  • X-Requested-With

Explore the API interactively using Swagger UI:

Open API Documentation →

Features:

  • 🧪 Test endpoints directly from browser
  • 📋 View complete request/response schemas
  • 🔐 Built-in authentication
  • 📚 Comprehensive endpoint documentation

Currently, the Gateway does not provide official SDKs. However, the REST API can be easily consumed using standard HTTP libraries:

PHP:

  • Guzzle HTTP Client
  • Laravel HTTP Client

JavaScript:

  • Axios
  • Fetch API
  • Node.js https module

Python:

  • requests
  • httpx

See the Getting Started guide for code examples in multiple languages.


Always use v2.0 endpoints for new integrations:

Good: GET /api/2.0/app/integrations

Avoid: GET /api/1.0/integrations

Always check HTTP status codes and handle errors:

try {
const response = await axios.get('/api/2.0/app/integrations');
console.log(response.data);
} catch (error) {
if (error.response.status === 401) {
// Refresh token
} else if (error.response.status === 422) {
// Handle validation errors
console.error(error.response.data.errors);
}
}

Implement exponential backoff when rate limited:

async function retryWithBackoff(fn, retries = 3) {
for (let i = 0; i < retries; i++) {
try {
return await fn();
} catch (error) {
if (error.response?.status === 429 && i < retries - 1) {
await new Promise(resolve => setTimeout(resolve, Math.pow(2, i) * 1000));
} else {
throw error;
}
}
}
}

Cache static data like services and service configurations:

const cache = new Map();
async function getServices() {
if (cache.has('services')) {
return cache.get('services');
}
const response = await axios.get('/api/2.0/app/services');
cache.set('services', response.data, { ttl: 3600 });
return response.data;
}

Follow REST semantics:

  • GET - Retrieve data (no side effects)
  • POST - Create new resources
  • PUT - Full resource update
  • PATCH - Partial resource update
  • DELETE - Remove resources