Contents

Paimentech API Reference

Issue and manage virtual cards, fund them, and follow the money — programmatically.

Getting started

Every request goes to https://ciaas-api.vercel.app over HTTPS. All endpoints are scoped to your organization by the API key you present, so there is no account or tenant parameter anywhere in this API — a key can only ever read and write its own organization's data.

export BASE=https://ciaas-api.vercel.app
export PAIMENTECH_KEY=ck_live_your_key_here

curl $BASE/v1/cards -H "Authorization: Bearer $PAIMENTECH_KEY"

Authentication

Pass your key as a bearer token on every request:

Authorization: Bearer ck_live_…

Create keys from the API Keys page in the customer portal. Your first key must come from there — creating one through this API requires a key you already hold.

Treat a key like a password. It grants full access to your organization's cards, cardholders, and funding. Never commit one or expose it in a browser. If a key is exposed, rotate it — the replacement is issued immediately and the old key keeps working for a short grace period so you can deploy without downtime.

Idempotency

Send an Idempotency-Key header on any request that creates or moves something. Retrying with the same key replays the original response instead of acting twice — so a network timeout never risks issuing two cards or recording two funding loads.

curl -X POST $BASE/v1/cards \
  -H "Authorization: Bearer $PAIMENTECH_KEY" \
  -H "Idempotency-Key: 6f1e…" \
  -H "Content-Type: application/json" \
  -d '{"cardholderId":"ch_…","programId":"prg_…"}'

Reusing a key with a different body returns IDEMPOTENCY_CONFLICT rather than silently doing something unexpected. Use a fresh UUID per logical operation.

Errors

Errors use standard HTTP status codes and always return the same shape. The code is stable and safe to branch on; message is human-readable and may change.

{
  "error": {
    "code": "KYC_NOT_APPROVED",
    "message": "Cards cannot be issued to this cardholder: identity verification status is REVIEW.",
    "details": null
  }
}
CodeMeaning
UNAUTHENTICATEDMissing, invalid, revoked, or expired API key.
MFA_REQUIREDPortal-only; not returned by this API.
FORBIDDENYour account does not currently have API access.
NOT_FOUNDNo such resource on your account.
VALIDATIONA field is missing or malformed. See the message.
STATE_CONFLICTThe resource is not in a state that allows this action.
KYC_NOT_APPROVEDThe cardholder’s identity verification is not approved, so no card can be issued.
CONTROLS_OUT_OF_BOUNDSA spend control exceeds what the program allows.
INSUFFICIENT_FUNDSAvailable balance does not cover the amount.
IDEMPOTENCY_CONFLICTThis Idempotency-Key was used with a different request body, or the original is still in flight.
CONFIRMATION_REQUIREDPortal-only; not returned by this API.
RATE_THRESHOLDPortal-only; not returned by this API.
RATE_LIMITEDToo many requests. Slow down and retry.

Pagination & amounts

List endpoints accept limit (1–100, default 25) and offset, and return results newest-first under a data array.

All money is integer cents. 50000 means $500.00. There are no floating-point amounts anywhere in this API. Timestamps are epoch milliseconds.

Lifecycles

Card states

StateMeaningCan move to
PENDINGIssuance requested, awaiting the processor.ACTIVE, FAILED
ACTIVEUsable for authorizations.SUSPENDED, CLOSED
SUSPENDEDFrozen. Authorizations are declined.ACTIVE, CLOSED
CLOSEDTerminated permanently.terminal
FAILEDIssuance failed at the processor.terminal

Dispute states

StateMeaning
CREATEDOpened, not yet submitted to the network.
SUBMITTEDFiled with the processor and network.
UNDER_REVIEWBeing adjudicated; evidence exchange in progress.
WONResolved in the cardholder’s favour; funds returned to your balance.
LOSTResolved against the cardholder; the charge stands.
CANCELLEDWithdrawn before resolution.

API keys

Manage the credentials used to call this API. Your first key must be created from the portal — creating one here requires a key you already hold. Secrets are shown once at creation and stored only as a hash; if you lose one, rotate it.

GET /v1/api-keys B.2

List API keys

Returns metadata for every key on your account. Secrets are never returned.

Response

{
  "data": [
    {
      "id": "ak_9f2c…", "name": "Production backend",
      "environment": "live", "masked": "ck_live_58bd••••••••98a2",
      "status": "ACTIVE", "createdAt": 1788795225678, "lastUsedAt": 1788795990000
    }
  ]
}
POST /v1/api-keys B.2

