Organization connectors

View and manage payment-provider connectors across the organization's merchants from the Dashboard.

These endpoints give the organization a cross-merchant view of connectors — each merchant's connection to a payment provider. From here an org admin can review coverage and manage connectors without switching merchant by merchant.

A connector still belongs to exactly one merchant; the organization view simply aggregates them. Disabling one takes it out of that merchant's routing immediately.

Every member can read connectors. Creating, updating or deleting one, and testing its credentials (which decrypts them and calls the provider), needs an owner or admin of the organization — a viewer is refused with 403, and the Dashboard hides those controls from viewers. Organization API keys are governed by their org:connectors:write scope instead.

These endpoints power the Tokeflow Dashboard UI at the organization level. They are session-authenticated (JWT bearer) — the token comes from signing in to the Dashboard, not from an sk_/pk_ API key. Requests also carry the x-organization-id header, and the signed-in user must be a member of that organization.

The connector object

Returned by the list and retrieve endpoints on this page.

FieldTypeDescription
idstringConnector ID.
merchant_idstringMerchant ID.
provider_slugstringPayment provider slug.
payment_provider_idstringID of the payment provider behind the connector — still readable after the provider stops being listed as active.
namestringConnector name.
country_codestring | nullISO 3166-1 alpha-2 country code.
auth_methodstringAuthentication method (api_key for V1).
is_test_modebooleanWhether this is a test mode connector.
is_activebooleanWhether the connector is active.
created_atstringConnector creation timestamp. (ISO 8601 UTC).
webhook_urlstring | nullWebhook URL for receiving PSP events. Configure this in your PSP dashboard, unless registers_webhooks is true.
registers_webhooksbooleanWhether Tokeflow registers webhook_url with the provider itself. false means you add it in the provider's dashboard.
has_webhook_secretbooleanWhether inbound provider webhooks can be verified — a webhook_secret is stored, or the provider signs with a key already in credentials (some providers sign with the account secret key).
configobject | nullOptional non-sensitive per-connector config: a card_brands override (null falls back to the PSP's default_supported_card_brands) and installments_enabled — unset: API charges may request installments but the checkout does not offer them; true: offered at checkout too; false: installment charges refused on this connector. See Connector config.

Endpoints

GET/api/v1/org/connectors

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

List connectors for merchant.

Query parameters

FieldTypeRequiredDescription
pagenumberNoPage number (1-indexed). Default 1, min 1.
limitnumberNoNumber of items per page. Default 20, min 1, max 100.

Example request

curl -G https://api.tokeflow.com/api/v1/org/connectors \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  --data-urlencode "page=1" \
  --data-urlencode "limit=20"

Example response — 200

{
  "data": [
    {
      "id": "conn_123abc...",
      "merchant_id": "mrc_123",
      "provider_slug": "provider_a",
      "name": "Provider A BRL",
      "country_code": "BR",
      "auth_method": "api_key",
      "is_test_mode": false,
      "is_active": true,
      "created_at": "2025-11-20T10:00:00Z",
      "webhook_url": "https://api.example.com/webhooks/connectors/conn_123?token=whsec_abc123",
      "has_webhook_secret": true,
      "config": {
        "card_brands": [
          "visa",
          "mastercard",
          "elo"
        ],
        "installments_enabled": true
      }
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 42,
    "total_pages": 3,
    "has_next": true,
    "has_prev": false
  }
}

POST/api/v1/org/connectors

Org

Auth: Dashboard session (JWT bearer). Organization owner or admin required.

Create a new connector.

Request fields

FieldTypeRequiredDescription
provider_slugstringYesPayment provider slug. One of provider_a, provider_b, provider_c, provider_d, provider_e.
namestringYesConnector name.
country_codestringNoISO 3166-1 alpha-2 country code. Nullable for non-country-specific PSPs.
is_test_modebooleanYesWhether this connector is in test mode.
is_activebooleanNoWhether the connector is active on creation. Defaults to true when omitted. An inactive connector is skipped by routing evaluation and is rejected by PATCH /routing/profiles/:id/default-connector. Note that createRoutingProfile and updateRoutingProfile do not currently filter on is_active, so a profile can still be created with an inactive default — charges on it then fail at resolution time.
credentialsobjectYesProvider-specific credentials for the connected provider — for example an API key, or an access token plus country. The exact fields depend on the provider. Values are encrypted at rest and never returned in full.
webhook_secretstringNoPSP webhook signing secret for verifying inbound webhooks. Format depends on the provider: Provider A uses whsec_...; Provider B expects a stringified JSON object {"username":"...","password":"..."} used for HTTP Basic Auth verification; some providers expect the access token set on the webhook in their dashboard, and some need none (they sign with the account secret key).
configobjectNoOptional non-sensitive per-connector config: card_brands (narrows the brands surfaced to the SDK) and installments_enabled (true offers installments at checkout, false refuses them, unset accepts API-requested installments only). See Connector config.
auth_methodstringYesOne of api_key, oauth2.

Example request

curl -X POST https://api.tokeflow.com/api/v1/org/connectors \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  -H "Content-Type: application/json" \
  -d '{
    "provider_slug": "provider_a",
    "name": "Main Payment Processor",
    "country_code": "BR",
    "is_test_mode": false,
    "is_active": true,
    "credentials": {
      "api_key": "sk_test_123456789"
    },
    "webhook_secret": "whsec_abc123...",
    "config": {
      "card_brands": [
        "visa",
        "mastercard",
        "elo"
      ],
      "installments_enabled": true
    },
    "auth_method": "api_key"
  }'

Example response — 201

{
  "id": "conn_123abc...",
  "merchant_id": "mrc_123",
  "provider_slug": "provider_a",
  "name": "Provider A BRL",
  "country_code": "BR",
  "auth_method": "api_key",
  "is_test_mode": false,
  "is_active": true,
  "created_at": "2025-11-20T10:00:00Z",
  "webhook_url": "https://api.example.com/webhooks/connectors/conn_123?token=whsec_abc123",
  "has_webhook_secret": true,
  "config": {
    "card_brands": [
      "visa",
      "mastercard",
      "elo"
    ],
    "installments_enabled": true
  }
}

DELETE/api/v1/org/connectors/:connector_id

Org

Auth: Dashboard session (JWT bearer). Organization owner or admin required.

Delete a connector.

Path parameters

FieldTypeRequiredDescription
connector_idstringYes—

Example request

curl -X DELETE https://api.tokeflow.com/api/v1/org/connectors/conn_a1b2c3d4 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3"

Example response — 204 No Content

An empty body is returned on success.


GET/api/v1/org/connectors/:connector_id

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Get connector by ID.

Path parameters

FieldTypeRequiredDescription
connector_idstringYes—

Example request

curl https://api.tokeflow.com/api/v1/org/connectors/conn_a1b2c3d4 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3"

Example response — 200

{
  "id": "conn_123abc...",
  "merchant_id": "mrc_123",
  "provider_slug": "provider_a",
  "name": "Provider A BRL",
  "country_code": "BR",
  "auth_method": "api_key",
  "is_test_mode": false,
  "is_active": true,
  "created_at": "2025-11-20T10:00:00Z",
  "webhook_url": "https://api.example.com/webhooks/connectors/conn_123?token=whsec_abc123",
  "has_webhook_secret": true,
  "config": {
    "card_brands": [
      "visa",
      "mastercard",
      "elo"
    ],
    "installments_enabled": true
  }
}

PATCH/api/v1/org/connectors/:connector_id

Org

Auth: Dashboard session (JWT bearer). Organization owner or admin required.

Update a connector.

Path parameters

FieldTypeRequiredDescription
connector_idstringYes—

Request fields

FieldTypeRequiredDescription
namestringNoConnector name.
is_activebooleanNoWhether the connector is active.
credentialsobjectNoProvider-specific credentials for the connected provider — for example an API key, or an access token plus country. The exact fields depend on the provider. Values are encrypted at rest and never returned in full.
webhook_secretstringNoPSP webhook signing secret for verifying inbound webhooks. Format depends on the provider: Provider A uses whsec_...; Provider B expects a stringified JSON object {"username":"...","password":"..."} used for HTTP Basic Auth verification; some providers expect the access token set on the webhook in their dashboard, and some need none (they sign with the account secret key).
configobjectNoOptional non-sensitive per-connector config, merged key by key. Pass an empty array or omit card_brands to clear the brand override; pass installments_enabled: null to return installments to unset. See Connector config.

Example request

curl -X PATCH https://api.tokeflow.com/api/v1/org/connectors/conn_a1b2c3d4 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Provider A BRL Prod",
    "is_active": false,
    "credentials": {
      "api_key": "sk_live_provider_key_rotated",
      "account_id": "acct_456"
    },
    "webhook_secret": "whsec_abc123...",
    "config": {
      "card_brands": [
        "visa",
        "mastercard",
        "elo"
      ],
      "installments_enabled": true
    }
  }'

Example response — 200

{
  "id": "conn_123abc...",
  "merchant_id": "mrc_123",
  "provider_slug": "provider_a",
  "name": "Provider A BRL",
  "country_code": "BR",
  "auth_method": "api_key",
  "is_test_mode": false,
  "is_active": true,
  "created_at": "2025-11-20T10:00:00Z",
  "webhook_url": "https://api.example.com/webhooks/connectors/conn_123?token=whsec_abc123",
  "has_webhook_secret": true,
  "config": {
    "card_brands": [
      "visa",
      "mastercard",
      "elo"
    ],
    "installments_enabled": true
  }
}

POST/api/v1/org/connectors/:connector_id/test

Org

Auth: Dashboard session (JWT bearer). Organization owner or admin required.

Test connector credentials against the PSP.

Path parameters

FieldTypeRequiredDescription
connector_idstringYes—

Example request

curl -X POST https://api.tokeflow.com/api/v1/org/connectors/conn_a1b2c3d4/test \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3"

GET/api/v1/org/connectors/:connector_id/webhooks/inbounds

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Get inbound webhook events for a connector.

Path parameters

FieldTypeRequiredDescription
connector_idstringYes—

Query parameters

FieldTypeRequiredDescription
pagenumberNoPage number (1-indexed). Default 1, min 1.
limitnumberNoNumber of items per page. Default 20, min 1, max 100.
statusstringNoFilter by webhook event status
fromstringNoInclusive lower bound for received_at (ISO 8601)
tostringNoInclusive upper bound for received_at (ISO 8601)

Example request

curl -G https://api.tokeflow.com/api/v1/org/connectors/conn_a1b2c3d4/webhooks/inbounds \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  --data-urlencode "page=1" \
  --data-urlencode "limit=20" \
  --data-urlencode "status=pending" \
  --data-urlencode "from=2026-04-01T00:00:00Z"

GET/api/v1/org/connectors/:connector_id/webhooks/invalid

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Get invalid webhook events for a connector.

Path parameters

FieldTypeRequiredDescription
connector_idstringYes—

Query parameters

FieldTypeRequiredDescription
pagenumberNoPage number (1-indexed). Default 1, min 1.
limitnumberNoNumber of items per page. Default 20, min 1, max 100.
fromstringNoInclusive lower bound for received_at (ISO 8601)
tostringNoInclusive upper bound for received_at (ISO 8601)

Example request

curl -G https://api.tokeflow.com/api/v1/org/connectors/conn_a1b2c3d4/webhooks/invalid \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  --data-urlencode "page=1" \
  --data-urlencode "limit=20" \
  --data-urlencode "from=2026-04-01T00:00:00Z" \
  --data-urlencode "to=2026-04-30T23:59:59Z"

Errors

Errors use the standard envelope. The most common cases here:

HTTPMeaning
400Invalid parameters or a state that does not allow this operation.
401Missing, expired, or invalid Dashboard session token.
403Authenticated, but the signed-in user lacks access to this entity, or is not an owner or admin for a change that needs one (INSUFFICIENT_PERMISSIONS).
404The record does not exist or is not visible to this entity.

On this page