Merchant settings

Read and update a merchant's own settings and profile from the Dashboard, and manage the people who have access to it.

These endpoints back the Dashboard's settings screen for a single merchant: its profile and configuration, plus the team members who can sign in and act on its behalf.

Membership here is what the x-merchant-id header checks on every other Dashboard call — add or remove a member and you change who can manage this merchant's catalog, connectors, and orders.

These endpoints power the Tokeflow Dashboard UI. 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-merchant-id header identifying the merchant in context, and the signed-in user must be a member with access to it.

The merchant object

Returned by the list and retrieve endpoints on this page.

FieldTypeDescription
idstring
organization_idstring
organizationobject
namestring
slugstring
external_referencestring | null
business_registration_numberstring | null
mccstring | null
phone_numberstring | null
address_line1string | null
address_line2string | null
citystring | null
statestring | null
postal_codestring | null
country_codestring | null
websitestring | null
statusstring
created_atstring(ISO 8601 UTC).
updated_atstring(ISO 8601 UTC).
webhook_configsarray
membershipsarray
customersarray

Endpoints

GET/api/v1/merchant/profile

Merchant

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

Get merchant profile.

Example request

curl https://api.tokeflow.com/api/v1/merchant/profile \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-merchant-id: mrc_8a3f12d9"

Example response200

{
  "id": "obj_1a2b3c4d",
  "organization_id": "org_4b21e7c3",
  "organization": {
    "id": "obj_1a2b3c4d",
    "name": "Acme Store",
    "slug": "acme-store",
    "status": "active",
    "business_registration_number": "string",
    "mcc": "string",
    "country_code": "BR",
    "external_reference": "string",
    "phone_number": "+5511987654321",
    "address_line1": "string",
    "address_line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "created_at": "2026-01-15T12:30:00.000Z",
    "updated_at": "2026-01-15T12:30:00.000Z",
    "memberships": [
      {
        "id": "obj_1a2b3c4d",
        "organization_id": "org_4b21e7c3",
        "user_id": "string",
        "role": "owner",
        "created_at": "2026-01-15T12:30:00.000Z",
        "updated_at": "2026-01-15T12:30:00.000Z",
        "organization": {},
        "user": {
          "id": "obj_1a2b3c4d",
          "email": "jane@example.com",
          "name": "Acme Store",
          "auth_provider": "string",
          "auth_subject_id": "string",
          "password_hash": "string",
          "last_login_at": "2026-01-15T12:30:00.000Z",
          "must_change_password": true,
          "refresh_token_hash": "string",
          "failed_login_attempts": 1,
          "locked_until": "2026-01-15T12:30:00.000Z",
          "created_at": "2026-01-15T12:30:00.000Z",
          "updated_at": "2026-01-15T12:30:00.000Z",
          "memberships": [
            {}
          ]
        }
      }
    ],
    "merchants": [
      {}
    ],
    "branding": {
      "id": "obj_1a2b3c4d",
      "organization_id": "org_4b21e7c3",
      "organization": {},
      "custom_url": "https://example.com/webhooks/tokeflow",
      "site_title": "string",
      "favicon": "string",
      "logo_light_mode": "string",
      "logo_dark_mode": "string",
      "collapsible_logo_light_mode": "string",
      "collapsible_logo_dark_mode": "string",
      "theme_primary_color": "#1c1c1c",
      "theme_secondary_color": "#1c1c1c",
      "show_name_with_logo": true,
      "created_at": "2026-01-15T12:30:00.000Z",
      "updated_at": "2026-01-15T12:30:00.000Z"
    }
  },
  "name": "Acme Store",
  "slug": "acme-store",
  "external_reference": "string",
  "business_registration_number": "string",
  "mcc": "string",
  "phone_number": "+5511987654321",
  "address_line1": "string",
  "address_line2": "string",
  "city": "string",
  "state": "string",
  "postal_code": "string",
  "country_code": "BR",
  "website": "string",
  "status": "active",
  "created_at": "2026-01-15T12:30:00.000Z",
  "updated_at": "2026-01-15T12:30:00.000Z",
  "webhook_configs": [
    {
      "id": "obj_1a2b3c4d",
      "merchant_id": "mrc_8a3f12d9",
      "merchant": {},
      "url": "https://example.com/webhooks/tokeflow",
      "secret": {},
      "description": "Human-readable description",
      "event_filter": [
        "transaction.created"
      ],
      "is_active": true,
      "created_at": "2026-01-15T12:30:00.000Z",
      "updated_at": "2026-01-15T12:30:00.000Z",
      "deleted_at": "2026-01-15T12:30:00.000Z"
    }
  ],
  "memberships": [
    {
      "id": "obj_1a2b3c4d",
      "merchant_id": "mrc_8a3f12d9",
      "user_id": "string",
      "role": "owner",
      "created_at": "2026-01-15T12:30:00.000Z",
      "updated_at": "2026-01-15T12:30:00.000Z",
      "merchant": {},
      "user": {
        "id": "obj_1a2b3c4d",
        "organization_id": "org_4b21e7c3",
        "email": "jane@example.com",
        "name": "Acme Store",
        "auth_provider": "string",
        "auth_subject_id": "string",
        "password_hash": "string",
        "invitation_token": "string",
        "invitation_expires_at": "2026-01-15T12:30:00.000Z",
        "is_active": true,
        "last_login_at": "2026-01-15T12:30:00.000Z",
        "must_change_password": true,
        "refresh_token_hash": "string",
        "failed_login_attempts": 1,
        "locked_until": "2026-01-15T12:30:00.000Z",
        "created_at": "2026-01-15T12:30:00.000Z",
        "updated_at": "2026-01-15T12:30:00.000Z",
        "organization": {
          "id": "obj_1a2b3c4d",
          "name": "Acme Store",
          "slug": "acme-store",
          "status": "active",
          "business_registration_number": "string",
          "mcc": "string",
          "country_code": "BR",
          "external_reference": "string",
          "phone_number": "+5511987654321",
          "address_line1": "string",
          "address_line2": "string",
          "city": "string",
          "state": "string",
          "postal_code": "string",
          "created_at": "2026-01-15T12:30:00.000Z",
          "updated_at": "2026-01-15T12:30:00.000Z",
          "memberships": [
            {}
          ],
          "merchants": [
            {}
          ],
          "branding": {}
        },
        "memberships": [
          {}
        ]
      }
    }
  ],
  "customers": [
    {
      "id": "obj_1a2b3c4d",
      "merchant_id": "mrc_8a3f12d9",
      "merchant": {},
      "email": "jane@example.com",
      "name": "Acme Store",
      "phone": "+5511987654321",
      "document_type": "12345678909",
      "document_number": "12345678909",
      "metadata": {},
      "billing_address": {},
      "created_at": "2026-01-15T12:30:00.000Z",
      "updated_at": "2026-01-15T12:30:00.000Z",
      "deleted_at": "2026-01-15T12:30:00.000Z"
    }
  ]
}

PATCH/api/v1/merchant/profile

Merchant

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

Once the merchant is enrolled for network tokens, the fields sent at enrollment (name, website, mcc and the address) are fixed at the card networks and can no longer be changed — attempting to returns 409.

Request fields

FieldTypeRequiredDescription
namestringNo
business_registration_numberstringNo
mccstringNo
country_codestringNo
phone_numberstringNo
address_line1stringNo
address_line2stringNo
citystringNo
statestringNoISO 3166-2 subdivision code without the country prefix ("SP", not "BR-SP"). Checked against country_code when both are sent.
postal_codestringNo
websitestringNo

Example request

curl -X PATCH https://api.tokeflow.com/api/v1/merchant/profile \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-merchant-id: mrc_8a3f12d9" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John's Store",
    "business_registration_number": "12345678000199",
    "mcc": "5732",
    "country_code": "BR",
    "phone_number": "+55 11 99999-0000",
    "address_line1": "Av Paulista, 1000",
    "address_line2": "Apt 10",
    "city": "S\u00e3o Paulo",
    "state": "SP",
    "postal_code": "01310-100",
    "website": "https://johnsstore.com.br"
  }'

Example response200

{}

POST/api/v1/merchant/team/invitations

Merchant

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

Provisions a merchant_users row scoped to this organization (or reuses an existing one) and attaches a membership for this merchant. Sends an invitation email so the recipient can set a password.

Request fields

FieldTypeRequiredDescription
emailstringYes
rolestringYesOne of owner, admin, viewer.

Example request

curl -X POST https://api.tokeflow.com/api/v1/merchant/team/invitations \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-merchant-id: mrc_8a3f12d9" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@example.com",
    "role": "owner"
  }'

Example response201

{}

GET/api/v1/merchant/team/members

Merchant

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

List team members.

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/merchant/team/members \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-merchant-id: mrc_8a3f12d9" \
  --data-urlencode "page=1" \
  --data-urlencode "limit=20"

DELETE/api/v1/merchant/team/members/:id

Merchant

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

Remove team member.

Path parameters

FieldTypeRequiredDescription
idstringYes

Example request

curl -X DELETE https://api.tokeflow.com/api/v1/merchant/team/members/obj_1a2b3c4d \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-merchant-id: mrc_8a3f12d9"

PATCH/api/v1/merchant/team/members/:id

Merchant

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

Update team member role.

Path parameters

FieldTypeRequiredDescription
idstringYes

Request fields

FieldTypeRequiredDescription
rolestringYesOne of owner, admin, viewer.

Example request

curl -X PATCH https://api.tokeflow.com/api/v1/merchant/team/members/obj_1a2b3c4d \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-merchant-id: mrc_8a3f12d9" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "owner"
  }'

POST/api/v1/merchant/team/members/:id/resend

Merchant

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

Resend a pending team invitation.

Path parameters

FieldTypeRequiredDescription
idstringYes

Example request

curl -X POST https://api.tokeflow.com/api/v1/merchant/team/members/obj_1a2b3c4d/resend \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-merchant-id: mrc_8a3f12d9"

Example response200

{
  "membership_id": "mem_7b2f9c14",
  "user_id": "string",
  "email": "jane@example.com",
  "name": "Acme Store",
  "role": "owner",
  "joined_at": "2026-01-15T12:30:00.000Z",
  "status": "active",
  "invitation_expires_at": "2026-01-15T12:30:00.000Z"
}

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.
404The record does not exist or is not visible to this entity.

On this page