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 URL | https://api.mytpe.app/api/ext |
| Local development | http://localhost:8010/api/ext |
| Authentication | X-Api-Key and X-Api-Secret headers. See Authentication. |
| Workspace | Optional X-Workspace-Id header. Defaults to your earliest live workspace. |
| Format | JSON request and response bodies. Uploads use multipart/form-data. |
| Identifiers | UUID strings |
| Money | Decimal strings, such as "4500.00", in DZD unless noted. Wallet amounts are centimes. |
Conventions
- Responses wrap a single resource in a
dataobject. Lists are paginated withlinksandmeta. See Responses. - Errors follow JSON:API. The top-level
errorskey holds an array of objects carryingstatus,code,title,detail, andmeta. Validation messages live inmeta, 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
| Resource | Use it to |
|---|---|
| Authentication | Manage credentials and select a workspace. |
| Identifications | Manage your KYC dossier. |
| Brands | Manage customer-facing brand identities. |
| Bank accounts | Manage settlement RIBs. |
| Payment instances | Request and manage virtual TPEs. |
| Payment links | Create and control shareable payment URLs. |
| Balance | Read your balance, top it up, and transfer to users. |
| Forms | Build the forms collected at checkout. |
| Webhooks | Subscribe 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.