Skip to main content

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

HeaderDescription
Content-Typeapplication/json
X-Atlas-SignatureHMAC SHA-256 signature and timestamp for message authentication
X-Atlas-Delivery-IdUnique UUID tracking this webhook delivery attempt

Payload Schema

Payload Fields

FieldTypeDescription
idintegerUnique payment transaction ID.
amountstringTransfer amount.
referencestringUnique tracking reference.
statestringLifecycle state ("archived").
currencystringCurrency code.
typestringTransaction type ("wallet_to_account").
walletIdintegerOriginating wallet ID.
createdDatestringTimestamp when requested.
archivedDatestringTimestamp when marked as archived.
archiveReasonstringCause of failure (e.g. "Beneficiary account invalid").
accountobjectTarget 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: