Sub-merchant Creation Webhook
1. Background
After the partner confirms a sub-merchant onboarding submission, the final review result cannot be determined in the synchronous request. When the review is approved or rejected, Adopay notifies the partner of the final result through an HTTP asynchronous callback.
The partner should process notifications idempotently by subMerchantNo and createStatus. The same onboarding record may be notified more than once because of retries.
2. Callback Endpoint and Method
| Item | Value |
|---|---|
| Method | POST |
| URL | {callbackUrl} |
| Content-Type | application/json |
| Purpose | Notify the final result of sub-merchant creation |
{callbackUrl} is the sub-merchant creation result callback URL already configured for the partner. It must be a complete HTTP or HTTPS URL.
3. Request Headers
| Field | Type | Length | Required | Description |
|---|---|---|---|---|
Content-Type | string | 16 | Yes | Fixed to application/json. |
X-Merchant-Id | string | 64 | Yes | Primary merchant number that receives the notification. |
X-Timestamp | string | 19 | Yes | Unix timestamp in seconds. |
X-Nonce | string | 64 | Yes | Random string for this request, used for anti-replay. |
Digest | string | 52 | Yes | Digest of the raw request body, in the format SHA-256=<Base64(SHA256(body_bytes))>. |
Authorization | string | Variable | Yes | ES256 HTTP Signature information. |
Both Digest and Authorization are computed over the raw JSON bytes actually sent. When verifying the signature, the partner must not re-serialize the JSON first.
4. Request Body Fields
Business status: status is an integer; status = 200 means the business call succeeded, in which case msg = "sucesso". Any value other than 200 indicates a business error; see msg for the reason.
| Field | Type | Length | Always Returned | Description |
|---|---|---|---|---|
subMerchantNo | string | 64 | Yes | Sub-merchant number. May be empty when creation failed or the number has not been generated. |
subMerchantName | string | 128 | Yes | Sub-merchant name. |
createStatus | string | 16 | Yes | Creation result. See the status description below. |
errorMsg | string | 128 | No | Error message. Returned when creation failed. |
status | int | - | Yes | Response code |
msg | string | 128 | Yes | Corresponds to status |
Creation Status
createStatus | Meaning |
|---|---|
SUCCESS | The sub-merchant was created successfully. subMerchantNo should be the created sub-merchant number. |
FAILED | Sub-merchant creation failed. subMerchantNo may be empty. |
5. Request Example
POST /notify/adopay/merchant/create HTTP/1.1
Host: merchant.example.com
Content-Type: application/json
X-Merchant-Id: 92315566000120
X-Timestamp: 1786838460
X-Nonce: 4de901987ca14b25acf2639056ac6002
Digest: SHA-256=<REQUEST_BODY_SHA256_BASE64>
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<ES256_SIGNATURE_BASE64>"
{
"status": 200,
"msg": "sucesso",
"subMerchantNo": "92315566000200",
"subMerchantName": "MERCHANT DEMO LTDA",
"createStatus": "SUCCESS",
"errorMsg": ""
}6. Partner Response Requirements
After completing idempotent processing, the partner should return HTTP 200—299 with a response body of exactly the plain text SUCCESS or OK:
HTTP/1.1 200 OK
Content-Type: text/plain
SUCCESS7. Notification Scenarios and Retries
Adopay sends this callback when sub-merchant creation succeeds or fails.
After the first delivery attempt of a notification fails, Adopay retries at most 14 times, for at most 15 deliveries in total. Once the partner receives the notification successfully and returns the required success response, no further retries occur.
Whether to retry is determined jointly by the HTTP status code and the response body:
| HTTP Status Code | Response Body | Result |
|---|---|---|
200—299 | Strictly equal to SUCCESS or OK after trimming leading and trailing whitespace | Notification delivered; no more retries |
200—299 | Empty body, JSON, other text, or wrong casing | Notification failed; retry continues |
Non-2xx | Any content | Notification failed; retry continues |
| No HTTP response received | Network timeout or connection failure | Notification failed; retry continues |
SUCCESS and OK are case-sensitive. For example, success, Success, or {"status":"SUCCESS"} are not recognized as success responses. Although HTTP 204 is a 2xx status, its body is empty, so retries continue.
8. Integration Notes
- Use
createStatusto determine the creation result. When it isSUCCESS, validate and savesubMerchantNo. When it isFAILED,subMerchantNomay be empty. subMerchantNameis sensitive information and should be stored masked in logs and audit systems.