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
Request Parameters
| 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 |
URL Validation
- Strip any trailing
/from the submitted URL. - Append the fixed webhook path
/ainepay/notify. - Send a
GETrequest with thex-callback-tokenheader. - The merchant's system must return a successful HTTP status.
- 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 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.
Expected Test Request
GET /ainepay/notify HTTP/1.1 Host: merchant.example.com User-Agent: CallbackVerifier/1.0 x-callback-token: 3809990972772635598
Common Errors
PARAMETER_ERRORif the submitted URL is missing, malformed, or violates URL validation rules.CALL_BACK_URL_INVALIDif the verification request cannot reach your endpoint, gets a non-2xxresponse, or does not receive the samex-callback-tokenback.