Register ePOS application and retrieve M2M client credentials
This API registers an ePOS application and returns M2M (machine-to-machine) client credentials. The endpoint returns OAuth client credentials based on the provided store_id and epos_external_id. The client credentials can be used to obtain M2M access tokens for subsequent API calls.
Authentication:
This endpoint requires a user JWT token (not M2M credentials). The user must have access to the specified store.
Returned Scopes:
The response includes OAuth scopes that define which APIs can be accessed with the returned M2M credentials:
- payment_requests: Required to create, list, and cancel or update payment requests.
- payment_requests/id: Required to retrieve and follow an individual payment request.
- stores/id/terminals: Required to list stores and their terminals.
- refunds: Required for refund operations
Using the Returned Credentials:
The returned client credentials are used to obtain an M2M access token via OAuth2 client credentials flow. The access token must include the scopes returned in this response to call the corresponding APIs.
Idempotency Behavior:
- The API is idempotent based on the composite key: (partner_id from JWT, store_id, epos_external_id)
- The response body structure is identical for both status codes, containing the same client credentials.
Idempotency Key: (partner_id, store_id, epos_external_id)
Request
- Base URLhttps://api.teya.com
- AuthOAuth 2Authorization codehttps://id.teya.com/oauth/v2/oauth-authorizeToken URLhttps://id.teya.com/oauth/v2/oauth-token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"store_id": "f04fe1ce-e7bd-4c5b-b873-b156643c0bc3",
"epos_external_id": "epos-app-12345"
}Response
Client credentials returned
Example response
{
"client_id": "58ab90c1-e38a-43b4-849c-c12ccfca1df1",
"client_secret": "IezZu7AA-EKi1zB3xyvt6E8BqTKyWA1bpS9PymbaL6c",
"scopes": [
"payment_requests",
"payment_requests/id",
"stores/id/terminals",
"refunds"
]
}Changes
No recorded changes to this operation across all 1 revision of this API.