Projects

Every payment resource belongs to a project — a business unit or site. Integrations should use nested URLs under /api/v1/projects/{projectId}/.

Nested URLs (recommended)

/api/v1/projects/{projectId}/ordersAlso: collection-profiles, webhooks, gateways, api-keys, assets.

How project is resolved

ContextResolution
API keyprojectId on the key record (authoritative). URL must match.
Dashboard sessionX-Project-Id header, JWT activeProjectId, or default project
Flat legacy pathsDeprecated — resolves via default project or header

Responses include project_id in data and an X-Project-Id response header when scoped.

TEST vs LIVE

Each merchant has paired TEST and LIVE projects. Use tp_test_ keys with TEST projects and tp_live_ keys with LIVE projects. Mismatch returns project_environment_mismatch.

Response headers

X-TowanPay-Environment returns TEST or LIVE. X-TowanPay-Livemode is true/false (Stripe-style).

Endpoints

GET/api/v1/projects

List projects accessible to the authenticated account.

Auth: Session or API key
GET/api/v1/projects/:projectId

Retrieve a single project.

Auth: Session or API key
POST/api/v1/projects/active

Set the dashboard active project.

Auth: Session only
POST/api/v1/projects/active-environment

Switch between TEST and LIVE project in the dashboard.

Auth: Session only