Test Data
You can test the payment using this information:
Visa / MasterCard
- 4508 7500 1574 1019
- 2223 0000 0000 0007
- 5453 0100 0000 9553
- 5123 4500 0000 0008
You should try this number first, as it is the most reliable for testing.
Visa / MasterCard (Card Payments)
-
CVC/CVV: Required
- You can use any valid 3-digit value (e.g.,
123)
- You can use any valid 3-digit value (e.g.,
-
Expiry Date:
- Any future date,
year 39(e.g.,12/39)
- Any future date,
-
Cardholder Name:
- Any valid name
Bank Transfer (Sandbox only)
Simulates a bank transfer arriving into virtual IBAN issued for a contract, so you can test the full bank transfer flow without moving real money.
Sandbox only
This endpoint is available in the sandbox environment only. It returns 404 in production.
Endpoint
POST {{BaseUrl}}/apps/api/anb-escrow/test/simulate-payment
Headers
- Authorization: Bearer
{access_token}— the same token used for the contracts API - Content-Type: application/json
Request Body
{
"externalContractId": "CNT-2609-00100021",
"amount": 1057.5,
"currency": "SAR",
"debitAccount": "0108057386290014",
"channel": "SARIE",
"orderingParty": "User name"
}
| Field | Type | Description |
|---|---|---|
| externalContractId | string | The contract to fund. WePay resolves the account to credit |
| creditAccount | string | The account to credit. Optional when externalContractId is given |
| amount | number | Amount to transfer |
| currency | string | Always SAR |
| debitAccount | string | Funded sandbox source account |
| channel | string | Transfer channel |
| orderingParty | string | Ordering party for the transfer |
Test Account Details
Pending sandbox values
The values below are placeholders and will be published once confirmed.
| Field | Test Value | Notes |
|---|---|---|
debitAccount | 0108057386290014 | Funded sandbox source account |
channel | SARIE | Accepted channel value |
orderingParty | User name | Accepted ordering party value |
currency | SAR | Confirmed |
Response
{
"data": {
"paymentId": "2966020",
"sequenceNumber": "4734099856",
"transactionReferenceNumber": "2286540023649853647",
"creditAccount": "0108057386290014",
"debitAccount": "0108057386290014",
"channel": "SARIE",
"amount": 1057.5,
"status": "Processed",
"failureReason": null,
"externalContractId": "CNT-2609-00100021"
},
"message": "",
"status": 200,
"validationErrors": []
}
What to expect
- Create a contract and open the checkout page.
- Select Bank Transfer to have account details issued. You will receive the
bank_transfer.initiatedwebhook. - Call
simulate-paymentwith the contract ID and the expected amount. - Once the simulated transfer is delivered, the events you receive depend on the amount you send:
Exact amount:
payment.completed. The contract moves to Escrow. More than the amount due:contract.payment.overpaidandpayment.completed. The contract moves to Escrow, and a refund request is created automatically for the excess. Less than the amount due:contract.payment.underpaid. The contract stays unpaid, and a refund request is created automatically for the amount received. Send a second transfer for the remaining balance to receiverefund_request.cancelledandpayment.completed. For milestone contracts you receive themilestone.payment.completed, and the milestone status moves to Escrow.
To test mismatch handling, send an amount lower or higher than the expected total and watch for contract.payment.underpaid or contract.payment.overpaid.
See Bank Transfer Events for the full webhook sequence.