App Functions
App Functions Overview
Section titled “App Functions Overview”Gateway App Functions provide programmatic access to integration management, account operations, and workflow orchestration through the /api/2.0/app/* endpoints.
What are App Functions?
Section titled “What are App Functions?”App Functions are application-level operations that enable:
- Account Management: Create and manage customer accounts
- Integration Lifecycle: Install, configure, and manage integrations
- Action Execution: Trigger integration resources (order import, inventory sync, etc.)
- Service Discovery: Explore available integration platforms
- Flow Management: Access automation workflows
- Intent-based Authorization: Generate scoped tokens for web components
Authentication
Section titled “Authentication”All App Functions require Client Credentials OAuth2 authentication:
POST /oauth/tokenContent-Type: application/json
{ "grant_type": "client_credentials", "client_id": "your-client-id", "client_secret": "your-client-secret", "scope": "app:account-read app:integration-read app:integration-action"}Learn more about authentication →
Available Functions
Section titled “Available Functions”Generate OAuth2 access tokens with fine-grained scopes for API access.
Create, list, and manage customer accounts for multi-tenant applications.
Full lifecycle management of e-commerce platform integrations.
Discover and explore available integration platforms and their capabilities.
Access automation workflows and flow definitions.
Generate intent tokens for account-scoped web component authorization.
Common Patterns
Section titled “Common Patterns”1. Creating an Account
Section titled “1. Creating an Account”POST /api/2.0/app/accountsAuthorization: Bearer YOUR_TOKENContent-Type: application/json
{ "remote_id": "myapp_12345", "name": "Acme Corporation",}2. Listing Integrations
Section titled “2. Listing Integrations”GET /api/2.0/app/integrations?page=1&per_page=15Authorization: Bearer YOUR_TOKEN3. Executing Integration Action
Section titled “3. Executing Integration Action”POST /api/2.0/app/integrations/42/actionAuthorization: Bearer YOUR_TOKENContent-Type: application/json
{ "resource": "get_orders", "params": { "order_status": ["open"], "date": "2024-01-15" }}4. Generating Intent Token
Section titled “4. Generating Intent Token”POST /api/2.0/app/intent/ACCT123Authorization: Bearer YOUR_TOKENContent-Type: application/json
{ "scopes": ["webcomponent:integration-read", "webcomponent:integration-event"]}Response Format
Section titled “Response Format”All App Functions return standardized JSON responses:
Success (Single Resource):
{ "data": { "id": 1, "name": "Resource Name" }}Success (Collection):
{ "data": [ { "id": 1, "name": "Item 1" }, { "id": 2, "name": "Item 2" } ], "meta": { "current_page": 1, "total": 50, "per_page": 15 }}Error Handling
Section titled “Error Handling”App Functions use standard HTTP status codes:
| Code | Meaning | Action |
|---|---|---|
401 | Unauthorized | Refresh or regenerate token |
403 | Forbidden | Check token scopes |
404 | Not Found | Verify resource ID |
422 | Validation Error | Fix request payload |
Error Response:
{ "message": "The given data was invalid.", "errors": { "remote_id": ["The remote id has already been taken."] }}Scopes Reference
Section titled “Scopes Reference”| Scope | Description |
|---|---|
app:account-read | Read account data |
app:account-create | Create accounts |
app:account-update | Update accounts |
app:intent-create | Generate intent tokens |
app:integration-read | Read integrations |
app:integration-action | Execute integration actions |
app:integration-claim | Claim integrations for accounts |
app:integration-create | Install integrations |
app:integration-update | Update integration configuration |
app:integration-delete | Delete integrations |
app:service-attach | View available services |
app:flow-read | Read flows |
Next Steps
Section titled “Next Steps”Explore each function in detail:
- Access Tokens - OAuth2 token generation
- Accounts - Account management CRUD operations
- Integrations - Integration lifecycle and actions
- Services - Service catalog and configuration
- Flows - Workflow management
- Intents - Intent-based authorization