Integration Examples

Real-world integration scenarios and complete code examples

Before You Start
Essential information for all integrations

Base URL

https://gateway.regentherapy.com/api/v1

Authentication

X-API-Key: rg_your_api_key

Content Type

application/json
Scenario 1: Private Label Product Integration
Wholesale partner with custom SKU format

Scenario:

Acme Corp is a private label partner. They use SKU format "ACME-PROD-XXX" for their products. They need to submit orders where they reference their own SKU, but we need to map it to our platform products.

1. Get API Key

Acme gets API key: rg_acme_key_abc123

Contact: api-setup@regentherapy.com SKU Prefix: ACME- Tenant ID: tenant_acme_123
Scenario 2: Multi-Tier Pricing Model
Distributor with volume-based pricing

Scenario:

Global Distributors has different pricing based on order volume. They send the same product IDs but prices vary by tier. The system needs to validate pricing against configured tier levels.

Validate order pricing before submission:

POST /orders/validate
{
  "items": [
    {
      "externalSku": "DIST-PRO-100",
      "quantity": 100,
      "price": 15.00
    }
  ]
}

Response:
{
  "valid": true,
  "warnings": [],
  "pricing": {
    "tier": "BULK",
    "validPrice": 15.00,
    "basePricePerUnit": 16.00,
    "discount": "6%"
  }
}
Scenario 3: Shopify Channel Integration
Multi-channel seller with unified inventory

Scenario:

Fashion Brand sells on Shopify, Amazon, and their own site. They need to map Shopify product variants to platform products and track orders across channels.

Map Shopify variant to platform product:

POST /mappings/customer-external
{
  "channel": "shopify",
  "externalProductId": "shopify_var_123456",
  "externalCustomerId": "shopify_cust_789",
  "platformProductId": "prod_fashion_001",
  "platformCustomerId": "cust_internal_001"
}
Error Handling Best Practices

Invalid SKU

400 Bad Request - SKU not found in mappings

Always validate SKU mappings exist before submitting orders.

Pricing Mismatch

422 Unprocessable - Price outside tier range

Use /orders/validate endpoint before submission to catch pricing issues.

Rate Limited

429 Too Many Requests - Wait before retry

Implement exponential backoff. Check X-RateLimit-Remaining header.

Pre-Launch Testing Checklist
Query schema and verify your field names match
Upload all SKU mappings and verify they resolve
Validate test order with /orders/validate before creating
Submit test order and verify it appears in dashboard
Test error scenarios (invalid SKU, bad data)
Verify webhooks are firing for order events