Wallet to Account - Archived Webhook
Overview
The walletToAccount.archived webhook fires when an outbound payout fails (e.g. beneficiary account closed, invalid routing number, compliance block) and is archived.
- Event Name:
walletToAccount.archived - Target State:
archived - 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 | Transfer amount. |
reference | string | Unique tracking reference. |
state | string | Lifecycle state ("archived"). |
currency | string | Currency code. |
type | string | Transaction type ("wallet_to_account"). |
walletId | integer | Originating wallet ID. |
createdDate | string | Timestamp when requested. |
archivedDate | string | Timestamp when marked as archived. |
archiveReason | string | Cause of failure (e.g. "Beneficiary account invalid"). |
account | object | Target account record. |
Example Payload
{
"id": 10004,
"amount": "1000.00",
"reference": "REF-W2A-003",
"state": "archived",
"currency": "USD",
"type": "wallet_to_account",
"walletId": 4001,
"createdDate": "2024-01-15T12:00:00Z",
"archivedDate": "2024-01-15T12:10:00Z",
"archiveReason": "Beneficiary account invalid",
"account": {
"id": 502,
"accountNumber": "87654321",
"bankName": "HSBC",
"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.archived
if (event.state === 'archived') {
console.log(`Processing Wallet to Account - Archived 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: