// API Reference

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

Server-side only. These endpoints take an API key with the Invoices permission (Settings > API Keys) -- not an SDK session token. The key can stage charges against your vault: keep it on your server, never in a browser, mobile or desktop app.

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).

REQUESTHTTP
{
  "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

Card usage decides how an invoice is charged

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

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

Read responses wrap the object in data, like every Card Vault API answer.

Statuses

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)

STAGE A BATCHC#
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);