Create merchant API

Create merchant API is an API call that can be used to register a new merchant under a Partner

Request Header

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

Request Body

FieldTypeAttributeDescription
emailStringMandatoryEmail to be registered as Midtrans merchant
merchant_nameStringMandatoryName of the merchant.
callback_urlStringOptionalMerchant’s endpoint URL where Midtrans sends a response after completing a particular request.
notification_urlStringOptionalMerchant’s endpoint URL where Midtrans’ Payment Gateway sends HTTP callbacks for payment success or failure events. This is only for payment notifications and does not apply to disbursement or transfer. For disbursement notifications, see Disbursement HTTP Notification setup
pay_account_urlStringOptionalMerchant’s endpoint URL where Midtrans' notification engine will send HTTP notification related with pay account (linking & unlinking).
owner_nameStringOptionalThe name of the merchant’s owner.
phone_numberStringOptionalThe phone number of the merchant without country code
mccStringMandatoryPass the expected value as specified here Possible values of industry category - Partner Onboarding API.
entity_typestringOptionalPass either ‘individual’ or ‘corporate’ as the values.
business_nameStringOptionalThe name of the legal entity representing said merchant.

Example

POST api/v1/merchants

Authorization: Basic cGFydG5lci1hcGkta2V5Og==
X-PARTNER-ID: 82150823919040624621823174737537
{
  "email": "[email protected]",
  "merchant_name": "HQ Midtrans Merchant",
  "callback_url": "https://merchant.com/midtrans-callback",
  "notification_url": "https://merchant.com/midtrans-notification",
  "pay_account_url": "https://merchant.com/pay-account-notification",
  "owner_name": "Owner Midtrans",
  "phone_number": "81211111111",
  "mcc": "Event",
  "entity_type": "corporate",
  "business_name": "PT Business Name"
}

Response

Header
FieldTypeDescription
x-rate-limit-limitStringMaximum number of requests that can be sent in the current period of time
x-rate-limit-remainingStringRemaining number of requests that can be sent in the current period of time
x-rate-limit-resetStringRate limit reset time (in Unix epoch seconds)
x-rate-limit-retry-after-secondsStringNumber of seconds until the next rate limit reset
Body
FieldTypeDescription
status_codeStringStatus code
status_messageStringStatus message
error_messagesString[]Error messages
merchant_idStringMerchant identifier that is unique per each merchant
merchant_nameStringThe name of the merchant
phone_numberStringThe phone number of the merchant without country code
callback_urlStringMerchant’s endpoint URL where Midtrans sends a response after completing a particular request.
notification_urlStringMerchant’s endpoint URL where Midtrans’ notification engine will send a success or failure HTTP notification.
pay_account_urlStringMerchant’s endpoint URL where Midtrans' notification engine will send HTTP notification related with pay account (linking & unlinking).
mccStringPass the expected value as specified here Possible values of industry category - Partner Onboarding API .
entity_typeStringPass either ‘individual’ or ‘corporate’ as the values.
business_nameStringThe name of the legal entity representing said merchant.

Successful Response
{
  "status_code": "200",
  "status_message": "Merchants have been successfully created.",
  "merchant_id": "M123456",
  "merchant_name": "HQ Midtrans Merchant",
  "phone_number": "81211111111",
  "callback_url": "https://merchant.com/midtrans-callback",
  "notification_url": "https://merchant.com/midtrans-notification",
  "pay_account_url": "https://merchant.com/pay-account-notification",
  "owner_name": "Owner Midtrans",
  "mcc": "Event",
  "entity_type": "corporate",
  "business_name": "business name"
}
Error Response 400
{
  "error_messages": [   
      "merchant_name cannot be empty",
      "email cannot be empty",
  ]
}
Error Response 401
{
    "status_code": "401",
    "status_message": "Partner is unauthorized"
}
Error Response 500
{
  "status_code": "500",
  "status_message": "Internal Server Error"
}