Get Profile

This method retrieves the phone number of the user. It returns a promise that resolves with the phone number or rejects it if there is an error.

Path/v1/mini-apps/users/profile
Hosthttps://public-mini-app-merchants.gopayapi.com
Http MethodGET

Request Headers:

PropertyData typeRequiredDescription
Debug-IdstringNoThis is an identifier that is used for debugging purposes
Request-IdstringYesThis is an identifier that is used for maintaining idempotency
AuthorizationstringYesBearer Authorization header
This is the token you would receive in the apply token API

Response:

PropertyData typeDescription
successbooleanIt will be true if API call is successful and false in case of failure
errorobjectThis object will be non-null only in case of failures
error.codestringThe error code
error.descriptionstringThe description of the error

Sample Response:

Success Response:

{
  "success": true,
  "error": {},
  "data": {
    "phone_number": "+628210072773",
    "email": "[email protected]",
    "username": "example",
  }
}

Error Response: With appropriate HTTP status codes. Only 5xx would be retriable

{
  "success": false,
  "error": {
    "code": "105",
    "description": "User not found"
  }
}

Error codes:

Error codeDescription
105User not found
303Malformed Authorization
900Unable to process

Error Codes

CodeErrorWhen
303FIELD_CANNOT_BE_BLANKMissing Authorization header
310MALFORMED_DATAMalformed auth header or malformed reward type parsing
110UNAUTHORIZEDInvalid/inactive token, missing scope, forbidden scope
5003INVALID_AUTHORISATIONAuthorization service rejects introspection
900GENERIC_SERVICE_ERRORGeneric fallback/exception
105USER_NOT_FOUNDUser service / profile not found
40001MINI_APP_NOT_FOUNDMini app lookup by merchant cross-ref fails
400001CONSENT_PROFILE_NOT_FOUNDCMS cannot find consent profile/config
400002INVALID_CONSENT_CATALOG_IDCMS consent catalog config invalid
400004USER_CONSENT_DOES_NOT_EXISTUser does not have consent record/details