Build payments into your product with TPE virtual. Start integrating →
Logo

API reference

Base URL, authentication, conventions, and the external API resources.

The MyTPE external API is a REST API over HTTPS. It uses resource-oriented URLs, returns JSON, and authenticates with an API key and secret pair.

Base URLhttps://api.mytpe.app/api/ext
Local developmenthttp://localhost:8010/api/ext
AuthenticationX-Api-Key and X-Api-Secret headers. See Authentication.
WorkspaceOptional X-Workspace-Id header. Defaults to your earliest live workspace.
FormatJSON request and response bodies. Uploads use multipart/form-data.
IdentifiersUUID strings
MoneyDecimal strings, such as "4500.00", in DZD unless noted. Wallet amounts are centimes.

Conventions

  • Responses wrap a single resource in a data object. Lists are paginated with links and meta. See Responses.
  • Errors follow JSON:API. The top-level errors key holds an array of objects carrying status, code, title, detail, and meta. Validation messages live in meta, keyed by field. See Responses.
  • Statuses and enums for every resource are collected in Statuses and enums. Each resource page links to the statuses that apply to it.

errors is an array, not an object, and a failed request has no top-level message key. Reading response.error or response.message yields undefined for every error the API returns.

Resources

ResourceUse it to
AuthenticationManage credentials and select a workspace.
IdentificationsManage your KYC dossier.
BrandsManage customer-facing brand identities.
Bank accountsManage settlement RIBs.
Payment instancesRequest and manage virtual TPEs.
Payment linksCreate and control shareable payment URLs.
BalanceRead your balance, top it up, and transfer to users.
FormsBuild the forms collected at checkout.
WebhooksSubscribe to events.

Scope

Every endpoint is scoped to the trader that owns the API key, and to the workspace the request selects. You can read and modify only your own resources — requesting another trader's resource returns 404, not 403, so the API never reveals that the resource exists.

Within your account, what you see also depends on the workspace. Send X-Workspace-Id to choose one; omit it and the API uses your earliest live workspace.

A workspace with live mode turned off is a test workspace. Payments made there always run against the gateway's development credentials, so no real money moves — even if the underlying payment instance is configured for production. See Authentication.

On this page