Integrations

GET /integrations

List the organization's connected storefront integrations, newest first. Access tokens are never returned.

Requires the settings:read permission.

Query Parameters

limitnumber

The number of records to return.

cursorstring

A pagination cursor. Fetch the next page by passing the nextCursor value from the previous response.

sortcreatedAt | -createdAt

The sort order. Prefix a field with - to sort descending. Defaults to -createdAt.

filterstring

A JSON-encoded filter document, for example {"createdAt":{"$gte":"2025-01-01T00:00:00Z"}}. Filterable fields: id, type, createdAt. See Filtering for the syntax.

Request
curl \
  "https://api.cascade.dev/integrations" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "shopify",
      "publicData": "...",
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ],
  "nextCursor": "string"
}

GET /integrations/{id}

Get a single integration by ID.

Requires the settings:read permission.

Path Parameters

idstring (uuid)required

The ID of the integration.

Request
curl \
  "https://api.cascade.dev/integrations/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "shopify",
  "publicData": "...",
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

PATCH /integrations/{id}

Update how a connected integration behaves in Cascade. Only the settings you send are changed, and the rest are left alone. These are Cascade's own settings, not the store's.

Requires the settings:write permission.

Path Parameters

idstring (uuid)required

The ID of the integration.

Body Parameters

settingsobject

The sync settings to change. Anything you leave out keeps its current value.

Request
curl \
  -X PATCH \
  "https://api.cascade.dev/integrations/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "settings": {
    "onProductDelete": "delete",
    "onCustomerDelete": "delete",
    "onOrderDelete": "delete",
    "earnOn": "orderCreated",
    "earnOnBackfill": true,
    "metafieldMappings": [
      {
        "resource": "...",
        "namespace": "...",
        "key": "...",
        "metadataKey": "..."
      }
    ]
  }
}'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "shopify",
  "publicData": "...",
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

DELETE /integrations/{id}

Disconnect an integration. Syncing stops and the stored access token is discarded. Records already synced into Cascade are kept.

Requires the settings:write permission.

Path Parameters

idstring (uuid)required

The ID of the integration to disconnect.

Request
curl \
  -X DELETE \
  "https://api.cascade.dev/integrations/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "shopify",
  "publicData": "...",
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

GET /integrations/shopify/connect-context

Check whether a Shopify store can be connected to this organization, and say why not if it cannot. The connect screen calls this so it never offers a button that would fail after the OAuth round trip.

Requires the settings:read permission.

Query Parameters

shopstringrequired

The myshopify.com domain of the store being connected

Request
curl \
  "https://api.cascade.dev/integrations/shopify/connect-context" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "shop": "string",
  "organization": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "string"
  },
  "siteCount": 0,
  "siteLimit": 0,
  "blockedReason": "string"
}

POST /integrations/shopify/grant

Authorize the Shopify connector to connect a store to the signed-in user's organization

Requires the settings:write permission.

Body Parameters

shopstringrequired

The myshopify.com domain of the store being connected

statestringrequired

The connector's one-time state nonce

Request
curl \
  -X POST \
  "https://api.cascade.dev/integrations/shopify/grant" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "shop": "string",
  "state": "string"
}'
Response
{
  "grant": "string"
}