Invoices
Submit a batch of invoices against cards in your vault. Card Vault validates each one, schedules it, notifies the card holder when needed, charges it on its charge date, retries soft declines, and reports every outcome by webhook.
How it works
- Your server sends a batch with
POST /v1/invoice-batches. Each invoice names a vault token, an amount, a currency, a payment type and a charge date -- never card data. - Card Vault checks every invoice when the batch arrives. Each is either accepted (scheduled) or rejected with a reason; one bad line never rejects the batch.
- On the charge date the invoice is charged to the card through your processors. Cards designated Recurring are charged automatically. A card with no stored credential and no CVV on record gets an approval e-mail instead: the card holder opens a Card Vault page, re-enters the CVV only, and the charge runs on submit.
- Every outcome -- accepted, rejected, paid, declined, failed, expired -- is a webhook. You can also read any batch or invoice at any time.
POST /v1/invoice-batches
Headers: Authorization: Bearer <API key> and a required
Idempotency-Key (1-100 printable ASCII characters). Repeating a request with the
same key and the same body returns the original batch (200) instead of staging it
again; the same key with a different body is refused (422 idempotency-key-reused).
{
"invoices": [
{
"externalRef": "INV-10045", // your id; unique per account, 1-64 printable ASCII
"cardToken": "<vault token>",
"amount": 149.00,
"currency": "CAD", // CAD or USD
"paymentType": "Recurring", // or "Unscheduled"
"chargeDate": "2026-11-15", // yyyy-MM-dd; today or later
"notify": true, // optional; see Notices
"description": "November membership", // optional, up to 255
"metadata": { "member": "A-118" } // optional, up to 20 keys
}
]
}
Returns 201 Created with the batch: its batchId, counts, and one
result per line -- invoiceId and Scheduled for an accepted invoice,
reason and detail for a rejected one. A body that is not a batch at
all (bad JSON, no invoices, too many invoices) is refused with 400.
Rules checked per invoice
invalid_external_ref/duplicate_external_ref-- Missing or malformed, or already used in this batch or an earlier one.invalid_payer/card_not_found-- No token, or the token is not a card in your vault.card_out_of_scope-- The key is restricted to segments and the card is not in one of them.card_not_active/card_expires_before_charge_date-- The card is not active (expired, cleared or past its storage period), or expires before the charge date.invalid_amount/amount_over_limit-- Not a positive amount with at most two decimals, or above your per-invoice limit.invalid_currency/currency_mismatch/no_processor_for_currency-- Not CAD or USD, not the card's currency, or no enabled processor of yours takes it.invalid_payment_type/invalid_notify-- Not Recurring or Unscheduled; an Unscheduled invoice cannot setnotify: false.invalid_charge_date/charge_date_in_past/charge_date_too_far-- Not yyyy-MM-dd, before today (UTC), or more than 365 days ahead.charge_date_inside_notice_lead_time-- The invoice sends a notice, and the charge date is sooner than your notice lead time allows.daily_limit_exceeded-- Charges dated that day would exceed your daily limit. Later, smaller lines in the same batch may still fit.invalid_description/invalid_metadata/invalid_line-- Description over 255 characters; metadata over 20 keys, keys not 1-40 printable ASCII, values over 500, or over 4,000 characters in total; or an empty line.
Card usage decides how an invoice is charged
- Recurring card with a stored credential -- charged automatically as a merchant-initiated transaction on the charge date.
- SingleUse card with a CVV on record that is still held on the charge date (your CVV storage setting) -- charged automatically; the CVV is then removed.
- Any other card -- the invoice takes the approval route: Card Vault e-mails the card holder a link before the charge date. The card holder enters the CVV only, and the charge runs on submit. The link stays valid until the charge date plus your approval-link grace days, allows three attempts, and sends one "due today" reminder. Unused, the invoice becomes Expired.
paymentType never decides eligibility -- the card's usage does. It sets the
stored-credential type of the charge and whether a notice is sent.
Notices
- Unscheduled invoices always send a pre-charge notice to the card holder.
- Recurring invoices send one when
notifyis true, or when it is omitted and your account's Notify on Recurring setting is on. - The notice goes out your notice lead time before the charge date, from Card Vault under your organisation's name, with replies going to you. It names the amount, card brand and last four digits, the date and your reference -- and asks for nothing.
Retries
A soft decline on a Recurring invoice is retried 1, 3 and 7 days later, then the invoice is final Declined. Hard declines, "do not retry" responses and SingleUse cards are never retried.
Other operations
GET /v1/invoice-batches/{batchId}-- the batch and every line's current status.GET /v1/invoices/{invoiceId}-- one invoice, with its charge attempts.POST /v1/invoices/{invoiceId}/void-- cancel an invoice that is still Scheduled or Due; anything later is409 invoice-not-voidable.POST /v1/invoices/{invoiceId}/reissue-- for an invoice on the approval route that is still Scheduled: sends the card holder a new link and voids the old one. Otherwise409 invoice-not-reissuable.
Read responses wrap the object in data, like every Card Vault API answer.
Statuses
Scheduled-- Accepted; waiting for its notice or charge date.Due-- The charge date has arrived; queued for charging.Processing-- A charge attempt is in flight.Review-- The processor's answer could not be confirmed; held for reconciliation, never charged twice.Paid-- Approved. Final.Declined-- Declined, after any retries. Final.Failed-- Could not be charged (for example the card left service). Final.Expired-- The approval link ran out unused. Final.Voided-- Cancelled by you. Final.
Limits and settings
Defaults: 250 invoices per batch, 10,000.00 per invoice, 50,000.00 of charges per day. You can lower any of them, set your notice lead time (shorter than your CVV storage), approval-link grace and the Recurring notice default in Settings > General > Invoices. To raise a limit, contact Card Vault. Batches and invoices are also listed in the dashboard under Invoices.
Webhooks
invoice.accepted, invoice.rejected, invoice.voided,
invoice.notice_sent, invoice.action_required,
invoice.notice_undeliverable, invoice.paid,
invoice.declined, invoice.failed, invoice.expired and
batch.completed. Payloads and signature checking:
Webhooks.
Example (C#, server side)
using var http = new HttpClient { BaseAddress = new Uri("https://api.cardvault.dev/") };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
var batch = new
{
invoices = new[]
{
new { externalRef = "INV-10045", cardToken = token, amount = 149.00m, currency = "CAD",
paymentType = "Recurring", chargeDate = "2026-11-15" }
}
};
var request = new HttpRequestMessage(HttpMethod.Post, "v1/invoice-batches")
{
Content = new StringContent(JsonSerializer.Serialize(batch), Encoding.UTF8, "application/json")
};
request.Headers.Add("Idempotency-Key", "billing-run-2026-11-15"); // reuse it on retry
var response = await http.SendAsync(request);