Create an API key

Creates a key and returns the secret. This is the only time the secret is available.

Body

FieldTypeDescription
name string optional A label so you can tell keys apart later.
environment string optional Only "live" is accepted today; "test" requires the sandbox, which is not released yet.
  • Store the secret immediately — it cannot be retrieved afterwards.

Request

curl -X POST $BASE/v1/api-keys \
  -H "Authorization: Bearer $PAIMENTECH_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Production backend"}'

Response

{
  "key": { "id": "ak_9f2c…", "masked": "ck_live_58bd••••••••98a2", "status": "ACTIVE" },
  "secret": "ck_live_58bdfa7fd9e7d7a81fa481b53e867561d758e409781598a"
}
POST /v1/api-keys/:id/rotate B.2

Rotate an API key

Issues a replacement key and keeps the current one working for a short grace period, so you can deploy the new secret without downtime.

Path parameters

FieldTypeDescription
id string required The API key ID.
  • Deploy the new secret before the grace window closes, or calls using the old key start failing.

Response

{
  "key": { "id": "ak_new…", "status": "ACTIVE" },
  "secret": "ck_live_…",
  "previousKeyValidUntil": 1788881625678
}
DELETE /v1/api-keys/:id B.2

Revoke an API key

Revokes a key immediately. There is no grace period — use rotate if you are replacing a key on a running system.

Path parameters

FieldTypeDescription
id string required The API key ID.

Cardholders

The people who hold your cards. Every cardholder goes through identity verification, and a card can only be issued once their KYC status is APPROVED.

POST /v1/cardholders B.3

Create a cardholder

Creates a cardholder and runs identity verification. Identity fields are encrypted at rest and never logged.

Body

FieldTypeDescription
firstName string required Legal first name.
lastName string required Legal last name.
email string required Contact email.
phone string optional Contact phone.
dob string required Date of birth, YYYY-MM-DD.
addressLine1 string required Street address.
city string required City.
state string required Two-letter US state code. US issuance only.
postalCode string required Five-digit ZIP.
idLast4 string required Last four digits of SSN or ITIN.
  • kycStatus is one of: PENDING, REVIEW, APPROVED, REJECTED. Issuing requires APPROVED.

Request

curl -X POST $BASE/v1/cardholders \
  -H "Authorization: Bearer $PAIMENTECH_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "firstName":"Ada","lastName":"Lovelace","email":"ada@example.com",
    "dob":"1990-12-10","addressLine1":"1 Market St","city":"San Francisco",
    "state":"CA","postalCode":"94105","idLast4":"1234"
  }'

Response

{
  "id": "ch_8945…", "firstName": "Ada", "lastName": "Lovelace",
  "kycStatus": "APPROVED",
  "address": { "line1": "1 Market St", "city": "San Francisco", "state": "CA", "postalCode": "94105" }
}
GET /v1/cardholders B.3

List cardholders

Lists your cardholders, most recent first.

Query parameters

FieldTypeDescription
search string optional Match against name or email.
limit integer optional Results per page, 1–100. Defaults to 25.
offset integer optional Number of results to skip. Defaults to 0.
GET /v1/cardholders/:id B.3

Retrieve a cardholder

Returns a cardholder and their current KYC status.

Path parameters

FieldTypeDescription
id string required The cardholder ID.
PATCH /v1/cardholders/:id B.3

Update a cardholder

Updates mutable contact fields. Identity fields are immutable once verification has run.

Path parameters

FieldTypeDescription
id string required The cardholder ID.

Body

FieldTypeDescription
email string optional New contact email.
phone string optional New contact phone.

Cards

Issue and manage virtual cards. Spend controls set here are enforced at authorization time, and are always bounded by the limits configured on your program.

POST /v1/cards B.4

Issue a card

Issues a virtual card to a cardholder under one of your programs.

Body

FieldTypeDescription
cardholderId string required Who the card is for. Their KYC status must be APPROVED.
programId string required Program to issue under. See GET /v1/programs.
nickname string optional A label for your own reference.
controls object optional Spend controls. Any limit you omit inherits the program bound; any limit looser than the program bound is rejected.
controls.perTxnLimitCents integer optional Maximum for a single authorization.
controls.dailyLimitCents integer optional Rolling 24-hour spend cap.
controls.monthlyLimitCents integer optional Rolling 30-day spend cap.
controls.lifetimeLimitCents integer optional Total spend cap for the life of the card.
controls.velocityMaxPerHour integer optional Maximum authorizations per hour.
controls.mccAllowList string[] optional If set, only these merchant category codes are approved.
controls.mccBlockList string[] optional Merchant category codes to always decline.
controls.singleUse boolean optional Decline any authorization after the first successful one.
  • Amounts are always integer cents. 50000 means $500.00.
  • The full card number is never returned by this API — use the secure display endpoint.

Request

curl -X POST $BASE/v1/cards \
  -H "Authorization: Bearer $PAIMENTECH_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "cardholderId":"ch_8945…","programId":"prg_daa5…",
    "nickname":"Travel",
    "controls":{"perTxnLimitCents":50000,"mccAllowList":["4511","7011"]}
  }'

Response

{
  "id": "card_e5ed…", "status": "ACTIVE",
  "last4": "3330", "expMonth": 9, "expYear": 2029,
  "cardholderName": "Ada Lovelace", "programName": "Field Ops Cards",
  "controls": { "perTxnLimitCents": 50000, "mccAllowList": ["4511","7011"] }
}
GET /v1/cards B.4

List cards

Lists your cards, most recent first.

Query parameters

FieldTypeDescription
cardholderId string optional Only cards belonging to this cardholder.
status string optional Filter by status: PENDING, ACTIVE, SUSPENDED, CLOSED, FAILED.
limit integer optional Results per page, 1–100. Defaults to 25.
offset integer optional Number of results to skip. Defaults to 0.
GET /v1/cards/:id B.4

Retrieve a card

Returns card metadata, including masked number and current spend controls.

Path parameters

FieldTypeDescription
id string required The card ID.
POST /v1/cards/:id/freeze B.4

Freeze a card

Suspends a card. New authorizations are declined until it is unfrozen.

Path parameters

FieldTypeDescription
id string required The card ID.

Body

FieldTypeDescription
reason string optional Recorded on the audit trail.
POST /v1/cards/:id/unfreeze B.4

Unfreeze a card

Returns a suspended card to active. It begins approving authorizations again immediately.

Path parameters

FieldTypeDescription
id string required The card ID.
POST /v1/cards/:id/terminate B.4

Terminate a card

Permanently closes a card. This cannot be undone and a closed card can never return to active.

Path parameters

FieldTypeDescription
id string required The card ID.

Body

FieldTypeDescription
reason string optional Recorded on the audit trail.
PATCH /v1/cards/:id/controls B.4

Update spend controls

Replaces the card’s spend controls. Takes effect on the next authorization.

Path parameters

FieldTypeDescription
id string required The card ID.

Body

FieldTypeDescription
… object optional Same control fields accepted when issuing a card.
POST /v1/cards/:id/secure-display-token B.5

Create a secure display token

Mints a short-lived, single-use token for viewing the full card number and CVV. The page is rendered by the card processor — those values never pass through this platform, which is what keeps you out of PCI scope. Render the returned URL in an iframe.

Path parameters

FieldTypeDescription
id string required The card ID.
  • The token is burned on first render and expires in about a minute.
  • Every reveal is recorded on your audit trail — who, when, which card — without capturing the values.

Response

{
  "displayUrl": "/sim/secure-display?token=6cb3aed7…",
  "expiresAt": 1788795285000
}

Funding & ledger

Your balance is pre-funded and pooled: card authorizations draw against available funds. Every movement is recorded as balanced, immutable double-entry ledger entries.

GET /v1/funding/balance B.6

Retrieve balances

Returns available, held, and posted balances in cents.

  • available is spendable now; held is reserved by pending authorizations; posted is settled spend.

Response

{
  "availableCents": 2439400,
  "heldCents": 6200,
  "postedCents": 54400,
  "currency": "USD"
}
POST /v1/funding/loads B.6

Record a funding load

Records an incoming funding load against your balance. The funds themselves move over conventional bank rails; this records the load and is reconciled against arrival.

Body

FieldTypeDescription
amountCents integer required Amount in cents.
method string required WIRE or ACH.
reference string optional Your bank reference, used for reconciliation.

Request

curl -X POST $BASE/v1/funding/loads \
  -H "Authorization: Bearer $PAIMENTECH_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"amountCents":500000,"method":"WIRE","reference":"ACME-2026-09-001"}'
GET /v1/funding/loads B.6

List funding loads

Lists recorded funding loads, most recent first.

Query parameters

FieldTypeDescription
limit integer optional Results per page, 1–100. Defaults to 25.
offset integer optional Number of results to skip. Defaults to 0.
GET /v1/ledger/entries B.6

List ledger entries

Lists individual double-entry ledger lines. Entries are immutable; corrections appear as new compensating entries.

Query parameters

FieldTypeDescription
limit integer optional Results per page, 1–100. Defaults to 25.
offset integer optional Number of results to skip. Defaults to 0.

Transactions

Every authorization on your cards and its lifecycle through clearing, reversal, and refund.

GET /v1/transactions B.7

List transactions

Lists transactions, most recent first.

Query parameters

FieldTypeDescription
cardId string optional Only transactions on this card.
cardholderId string optional Only transactions for this cardholder.
status string optional Filter by status: AUTHORIZED, CLEARED, REVERSED, REFUNDED, DECLINED.
from integer optional Epoch milliseconds, inclusive lower bound.
to integer optional Epoch milliseconds, inclusive upper bound.
limit integer optional Results per page, 1–100. Defaults to 25.
offset integer optional Number of results to skip. Defaults to 0.
GET /v1/transactions/:id B.7

Retrieve a transaction

Returns a transaction with its full lifecycle event history.

Path parameters

FieldTypeDescription
id string required The transaction ID.
  • When a transaction is DECLINED, declineReason is one of: CARD_NOT_ACTIVE, INSUFFICIENT_FUNDS, PER_TXN_LIMIT, DAILY_LIMIT, MONTHLY_LIMIT, LIFETIME_LIMIT, VELOCITY_LIMIT, MCC_BLOCKED, SINGLE_USE_EXHAUSTED, CUSTOMER_NOT_ACTIVE.

Response

{
  "id": "txn_309f…", "status": "CLEARED",
  "amountCents": 12500, "clearedCents": 12500, "refundedCents": 0,
  "merchantName": "API MERCHANT", "mcc": "5411",
  "cardLast4": "3330", "declineReason": null,
  "events": [
    { "event_type": "authorized", "amount_cents": 12500 },
    { "event_type": "cleared",    "amount_cents": 12500 }
  ]
}

Disputes

Dispute a settled transaction on a cardholder’s behalf and track it through the card network’s chargeback process.

POST /v1/disputes B.8

Open a dispute

Opens a dispute on a cleared transaction and submits it to the network.

Body

FieldTypeDescription
transactionId string required The transaction being disputed. Must be cleared.
reason string required UNAUTHORIZED, NOT_RECEIVED, DUPLICATE, WRONG_AMOUNT, CANCELLED_SERVICE, or OTHER.
description string optional Initial supporting evidence.
  • Only one open dispute may exist per transaction at a time.

Request

curl -X POST $BASE/v1/disputes \
  -H "Authorization: Bearer $PAIMENTECH_KEY" \
  -H "Content-Type: application/json" \
  -d '{"transactionId":"txn_309f…","reason":"WRONG_AMOUNT","description":"Charged $320, receipt shows $230."}'
POST /v1/disputes/:id/evidence B.8

Add evidence

Attaches further evidence to an unresolved dispute.

Path parameters

FieldTypeDescription
id string required The dispute ID.

Body

FieldTypeDescription
text string required The evidence to attach.
GET /v1/disputes B.8

List disputes

Lists disputes, most recent first.

Query parameters

FieldTypeDescription
limit integer optional Results per page, 1–100. Defaults to 25.
offset integer optional Number of results to skip. Defaults to 0.
GET /v1/disputes/:id B.8

Retrieve a dispute

Returns a dispute with its status and evidence history.

Path parameters

FieldTypeDescription
id string required The dispute ID.

Programs

Programs are the card products configured for your account. They set the outer bounds that individual card spend controls must fall within.

GET /v1/programs —

List programs

Lists your programs and their spend-control bounds. You need a program ID to issue a card.

Not available yet

Deliberately not shipped, rather than half-built:

CapabilityStatus
Webhooks / event deliveryPoll the transactions endpoint in the meantime.
Apple Pay / Google Pay provisioningRequires a customer-controlled mobile app. Cards work online today via the secure display.
Sandbox / test-mode keysenvironment: "test" is rejected rather than issuing a key that quietly touches live data.