Authentication and environments

Every product and customer call goes to one of two hosts and carries an access token for the seller.

Hosts

Environment Base URL
Sandbox (testing) https://payme-store-staging.payme.io/api/
Production https://payme-store.payme.io/api/

These hosts are separate from the Payments API hosts (sandbox.payme.io, live.payme.io). Use sandbox credentials (the seller's sandbox MPL and your sandbox payme_client_key) with the sandbox host, and production credentials with the production host.

Authentication

  1. Call POST /auth-tokens with {"mpl": "<seller MPL>", "key": "<partner payme_client_key>"}. The seller must belong to the partner whose key you send. The call returns HTTP 201 with auth_token (a JWT) and refresh_token.
  2. Send Authorization: Bearer <auth_token> on every product and customer call. A missing, invalid or expired token returns HTTP 401.
  3. When the access token expires, call POST /refresh-exchanges with {"refresh_token": "<refresh_token>"}. No headers are needed. It returns a new auth_token and a new refresh_token. Each refresh token works once, so store the new one. If the refresh token has expired or was already used, start again at step 1.

Only partners can get a token: key is the partner's payme_client_key, and a seller without a partner key can't call this API. What the MPL (seller_payme_id) and the partner key are: Payments Authentication and environments.