Update Notification API

Update merchant notification API is an API call that can be used to update the notification URL for a particular merchant under a Partner

Request Header

FieldTypeDescription
AuthorizationStringBasic Base64Encode(partnerServerKey:)
X-PARTNER-IDStringUnique identifier for partner. Provided by Midtrans.
X-MERCHANT-IDStringUnique identifier for merchant. Provided by Midtrans.

Request Body

FieldTypeAttributeDescription
payment_notification_urlStringOptionalNotification URL for successful, failed, and more payment statuses.
iris_notification_urlStringOptionalNotification URL for payout and top up notifications
recurring_notification_urlStringOptionalNotification URL for successful/failed recurring payment.
pay_account_notification_urlStringOptionalNotification URL for successful/failed GoPay account linking
finish_payment_redirect_urlStringOptionalRedirect URL on payment completion

Example

PATCH /api/v1/merchants/notifications

Authorization: Basic cGFydG5lci1hcGkta2V5Og==
X-PARTNER-ID: 82150823919040624621823174737537
X-MERCHANT-ID: 77788612106050785053951792116179
{
  "payment_notification_url": "https://merchant.com/midtrans-payment-notification",
  "iris_notification_url": "https://merchant.com/midtrans-payout-notification",
  "recurring_notification_url": "https://merchant.com/midtrans-recurring-notification",
  "pay_account_notification_url": "https://merchant.com/midtrans-pay-account-notification",
  "finish_payment_redirect_url": "https://merchant.com/midtrans-finish-payment-redirect"
}

Response

Body
FieldTypeDescription
status_codeStringStatus code
status_messageStringStatus message
error_messageStringError message
errorsStringErrors
error_messagesString[]Error messages for partial success response
payment_notification_urlStringNotification URL for successful, failed, and more payment statuses.
iris_notification_urlStringNotification URL for payout and top up notifications
recurring_notification_urlStringNotification URL for successful/failed recurring payment.
pay_account_notification_urlStringNotification URL for successful/failed GoPay account linking
finish_payment_redirect_urlStringRedirect URL on payment completion
Successful Response
{
  "status_code": "200",
  "status_message": "Success",
  "payment_notification_url": "https://merchant.com/midtrans-payment-notification",
  "iris_notification_url": "https://merchant.com/midtrans-payout-notification",
  "recurring_notification_url": "https://merchant.com/midtrans-recurring-notification",
  "pay_account_notification_url": "https://merchant.com/midtrans-pay-account-notification",
  "finish_payment_redirect_url": "https://merchant.com/midtrans-finish-payment-redirect"
}
Partial Success Response

In this case only iris_notification_url has failed to be updated due to internal server error. It can be safely retried independently of the other 3 URLs.

{
  "status_code": "200",
  "status_message": "Partial Success",
  "payment_notification_url": "https://merchant.com/midtrans-payment-notification",
  "recurring_notification_url": "https://merchant.com/midtrans-recurring-notification",
  "pay_account_notification_url": "https://merchant.com/midtrans-pay-account-notification",
  "finish_payment_redirect_url": "https://merchant.com/midtrans-finish-payment-redirect",
  "error_messages": [
      "iris_notification_url: Internal server error"
  ]
}
Error Response 401
{
    "status_code": "401",
    "status_message": "Partner is unauthorized"
}
Error Response 500
{
    "error_message": "Internal server error",
    "errors": "Internal server error"
}