// API Reference

Card Requests

Invite a cardholder to submit their card through a secure hosted form -- by email or SMS -- and get a vaulted card profile back when they do.

How it works

POST /v1/card-requests

REQUESTHTTP
{
  "name":      "Jamie Cardholder",
  "email":     "jamie@example.com",   // email and/or sms
  "sms":       "5555550100",
  "message":   "For your March booking.",
  "segmentId": 3,                    // optional; targets a segment
  "usageId":   null,                 // optional; card usage for the vaulted card
  "ttl":       48                    // hours the link stays valid (1-255)
}

The response includes the request's id and its requestToken -- the short token embedded in the submission URL. Nothing is sent until you call dispatch; resend only re-activates an expired request, so follow it with dispatch.

GET /v1/card-requests

Lists requests for your account. Query parameters:

Other operations

Delivery checks and bounces

Before an invitation is emailed, Card Vault checks that the recipient's domain can receive mail. A domain that does not exist, publishes a null MX, or has neither a mail server nor an address record is refused instead of being sent:

Some addresses pass that check and still bounce -- a mailbox that does not exist on a real domain, a full mailbox, a receiving server's policy. Card Vault reads the bounce and marks the request Undeliverable in the account portal (Requests list and request details, with the receiving server's reason). When the request was sent from the portal, the person who sent it also receives an email saying it could not be delivered, and can resend to a corrected address from the request details. Requests dispatched with an API key have no sending user, so they are marked in the portal but no email is sent.

Fulfillment fields

A completed request carries completed (timestamp), cardId (the new card profile's reference), cardLastFour, and the card brand -- enough to link the vaulted card to your customer record without ever seeing the PAN.

Webhook notification

When a request completes, Card Vault raises the request.completed event through your standard webhook endpoints. It is not offered in the dashboard's per-event picker, so it reaches endpoints subscribed to all events. Its Data is the standard card result: the card token, CardId, brand, last four digits, BIN (first six digits), cardholder name, expiry, usage and verification result, with Ref set to the card request's reference. It never contains the full card number or CVV.

Legacy card request notification & token verification

Some card request forms also send an older, separate notification: if a Card Request webhook URL is configured on your account, Card Vault POSTs to it once when the request completes (a single attempt with a 10-second timeout -- it is not retried and does not appear in webhook delivery history). The notification carries a signed token in the Authorization header (the body is an empty JSON object); verifying that token proves the notification came from Card Vault and was not tampered with in transit. Prefer request.completed above for new integrations.

WEBHOOKHTTP
POST https://your-domain.example/card-request-webhook
Authorization: Bearer <token>
Content-Type: application/json

{}

The token is a JWT signed with HS256. Its claims describe the vaulted card. No PAN or CVV is ever included; the claims do include the cardholder name, last four digits and expiry, and the token is readable by anyone who holds it (signed, not encrypted), so treat it as sensitive and keep it out of logs:

TOKEN PAYLOADJSON
{
  "ReqTxId":    "...",               // the card request this completes
  "Token":      "...",               // the vaulted card token
  "CardId":     "...",               // not sent by every form; may be empty
  "Brand":      "Visa",
  "BrandCode":  "4",
  "LastFour":   "1111",
  "CardHolder": "JANE DOE",           // example value
  "Expiry":     "12/31/2028",         // M/d/yyyy; use month and year
  "iss":        "card-vault",        // issuer -- verify this
  "aud":        "partner-service",   // audience -- verify this
  "jti":        "...",               // unique token id
  "nbf":        1712345558,
  "iat":        1712345558,
  "exp":        1712345678             // expires ~2 minutes after issue
}

Verifying the token

  1. Get your Webhook Verification Key from the console: Settings → your Card Request interface → Webhook Verification Key. It is a 64-character hex string (one key per account).
  2. Hex-decode the key to its 32 raw bytes.
  3. Verify the JWT's HS256 signature using those 32 bytes as the HMAC key. Most JWT libraries accept the raw key bytes directly.
  4. Confirm iss is card-vault, aud is partner-service, and the token is unexpired (exp).
Rotating the key. Regenerating the Webhook Verification Key in the console takes effect immediately and invalidates the previous key -- update your backend at the same time. The same key also verifies the token appended to the hosted-form return redirect, so rotation affects both.
Key handling. The verification key is a shared secret. Store it server-side (never in browser or mobile client code), transmit it only over TLS, and rotate it if you suspect exposure.
Permissions. Card request operations are individually permissioned on your API key (list / create / read / update / delete), and keys can be scoped to segments -- a key scoped to Property A cannot see Property B's requests.