Get merchant API

Get merchant API is an API call that can be used to search merchants within the system based on various criteria. This API provides several parameters to filter data and perform pagination.


Request Header

FieldTypeAttributeDescription
AuthorizationStringMandatoryBasic Base64Encode(partnerServerKey:)
X-PARTNER-IDStringMandatoryUnique identifier for partner. Provided by Midtrans.

Request Params

FieldTypeAttributeDescription
pageIntOptionalMaximum number of data returned in one pagination. Default: 1
per_pageIntOptionalCurrent page number Default: 10
keywordStringOptionalQuery search by merchant ID or merchant name

Example

GET api/v1/merchants?page=1&per_page=10

Authorization: Basic cGFydG5lci1hcGkta2V5Og==
X-PARTNER-ID: 82150823919040624621823174737537

Response

Body
FieldTypeDescription
status_codeStringMerchant identifier that is unique per each merchant
status_messageStringThe name of the merchant
merchantsArrayList of merchants
[].merchant_idStringMerchant identifier that is unique per each merchant
[].merchant_nameStringThe name of the merchant
[].merchant_phone_numberStringThe phone number of the merchant without country code
[].emailStringThe email of the merchant registered with Midtrans.
Successful Response
{
  "status_code": "200",
  "status_message": "Merchants have been successfully retrieved.",
  "merchants": [
    {
      "merchant_id": "M123456",
      "merchant_name": "HQ Midtrans Merchant",
      "merchant_phone_number": "81211111111",
      "email": "[email protected]"
    }
  ]
}
Error Response 200 Data doesn’t exist
{
  "status_code": "200",
  "status_message": "Merchants have been successfully retrieved.",
  "merchants": []
}
Error Response 401
{
    "status_code": "401",
    "status_message": "Partner is unauthorized"
}
Error Response 500
{
  "status_code": "500",
  "status_message": "Internal Server Error"
}