Skip to content

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 ​

ItemValue
MethodPOST
URL{callbackUrl}
Content-Typeapplication/json
PurposeNotify 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 ​

FieldTypeLengthRequiredDescription
Content-Typestring16YesFixed to application/json.
X-Merchant-Idstring64YesPrimary merchant number that receives the notification.
X-Timestampstring19YesUnix timestamp in seconds.
X-Noncestring64YesRandom string for this request, used for anti-replay.
Digeststring52YesDigest of the raw request body, in the format SHA-256=<Base64(SHA256(body_bytes))>.
AuthorizationstringVariableYesES256 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.

FieldTypeLengthAlways ReturnedDescription
subMerchantNostring64YesSub-merchant number. May be empty when creation failed or the number has not been generated.
subMerchantNamestring128YesSub-merchant name.
createStatusstring16YesCreation result. See the status description below.
errorMsgstring128NoError message. Returned when creation failed.
statusint-YesResponse code
msgstring128YesCorresponds to status

Creation Status ​

createStatusMeaning
SUCCESSThe sub-merchant was created successfully. subMerchantNo should be the created sub-merchant number.
FAILEDSub-merchant creation failed. subMerchantNo may be empty.

5. Request Example ​

http
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
HTTP/1.1 200 OK
Content-Type: text/plain

SUCCESS

7. 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 CodeResponse BodyResult
200—299Strictly equal to SUCCESS or OK after trimming leading and trailing whitespaceNotification delivered; no more retries
200—299Empty body, JSON, other text, or wrong casingNotification failed; retry continues
Non-2xxAny contentNotification failed; retry continues
No HTTP response receivedNetwork timeout or connection failureNotification 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 ​

  1. Use createStatus to determine the creation result. When it is SUCCESS, validate and save subMerchantNo. When it is FAILED, subMerchantNo may be empty.
  2. subMerchantName is sensitive information and should be stored masked in logs and audit systems.