Wallet to Account - Completed Webhook
Overview
The walletToAccount.completed webhook fires when an outbound payout has successfully cleared banking networks (SEPA, ACH, Faster Payments, or SWIFT) and reached the beneficiary's institution.
- Event Name:
walletToAccount.completed - Target State:
completed - HTTP Method:
POST(Sent from Atlas to your configured webhook listener URL)
Webhook Headers
| Header | Description |
|---|---|
Content-Type | application/json |
X-Atlas-Signature | HMAC SHA-256 signature and timestamp for message authentication |
X-Atlas-Delivery-Id | Unique UUID tracking this webhook delivery attempt |
Payload Schema
Payload Fields
| Field | Type | Description |
|---|---|---|
id | integer | Unique payment transaction ID. |
amount | string | Settled amount. |
reference | string | Unique tracking reference. |
state | string | Lifecycle state ("completed"). |
currency | string | Currency code. |
type | string | Transaction type ("wallet_to_account"). |
walletId | integer | Debited wallet ID. |
createdDate | string | Timestamp when requested. |
completedDate | string | Timestamp when clearing confirmed settlement. |
account | object | Beneficiary bank account record. |
Example Payload
{
"id": 10004,
"amount": "1000.00",
"reference": "REF-W2A-003",
"state": "completed",
"currency": "USD",
"type": "wallet_to_account",
"walletId": 4001,
"createdDate": "2024-01-15T12:00:00Z",
"completedDate": "2024-01-15T12:05:00Z",
"account": {
"id": 502,
"accountNumber": "87654321",
"bankName": "HSBC",
"beneficiaryFirstName": "John",
"beneficiaryLastName": "Smith",
"beneficiaryEntityType": "individual",
"currency": "USD",
"status": "active"
}
}
Expected Response
Your endpoint must respond with an HTTP 200 OK status code within 5 seconds to acknowledge delivery:
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "received"
}
Handling Example
// Express.js Webhook Handler
app.post('/api/webhooks/atlas', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.headers['x-atlas-signature'];
try {
// 1. Verify webhook signature
verifySignature(req.body, signature, process.env.ATLAS_WEBHOOK_SECRET);
const event = JSON.parse(req.body.toString());
// 2. Handle walletToAccount.completed
if (event.state === 'completed') {
console.log(`Processing Wallet to Account - Completed Webhook: Reference ${event.reference}, Amount: ${event.amount} ${event.currency}`);
// Update your internal order or ledger state
}
// 3. Acknowledge receipt
res.status(200).json({ status: 'received' });
} catch (err) {
console.error('Webhook verification failed:', err.message);
res.status(400).send('Invalid signature');
}
});
Interactive Payload Schema & Example
Review the full JSON schema and test response handling: