Get Temporary Access Token

Temporary Token is a token that can be used to invoke Verify with GoPay without user auth.

Description

  • This API allows Midtrans partners to exchange a user's GoPay payment linking token for a temporary token.
  • The temporary token then can be used to initiate "Verify with Gopay" flow on behalf of the user, without asking the user to re-do the authentication process (Input Phone Number, OTP challenge, and Pin challenge).
  • This is a backend-to-backend API. The caller must have a valid x-merchant-id, and must supply the user's GoPay payment linking token obtained from GoPay.

Request

AttributeValue
MethodGET
Path/forward/gopay-id/identity/v1/gopay-id/token

Request Headers

KeyTypeRequired?Description
x-merchant-idstringYESMerchant identifier issued by Gopay.
authorizationstringYESThe user's Gopay payment linking token. Do not prefix with Bearer.
request-idstringYESA unique ID for this request, used for distributed tracing. Recommended: UUID v4.

Response

HTTP Status Codes

HTTP StatusScenario
200 OKToken exchange successful.
400 Bad RequestMissing or invalid request headers, or merchant not configured.
500 Internal Server ErrorUpstream service failure during token generation or account resolution.
503 Service UnavailableA dependency is temporarily unreachable.

Success Response

FieldTypeDescription
successbooleantrue on success.
data.tokenstringBase64-encoded token. Pass this to the Gopay Enterprise SDK.

Error Responses

All error responses share the following structure:

FieldTypeDescription
successbooleanfalse on error.
errors[].codestringMachine-readable error code.
errors[].entitystringThe field or resource related to the error.
errors[].causestringHuman-readable description of what went wrong.

Error Codes

HTTP CodeCodeCause
400 - Bad Request1539Missing required header
500 - Internal Server Error900Internal Server Error