Cardholders and Cards
Invite cardholders, issue cards funded by the Master Account, deliver card data through your app, and book card spend per corporation.
Before You Start
Read the following guides before proceeding:
| Guide | Why |
|---|---|
| Overview | Understand Master Account mode |
| Card Authorization API | How card transaction authorization works |
| Issuing a Card | Standard card issuance flow |
Cardholders
In Master Account mode an employee is a cardholder record: the personal data a card is issued for. Invite
each cardholder with the owner's corporation token.
POST /api/v1/employees/invite
Request
{
"first_name": "Alex",
"last_name": "Grey",
"email": "[email protected]",
"phone": "+15551234567"
}phoneis required. Without it the invite is refused with400 ErrorGeneral,
error_detailsphone=Phone number is required. The format rule is unchanged — see
Employees.role_idis ignored. Leave it out. If you send it, every invitee still gets the Viewer role. A
value that is not a UUID is refused.
The other fields and their validation are as in Employees.
Response
{
"employee_id": "3c5e7a9b-1d2f-4a6c-8e0b-5f7a9c1e3d5b"
}| Field | Type | Description |
|---|---|---|
employee_id | string (UUID) | Id of the invited cardholder. Send it as employee_id when issuing a card for them |
What Cardholders Cannot Do
- Cardholders never log in. A login with a cardholder's wallet and email is refused with
401 ErrorGeneralandOnly the corporation owner can log in. Everything a cardholder needs reaches
them through your app. - Role management is unavailable.
PUT /api/v1/employees/{employeeId}/roleand the role routes are
refused — see Unsupported Features and Errors.
Removing a Cardholder
DELETE /api/v1/employees/{employeeId} works as in Employees.
Deleting an employee does not close their cards. Close their cards first — the
Closeaction in
each card'sallowed_actions— then delete the record.
Issuing Cards
Issue cards with the v2 or v3 routes and the cardholder's employee_id. The flows are those in
Issuing a Card.
| Step | Route | Master Account behaviour |
|---|---|---|
| Fee invoice, when fees are enforced | POST /api/v2/cards/{type}/fees/{country}/payment | The fee is charged to the Master Account |
| Issue a virtual card | POST /api/v2/cards/virtual or POST /api/v3/cards/virtual | The card is funded by the Master Account |
| Issue a plastic card | POST /api/v2/cards/plastic or POST /api/v3/cards/plastic | The card is funded by the Master Account |
When fees are enforced, create the invoice with POST /api/v2/cards/{type}/fees/{country}/payment first
and pass its delivery_id at issuance. For v3, an invoice is needed only when the order is priced above
zero — see Issuing a Card.
- The v1 routes are refused.
POST /api/v1/cards/virtual,POST /api/v1/cards/plasticand
POST /api/v1/cards/{type}/fees/{country}/paymentreturn400 ErrorNotSupported. card_wallet_addressis the Master Account. It is returned onGET /api/v1/cards,
GET /api/v3/cardsandGET /api/v3/cards/{cardId}for cards issued in this mode.- The name on the card comes from the cardholder record. For a card issued with a linked
employee_id, the printed name is the employee's first and last name, cut at 21 characters. This
replaces the 25-character limit described on Issuing a Card and
Employees.
Card management — block, unblock, close, limits — is unchanged. See
Issuing a Card and Card Details.
Card Data
Cardholders have no session, so your app delivers PIN, CVV, PAN and 3DS challenges to them. Every call
below is made with the owner's corporation token.
PAN, CVV and PIN
Each read needs an action token for action_type GetCardDetails, signed by the owner wallet — the
X-User-Wallet you sent at creation and login, which is the token's employee_address. You hold its key.
Owner wallet signs the sentence → POST /api/v1/confirmation/signature/verify → action token
Action token (GetCardDetails) → POST /api/v1/cards/{cardId}/details | /cvv | /pin
-
Sign the sentence with the owner wallet:
By signing this I confirm that I am executing action GetCardDetails at <nonce><nonce>is the current Unix time in seconds. It is accepted for 120 seconds. -
Exchange the signature at
POST /api/v1/confirmation/signature/verifywithaction_type,
message_signatureandnonce. The responsetokenis the action token, valid for 5 minutes. -
Call
POST /api/v1/cards/{cardId}/details,/cvvor/pinwithaction_tokenin the body. The card
must beActive.
The sentence, the encoding and the errors are described in
Action Confirmation Signatures and
Wallet Signatures. The read endpoints and their responses are in
Card Details.
PAN, CVV and PIN cross your systems in clear text. Do not log, cache or persist them. Pass them to the
cardholder through your app.
3DS Challenges
- A challenge is delivered to
POST {your_webhook_base_url}/v2/webhooks/3ds. Poll
GET /api/v1/cards/3ds/requestsas well — the webhook is not retried. - Present the challenge to the cardholder in your app. Use
card_idto find the cardholder. - Send the cardholder's decision with
POST /api/v1/cards/3ds/requests/{transactionId}/approveor
/decline.
See 3DS Authentication.
Transaction Settlement
The difference from the standard flow is in how card transactions are authorized and settled:
| Aspect | Standard Flow | Master Account Mode |
|---|---|---|
| Balance check | The corporation wallet | The Master Account against its threshold, then your authorization API |
| Settlement source | The corporation wallet | The Master Account |
| Per-corporation balance | On-chain, in the corporation wallet | Your ledger |
Standard Flow
1. Cardholder pays with card
2. Wirex checks the corporation wallet balance
3. Transaction settles from the corporation wallet
4. Webhook sent
Master Account Flow
1. Cardholder pays with card
2. Wirex checks the Master Account against the threshold plus the amount
3. Wirex calls your authorize endpoint
4. You check the corporation's balance in your ledger
5. On settlement, Wirex debits the Master Account and calls your settle endpoint
6. Webhook sent
7. You book the movement against the corporation in your ledger
The endpoints are described in Card Authorization API.
Transaction Flow Diagram
sequenceDiagram
participant Cardholder
participant Merchant
participant Wirex
participant Master as Master Account
participant Partner as Your System
Cardholder->>Merchant: Pay with card
Merchant->>Wirex: Authorization request
Wirex->>Master: Check balance against threshold + amount
Wirex->>Partner: POST .../external/authorize
Partner->>Partner: Check corporation balance
Partner-->>Wirex: { is_allowed: true }
Wirex-->>Merchant: Approved
Merchant->>Wirex: Settlement
par
Wirex->>Master: Debit Master Account
and
Wirex->>Partner: POST .../external/settle
end
Wirex->>Partner: Activities webhook
Partner->>Partner: Book against the corporation
Webhooks and Booking
Book card operations per corporation from the activities webhook.
Endpoint: POST {your_webhook_base_url}/v2/webhooks/activities
Every corporation delivers to the same webhook base URL. The payload is the shared activity shape
documented in the retail Webhooks guide. For a corporation, user_address carries
the corporation address — the corporation_address returned by POST /api/v1/corporations. Route each
delivery by user_address, and verify the signature first, as described in
Webhooks.
| Field | Description |
|---|---|
user_address | The corporation address of the corporation the activity belongs to |
type | CardTransaction for a payment on a card |
status | Pending, Completed or Failed. A fully refunded card payment reads Failed |
source.card.id | The card used — map it to the cardholder yourself |
operations[].operation_id | One ledger movement — the unique_operation_id of the authorization request |
operations[].status | Status of the movement. Book it once it is Completed |
operations[].transaction_amount | The movement in the transaction currency. Negative for a debit |
Activity types, statuses and amount shapes are described in
Activity History. Activity History reads carry corporation_address
instead, and their operations have no operation_id or status, so book from the webhook.
Handling Webhooks
Book each Completed operation once, keyed by operation_id. A refund or reversal arrives as a new
operation on an activity you already processed. Because operation_id is the unique_operation_id your
settle endpoint received, the same key also stops you booking a movement twice when you have already
booked it on settle.
app.post('/v2/webhooks/activities', async (req, res) => {
// Verify X-Webhook-Signature (HMAC over X-Webhook-Timestamp + "." + raw body) first — see Webhooks
const activity = req.body;
if (activity.type !== 'CardTransaction') return res.sendStatus(200);
for (const operation of activity.operations ?? []) {
if (operation.status !== 'Completed' || !operation.transaction_amount) continue;
if (await ledger.isBooked(operation.operation_id)) continue;
// negative amount debits the corporation, positive credits it
await ledger.book(activity.user_address, operation.operation_id,
operation.transaction_amount.amount_precise, operation.transaction_amount.currency);
}
res.sendStatus(200);
});@app.post("/v2/webhooks/activities")
async def handle_activity_webhook(request: Request):
# Verify X-Webhook-Signature (HMAC over X-Webhook-Timestamp + "." + raw body) first — see Webhooks
activity = await request.json()
if activity["type"] != "CardTransaction":
return Response(status_code=200)
for operation in activity.get("operations", []):
if operation.get("status") != "Completed" or "transaction_amount" not in operation:
continue
if await ledger.is_booked(operation["operation_id"]):
continue
# negative amount debits the corporation, positive credits it
await ledger.book(
activity["user_address"],
operation["operation_id"],
operation["transaction_amount"]["amount_precise"],
operation["transaction_amount"]["currency"],
)
return Response(status_code=200)func handleActivityWebhook(w http.ResponseWriter, r *http.Request) {
// Verify X-Webhook-Signature (HMAC over X-Webhook-Timestamp + "." + raw body) first — see Webhooks
var activity ActivityItem
json.NewDecoder(r.Body).Decode(&activity)
if activity.Type == "CardTransaction" {
for _, operation := range activity.Operations {
if operation.Status != "Completed" || operation.TransactionAmount == nil {
continue
}
if ledger.IsBooked(operation.OperationId) {
continue
}
// negative amount debits the corporation, positive credits it
ledger.Book(activity.UserAddress, operation.OperationId,
operation.TransactionAmount.AmountPrecise, operation.TransactionAmount.Currency)
}
}
w.WriteHeader(http.StatusOK)
}The authorize and settle calls identify the corporation by user_id, which is the corporation_id. The
webhook identifies it by user_address, which holds the corporation_address. Keep both values from the
create response.
Balance Reconciliation
Your ledger is the source of truth for each corporation's balance. Wirex tracks only the pooled Master
Account balance.
Reconciliation approach:
- Track every authorization you approve, by
unique_operation_id - Match it against the operations received on the activities webhook
- Record direct Master Account top-ups yourself — they produce no activity
- Compare the Master Account balance with the sum of your corporations' ledger balances, plus the
top-ups and the movements not yet booked
Discrepancies may occur when:
- Mandatory transactions are processed without your approval
- A network timeout declined a transaction on your side that the network still completed
- Chargebacks or reversals arrive
- Card fees, bank transfers, OCT and FX debit the Master Account without calling your authorization API
Statement balances are pooled. Statements list a corporation's own
transactions, but the opening and closing balances derive from the resulting balances of the shared
Master Account. They are not the corporation's balance. Use your ledger for that.
Use unique_operation_id for idempotent authorization handling, and operations[].operation_id for
booking settled movements from the activities webhook.
FAQ
Q: What if the Master Account balance is too low for a card transaction?
A: Wirex declines the authorization without calling your authorize endpoint when the Master Account
balance is below the threshold plus the amount. Monitor the Master Account and keep a margin.
Q: How do refunds work?
A: Refunds are mandatory Credit transactions. The Master Account receives the credit, and the
activities webhook carries a new operation you book to the corporation.
Q: Can a cardholder see their own cards?
A: Not through the API — cardholders cannot log in. The owner's corporation token sees every card of the
corporation. Show each cardholder their cards in your app.
Q: Can I query transaction history?
A: Use Activity History with the owner's corporation token. Activity is
per corporation, even though the money moves on the Master Account.
Updated 8 days ago

