Reward

This method explains how merchants can disburse GoPay Saldo or GoPay Coins to users using this API. The user who receives the disbursement will be identified from the Authorization token.

📝

Note

Prior to the API call

  1. please ensure that you have an active merchant wallet, you may contact the sales team to activate the merchant wallet.
  2. In order to top up the wallet balance, please visit the midtrans portal and you may see the Virtual Account as a top up destination.
Path/v1/mini-apps/cashback
Hosthttps://public-mini-app-merchants.gopayapi.com
Http MethodPOST

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

Request Body:

PropertyData typeRequiredDescription
amountobjectYesIt will be true if API call is successful and false in case of failure
amount.valueintegerYesA positive integer representing how much to charge in the smallest currency unit
descriptionstringYesMerchant given description for this cashback, string upto 256 characters.
amount.currencystringYesThree-letter ISO 4127 currency code.smallest possible denomination Should be IDR for Indonesia.
reward_typestringYesIdentifies whether reward should be provided as emoney cashback or coins cashback

Possible values :
EMONEY
GOPAY_COINS
metadataobjectNoThe object containing the reminder details

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
dataobjectThe object containing the reminder details
data.payment_idstringThe ID of the payment for reference
data.codestringThe error code
data.descriptionstringThe description of the error

Sample Request:

{
  "amount": {
    "currency": "IDR",
    "value": 10000
  },
  "description": "Cashback for daily check-in",
  "reward_type": "GOPAY_COINS",
  "metadata": {
    "reference_id": "123"
  }
}

Sample Response:

Success Response:

{
  "success": true
  "data": {
     "payment_id": "0120250107121627eTRXfvlCZ6ID"
   }
}

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

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

Error Response: 4060. It's non-retriable error.

{
  "success": false,
  "error": {
    "code": "4060",
    "description": "Fraud validation error"
  }
}

📝

Note

Error code 4060 — Cashback feature is temporarily disabled for this user. Please inform the user that they can’t receive cashback for the time being and suggest them to reach GoPay Help page for further information.