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
| Field | Type | Description |
|---|---|---|
| Authorization | String | Basic Base64Encode(partnerServerKey:) |
| X-PARTNER-ID | String | Unique identifier for partner. Provided by Midtrans. |
| X-MERCHANT-ID | String | Unique identifier for merchant. Provided by Midtrans. |
Request Body
| Field | Type | Attribute | Description |
|---|---|---|---|
| payment_notification_url | String | Optional | Notification URL for successful, failed, and more payment statuses. |
| iris_notification_url | String | Optional | Notification URL for payout and top up notifications |
| recurring_notification_url | String | Optional | Notification URL for successful/failed recurring payment. |
| pay_account_notification_url | String | Optional | Notification URL for successful/failed GoPay account linking |
| finish_payment_redirect_url | String | Optional | Redirect 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
| Field | Type | Description |
|---|---|---|
| status_code | String | Status code |
| status_message | String | Status message |
| error_message | String | Error message |
| errors | String | Errors |
| error_messages | String[] | Error messages for partial success response |
| payment_notification_url | String | Notification URL for successful, failed, and more payment statuses. |
| iris_notification_url | String | Notification URL for payout and top up notifications |
| recurring_notification_url | String | Notification URL for successful/failed recurring payment. |
| pay_account_notification_url | String | Notification URL for successful/failed GoPay account linking |
| finish_payment_redirect_url | String | Redirect 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"
}