Webhooks
Test Notify URL
When setting or updating the merchant notify URL in the AinePay merchant dashboard, AinePay tests the merchant's system through this endpoint, so the merchant's system must respond to it.
Endpoint
- Method:
GET - Path:
{notifyUrl}/ainepay/notify - Authentication: Requires the AinePay merchant dashboard
- Content-Type:
application/x-www-form-urlencoded
Parameters submitted in the dashboard
| parameter | type | description | required | example |
|---|---|---|---|---|
| url | string | The URL for receiving callbacks, length 10~2048. Must comply with the URL requirements below. | yes | https://merchant.example.com |
| code | string | The merchant's 6-digit two-factor (2FA/TOTP) code. Two-factor authentication must be enabled and verified to set or update the notify URL. | yes | 123456 |
URL Validation
- Strip any trailing
/from the submitted URL. - Append the fixed webhook path
/ainepay/notify. - Send a
GETrequest with thex-callback-tokenheader (redirects are not followed). - The merchant's system must return a successful HTTP status (
2xx). - The merchant's system must echo the same
x-callback-tokenvalue in the response header. - If validation passes, the URL is saved as the merchant's notify URL.
URL Requirements
- The URL must be an absolute URL.
- The scheme must be
httporhttps. - The URL cannot contain a fragment.
- In production, the URL must use
httpsand effective port443. - In production, the URL cannot contain user info and cannot use an IP literal as the host.
- In production, the host must resolve to public addresses (no private, loopback, or link-local addresses).
Expected Test Request
GET /ainepay/notify HTTP/1.1 Host: merchant.example.com User-Agent: CallbackVerifier/1.0 x-callback-token: K8sJ2mQ4nR7vT0xY3bC6dF9gH1jL5pZw
Common Errors
PARAMETER_ERRORif the submitted URL is missing, malformed, or violates URL validation rules.TOTP_NOT_ENABLEDif the merchant has not enabled two-factor authentication;TOTP_CODE_INVALIDif the code is wrong or already used.CALL_BACK_URL_INVALIDif the verification request cannot reach your endpoint, gets a non-2xxresponse, or does not receive the samex-callback-tokenback.