Overview
The JAD Payment API is a REST service for processing credit-card and wallet payments. It wraps CyberSource and adds JAD-specific settlement to the recipient's account. For full request/response schemas, see the Swagger reference — this guide covers the things Swagger can't: how the pieces fit together.
| Item | Value |
|---|---|
| Base path | /api/v1 |
| Environment | Sandbox (CyberSource test gateway) |
| Supported currency | XCD only |
| Content type | application/json (payments), application/x-www-form-urlencoded (token) |
| Transport | HTTPS only |
XCD is enabled.
Requests in other currencies will be rejected by the payment gateway. Send
"currency": "XCD".You must be provisioned by the JAD team before you can transact — provisioning links your client credentials to a business and settlement account. Contact your JAD representative to get set up; there is no self-service signup.
Customer accounts at JAD (automatic)
When you submit a transaction for a customer who doesn't already have a JAD account, JAD may create one for them in the background. Whether this happens on any given transaction depends on the card processor and bank agreements behind it — it's not something you trigger or control.
- Identifier: the customer's email is the unique key. The same email on a later transaction reuses the same JAD account — no duplicates are created.
- You don't do anything, and you are not notified when an account is created. The customer is notified, by email from [email protected].
- What it gives the customer: a digital wallet under their JAD identity that they can use for bank-agnostic transactions — keeping their bank/card information confidential if they choose to.
- Free, no obligations. The account is free. The customer can ignore it, use it, or claim it later — there is no requirement to do anything.
Authentication
The API uses OAuth2 client credentials. You exchange your
client_id and client_secret for a short-lived bearer
token, then send that token on every payment request.
1. Get a token
curl -X POST https://svc.jadx.cash/api/v1/auth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "scope=.default"
Response:
{
"accessToken": "REPLACE_ME",
"tokenType": "Bearer",
"expiresIn": 3600,
"scope": ".default"
}
Credentials may also be supplied via an HTTP Basic header
(Authorization: Basic base64(client_id:client_secret)) with only
grant_type in the body — useful for standard OAuth2 client libraries.
2. Use the token
Send it as a bearer token on every /payments/* request:
Authorization: Bearer <accessToken>
| Detail | Value |
|---|---|
| Token lifetime | 3600 seconds (60 min) |
| Scope | .default |
| Grant type | client_credentials (only) |
Your first payment
The fastest path to a successful charge is a sale (authorize + capture in one call). Using the sandbox test card:
curl -X POST https://svc.jadx.cash/api/v1/payments/card/sale \
-H "Authorization: Bearer <accessToken>" \
-H "Content-Type: application/json" \
-d '{
"code": "JAD-ORDER-0001",
"cardNumber": "4111111111111111",
"expMonth": "12",
"expYear": "2031",
"totalAmount": "10.00",
"currency": "XCD",
"firstName": "Jane",
"lastName": "Doe",
"address1": "1 Bay Road",
"address2": "Apt 2",
"state": "St. Kitts",
"postalCode": "KN0101",
"country": "Saint Kitts and Nevis",
"email": "[email protected]",
"phoneNumber": "+18695551234"
}'
Success response:
{
"id": "7799763741266824804805",
"submitTimeUtc": "05/28/2026 13:52:54",
"status": "AUTHORIZED"
}
| Field | Notes |
|---|---|
code | Your reference for this transaction. Stored on our side; use a unique value per order. |
cardNumber | Sandbox Visa test card: 4111111111111111. |
totalAmount | Decimal string. A payer fee may be added to the amount actually charged. |
id (response) | The CyberSource transaction id — keep it; you need it for capture, void, and status. |
4111111111111111,
any future expiry. Use small XCD amounts for testing."country": "Saint Kitts and Nevis" — and set
state to the island, either "St. Kitts" or
"Nevis".Payment lifecycle
A transaction moves through states depending on which operations you call. The legal transitions are:
authorize ──► capture ──► (settled)
│ ▲
│ └── sale = authorize + capture in one call
│
└─► void (only while UNCAPTURED)
settled / captured ──► refund (review queue)
| Operation | Endpoint | Use when |
|---|---|---|
| Authorize | POST /payments/card/authorize | Hold funds now, capture later. |
| Capture | POST /payments/card/capture/{id} | Settle a prior authorization. {id} is the authorize response id. |
| Sale | POST /payments/card/sale | Authorize and capture together (most common). |
| Void | POST /payments/card/voidAuthorization/{id} | Cancel an uncaptured authorization and release the hold. |
| Status | POST /payments/card/payment/status/{id} | Look up a transaction's current status. |
| Refund | POST /payments/card/refund | Request a refund of a captured payment (see below). |
Two-step payments: authorize then capture
A common point of confusion: when you want to reserve funds at one point
and collect them later — the classic e-commerce flow (hold funds when the
order is placed, charge when the goods ship) — the two API calls have
different names. You do not call authorize twice.
1. Customer places order → POST /payments/card/authorize (returns an id; funds held)
2. You ship the goods → POST /payments/card/capture/{id} (settles the held funds)
If the order never ships (customer cancels, item out of stock), void
the authorization instead of capturing it — that releases the hold without ever
charging the customer.
authorize twice. The
second step is capture, not another authorize. A second
authorize would place a second, independent hold on the
customer's card. If you'd rather collect the funds in a single call, use
sale (it does the authorize and the capture together).The same two-step pattern applies to wallet payments
(/payments/wallet/authorize + /payments/wallet/capture/{id}),
where authorize holds the funds and capture transfers them to the
payee.
When to use sale vs. authorize + capture
| Scenario | Use |
|---|---|
| Digital goods / instant delivery (downloads, subscription unlock, in-app credit) | Sale |
| Pay-at-the-counter retail (POS) | Sale |
| Service consumed immediately (taxi, dine-in, delivery on receipt) | Sale |
| Physical goods that ship later (e-commerce, mail-order) | Authorize + Capture |
| Reservations (hotel, car rental, event tickets) | Authorize + Capture |
| Deposits that may adjust (damage deposit, fuel pump, mini-bar tab) | Authorize + Capture |
| Final price may be less than the hold (capture less than authorized) | Authorize + Capture |
| Inventory or eligibility confirmed after the customer commits | Authorize + Capture |
Rule of thumb: if you can fulfill instantly and the price is
final, use sale. If anything must happen between when the customer
commits and when you actually collect — shipping, confirmation, adjustment,
deferred service — use authorize + capture so you can
void cleanly if it falls through.
How the money moves
What actually happens to the payer's funds and the merchant's balance at each step:
Card payments
| Step | Payer (customer) | Merchant |
|---|---|---|
authorize | Available credit reduced by amount + payer fee (a pending hold). No charge yet. | Nothing received. |
capture | The hold becomes a charge in the next settlement batch. | Funds settle to the merchant. |
sale | Authorize and capture happen together. The customer is committed; funds settle. | Funds settle to the merchant. |
void (uncaptured) | Hold released; available credit restored. Customer was never charged. | Nothing received, nothing returned. |
refund (after capture) | Funds returned to the card (after staff approval). | Funds debited back from the merchant. |
Wallet payments
| Step | Payer (wallet user) | Payee (merchant) |
|---|---|---|
authorize | Funds held (amount + payer fee). Spendable balance reduced; not transferred yet. | Nothing received. |
capture | Held funds released to the payee. | Receives amount + payer fee. |
sale | Funds transferred immediately. | Receives amount + payer fee. |
void (uncaptured) | Held funds returned; spendable balance restored. | Nothing. |
refund (after capture) | Funds returned (after staff approval). | Refund debited. |
The payer fee is added to the subtotal upfront — it's part of the amount the payer transacts. Payee-side fees are settled separately, after the transaction is complete.
void only on an
authorization that has not been captured — it returns
status: "REVERSED". Once a payment is captured (or made via
sale), it can no longer be voided; attempting to void it returns a
MISSING_AUTH error. Captured payments must be refunded.Refunds are reviewed, not instant
Calling POST /payments/card/refund does not move
money immediately. It files a refund request that JAD staff review and
approve. Provide the original transaction id and a reason:
{
"developerID": 1001,
"refundType": "customer-request",
"refID": "7799763741266824804805",
"developerNotes": "Customer reported duplicate charge; requesting full refund."
}
You'll receive a case reference; the actual refund executes after approval.
Status values you'll see
| Status | Meaning |
|---|---|
AUTHORIZED | Authorization approved (hold placed). |
PENDING | Success — the capture was accepted and is queued for the settlement batch. See Settlement below. |
REVERSED | Authorization voided. |
INVALID_REQUEST | Operation not valid for this transaction's state. |
404
immediately after a payment, retry after a few seconds.Settlement — when the money actually lands
A successful capture returns PENDING. That is the
success response, not a warning. It means the processor accepted the capture and
queued the funds for settlement.
You are credited right away. JAD credits your balance as soon as the
capture is accepted — you do not wait for the banks. The PENDING status refers
to the bank settlement behind the scenes, not to your money.
| Moment | What has happened |
|---|---|
You call capture (or sale) | The customer is charged, and your JAD balance is credited immediately. |
Response says PENDING | Success. The capture can no longer be voided — use refund to return it. |
| Settlement completes | The funds finish moving between the banks. Your balance does not change — it was already credited. |
Settlement is a bank-to-bank operation
Once a payment is captured, the funds move between the card networks and the banks on their schedule. Neither you nor JAD can influence how long that takes — the speed is entirely bank-dependent. It is usually the next business day, but it can take longer, and weekends and bank holidays extend it. There is no way to expedite a settlement, and nothing is wrong with a payment that is still settling.
We follow up every morning
Every morning JAD reviews every transaction still awaiting settlement, confirms its current state with the processor, and updates your transaction log to match. This is automatic — you don't need to do anything, and there is nothing for you to call. If a captured payment ever fails to settle, JAD staff are alerted and will contact you directly.
Your transaction log shows each payment's current settlement state, so you can check it periodically if you want to follow a specific transaction through. Because it's refreshed each morning, a payment captured today will typically show as settled within a business day or two.
PENDING capture. The payment
already succeeded — the customer has been charged and you have been credited. Retrying risks
charging them twice. If you're unsure whether a capture went through, look the transaction up
by its id, or check your log — don't re-send it.Saving cards
You can save a customer's card on a successful payment and reuse it later
without handling the card number again. JAD returns a card token
(a string like jad_card_…) that stands in for the card. You store the
token; JAD keeps the card details. The card number, CVV, and full expiry are never
returned to you and never need to touch your servers again.
1. Save a card while charging it
Add "tokenize": true to any sale or
authorize request with a card. On success, the response includes a
token:
curl -X POST https://svc.jadx.cash/api/v1/payments/card/sale \
-H "Authorization: Bearer <accessToken>" \
-H "Content-Type: application/json" \
-d '{
"code": "JAD-ORDER-0002",
"cardNumber": "4111111111111111",
"expMonth": "12",
"expYear": "2031",
"tokenize": true,
"totalAmount": "10.00",
"currency": "XCD",
"firstName": "Jane", "lastName": "Doe",
"address1": "1 Bay Road", "state": "St. Kitts",
"postalCode": "KN0101", "country": "Saint Kitts and Nevis",
"email": "[email protected]", "phoneNumber": "+18695551234"
}'
{
"id": "7799763741266824804805",
"submitTimeUtc": "05/28/2026 13:52:54",
"status": "AUTHORIZED",
"token": "jad_card_Qm8s1Zr4Kx7Tn2Wd9Pb0A"
}
The token is present only when you asked to save the
card and the payment reached AUTHORIZED. Otherwise it is
null. Store the token against your customer.
2. Charge a saved card
Send paymentToken instead of the card fields. Everything else is the
same — it works on both sale and authorize:
curl -X POST https://svc.jadx.cash/api/v1/payments/card/sale \
-H "Authorization: Bearer <accessToken>" \
-H "Content-Type: application/json" \
-d '{
"code": "JAD-ORDER-0003",
"paymentToken": "jad_card_Qm8s1Zr4Kx7Tn2Wd9Pb0A",
"totalAmount": "10.00",
"currency": "XCD",
"firstName": "Jane", "lastName": "Doe",
"address1": "1 Bay Road", "state": "St. Kitts",
"postalCode": "KN0101", "country": "Saint Kitts and Nevis",
"email": "[email protected]", "phoneNumber": "+18695551234"
}'
Rules
| Rule | Detail |
|---|---|
| One funding source | Send either the card fields or paymentToken — never both, never neither. Otherwise you get 400. |
| Don't re-tokenize | tokenize: true together with paymentToken is rejected with 400 — a saved card is already tokenized. |
| Same card, same token | Saving the same card again returns the token you already have rather than a new one. |
| Treat tokens as secrets | A token can move money. Store it securely and never expose it in client-side code or URLs. |
Wallet payments
In addition to card payments, the API supports wallet payments —
funded from a JAD user's in-platform balance rather than a credit card. The endpoints
mirror the card ones under /api/v1/payments/wallet; funds move within
JAD rather than through a card network.
How wallet payments work
The payer is identified by email — no card details are sent.
When you authorize a wallet payment the funds are held from
the payer; they're transferred to the payee only when you capture.
Voiding the authorization releases the held funds back to the payer. A
sale moves the funds in a single step.
Endpoints
| Operation | Endpoint | What happens |
|---|---|---|
| Sale | POST /wallet/sale | Funds transferred from payer to payee immediately. |
| Authorize | POST /wallet/authorize | Funds held from the payer. Not yet transferred. |
| Capture | POST /wallet/capture/{id} | Held funds transferred to the payee. |
| Void | POST /wallet/voidAuthorization/{id} | Held funds released back to the payer. |
| Status | POST /wallet/payment/status/{id} | Looks up the transaction by id. |
| Refund | POST /wallet/refundPayment | Creates a refund case (staff review). |
For capture, void, and status, {id} is the id returned by the
authorize (or sale) call — it identifies the specific transaction.
Example — wallet sale
curl -X POST https://svc.jadx.cash/api/v1/payments/wallet/sale \
-H "Authorization: Bearer <accessToken>" \
-H "Content-Type: application/json" \
-d '{
"code": "JAD-ORDER-0001",
"totalAmount": "10.00",
"currency": "XCD",
"firstName": "Jane",
"lastName": "Doe",
"address1": "1 Bay Road",
"address2": "Apt 2",
"state": "St. Kitts",
"postalCode": "KN0101",
"country": "Saint Kitts and Nevis",
"email": "[email protected]",
"phoneNumber": "+18695551234"
}'
Capture/void take a smaller body — code, totalAmount,
currency, and the payer email:
curl -X POST https://svc.jadx.cash/api/v1/payments/wallet/capture/<authorizeId> \
-H "Authorization: Bearer <accessToken>" \
-H "Content-Type: application/json" \
-d '{ "code": "JAD-ORDER-0001", "totalAmount": "10.00", "currency": "XCD", "email": "[email protected]" }'
XCD before transacting.Webhooks
JAD notifies your server after every successful payment. Webhooks fire regardless
of how the payment came in — sale, capture, and their wallet
equivalents all send the same payment.completed event to the URL you
configure on the JAD row that received the funds.
Configuration
Two URLs per JAD, set on the JAD's Webhooks panel (via the developer portal at jad.cash/dev or the merchant portal at jad.cash/biz):
| Field | Method | When it fires |
|---|---|---|
WebhookPrePay | GET | Before the charge runs. Respond with the literal text FAIL to reject; any other response allows the charge to proceed. Optional. |
WebhookPostPay | POST | After a successful payment. Body is the JSON payload below. |
Post-pay event
A POST is sent to your configured WebhookPostPay URL:
POST <your-configured-url>
Content-Type: application/json; charset=utf-8
X-JAD-Event: payment.completed
{
"event": "payment.completed",
"orderID": "7250100000012345678",
"receiptNumber": "SK-7250100000012345678",
"jadNumber": "JAD12345",
"email": "[email protected]",
"paymentMethod": "card",
"cardLast4": "4242",
"currency": "XCD",
"amount": 100.00,
"amountCharged": 103.50,
"payerFee": 3.50,
"receiptText": "Invoice INV-001",
"timestampUTC": "2026-09-25T18:22:04.1234567Z"
}
Wallet payments look the same minus cardLast4:
{
"event": "payment.completed",
"orderID": "2626804220040001",
"receiptNumber": "SK-2626804220040001",
"jadNumber": "JAD12345",
"email": "[email protected]",
"paymentMethod": "wallet",
"currency": "XCD",
"amount": 100.00,
"amountCharged": 100.50,
"payerFee": 0.50,
"timestampUTC": "2026-09-25T18:22:04.1234567Z"
}
Fields
| Field | Type | Description |
|---|---|---|
event | string | Always "payment.completed". |
orderID | string | Internal payment id. For card sales/captures this is the CyberSource payment id; for wallet payments it's the internal transaction reference. Use it to look the payment up via /status/{id}. |
receiptNumber | string | Human-readable receipt reference, always prefixed SK-. |
jadNumber | string | The JAD that received the payment. |
email | string | Payer's email. Empty string if not captured. |
paymentMethod | string | "card" or "wallet". |
cardLast4 | string | Card payments only, when available. Last four digits of the PAN — safe to display on receipts. Absent on capture events (PAN is masked at rest in the stored authorization). |
currency | string | ISO 4217 code. Defaults to XCD. |
amount | number | Subtotal the payer was quoted, in currency. |
amountCharged | number | Actual amount that moved — amount plus payerFee. |
payerFee | number | Fee added on top of amount and paid by the payer. |
receiptText | string | Present only when non-empty. Configured on the JAD row. |
receiptText2 | string | Optional secondary receipt text; present only when non-empty. |
receiptText3 | string | Optional tertiary receipt text; present only when non-empty. |
timestampUTC | string | ISO 8601 timestamp of when the webhook was fired. |
Which endpoints fire the event
Every terminal money-moving endpoint fires the post-pay event. Authorize alone does not — money hasn't moved yet.
| Endpoint | Fires post-pay? |
|---|---|
POST /card/sale | Yes |
POST /card/capture/{id} | Yes |
POST /wallet/sale | Yes |
POST /wallet/capture/{id} | Yes |
POST /card/authorize | No (no funds moved) |
POST /wallet/authorize | No (funds held, not transferred) |
POST /card/voidAuthorization/{id} | No |
POST /wallet/voidAuthorization/{id} | No |
| Refund | No (not yet — planned) |
Delivery
Delivery is fire-and-forget: the API dispatches the event on a background thread so the caller's response is not delayed by a slow merchant endpoint.
- Timeout: 5 seconds. A slow handler will simply be dropped.
- Retries: none, today. One attempt per event.
- Order: not guaranteed. Handle events by their
orderID, not by arrival order. - Response: respond with any
2xx. The body is not read.
orderID (via /status/{id} or your activity log) rather
than treating the webhook as the source of truth. A signed & retried delivery
model is planned.WebhookPostPay
distinct from its sandbox sibling on jadx). Sandbox charges fire the sandbox
webhook; live charges fire the production webhook. Sandbox amounts are real numbers
but no money moves.Error handling
Always check both the HTTP status and the body. The API uses two response styles depending on the kind of failure.
HTTP status codes
| Code | Meaning |
|---|---|
200 | Request processed. Still check the status field (see below). |
400 | Validation error, or a payment gateway rejection (e.g. MISSING_AUTH). |
401 | Missing, invalid, or expired bearer token. |
402 | Payment failed. |
404 | Resource not found (also: transaction not yet searchable for status). |
429 | Too many requests — you've hit the rate limit. Back off and retry (see below). |
500 / 502 | Unexpected error / upstream gateway error. |
Rate limiting
Requests are rate limited per source IP. Exceeding a limit returns
HTTP 429 with a Retry-After header (seconds to wait).
| Scope | Limit |
|---|---|
Token endpoint (/auth/token) | 20 requests / minute |
| All other endpoints | 120 requests / minute |
Build in retry-with-backoff and honor Retry-After. Cache your bearer
token for its full 60-minute lifetime rather than requesting a new one per call —
this keeps you comfortably under the token-endpoint limit.
Retry-After before retrying. Limits are subject to change; don't
hard-code them — always read Retry-After.Error body (ProblemDetails)
Errors return an RFC 7807 ProblemDetails object. For gateway
failures, the underlying CyberSource detail is included under
Extensions.errors:
{
"Title": "Payment gateway error",
"Status": 400,
"Instance": "/api/v1/payments/card/voidAuthorization/7799...",
"Extensions": {
"errors": "{\"status\":\"INVALID_REQUEST\",\"reason\":\"MISSING_AUTH\",\"message\":\"Decline - The request ID is invalid.\"}"
}
}
HTTP 200 with a descriptive status string in the body
(for example "Invalid Project" or "Invalid user account id")
rather than an error code. Until this is standardized, treat a status
that is not one of the expected success values
(AUTHORIZED, PENDING, REVERSED) as a failure,
even on a 200 response.Common gateway reasons
| Reason | What it means |
|---|---|
MISSING_AUTH | You tried to void/modify a transaction that can't be (e.g. voiding a captured sale). |
SYSTEM_ERROR | Transient gateway error — safe to retry after a short delay. |
INVALID_REQUEST | The request isn't valid for the transaction's current state. |
Developer conduct
This section covers the technical conduct expected of developers integrating with the JAD API. Business-level obligations of the merchant (acceptable use, legal compliance, AML/KYC, refund and dispute responsibilities) live in a separate document: see Business Conduct & Acceptable Use. The merchant accepts those terms during onboarding — the binding agreement in any signed merchant contract supersedes the summary linked here.
Cardholder data — PCI rules you must follow
Any system that touches a card number is in PCI DSS scope. The simplest path to staying out of expanded scope is to never persist or relay cardholder data on your own infrastructure.
- Never store the full card number (PAN), the CVV/CVC/CID (3–4 digit code), full expiry, magnetic-stripe/track data, or PIN. CVV/CVC storage post-authorization is forbidden by PCI DSS — no exceptions, no encrypted-store loophole.
- Never log, email, screenshot, or chat-attach raw card data. Application logs are the most common leak path.
- Mask any card number that does appear in a UI or your own log:
no more than first 6 + last 4 (e.g.
411111******1111). - HTTPS only for any traffic carrying card data — never plain HTTP, never to a local test server in production.
- Discard after the charge. Pass card data into the JAD
/payments/card/*call, then drop it from memory. For follow-up operations (capture, refund), use the JAD-issued transaction id, not the card. - Don't proxy card data through middleware/log aggregators you don't control. Browser DevTools captures on disk are also data.
Credentials & secrets
client_secretis a server-side credential. Never embed it in mobile, browser, or desktop client code, and never commit it to a repository. If it appears in a public commit, treat it as compromised and rotate immediately.- Store secrets in environment variables, a secrets manager, or your platform's secrets store — not in plain files checked into source control.
- Bearer tokens issued at
/auth/tokenare short-lived (60 min). Cache them server-side for their lifetime; don't request a new token per call (you'll hit the rate limit) and don't leak tokens client-side. - If a credential is compromised — leaked secret, lost device, suspect activity — contact JAD to have it rotated and access reviewed.
Idempotency & safe retries
- The
codefield is your stable reference for a transaction. Use a unique value per order/transaction so it can be correlated end-to-end. - Do not blindly retry on timeout. A request that timed out may
have succeeded server-side. Before retrying a payment, call
/payment/status/{id}(or use your storedcode) to check whether the original transaction completed — only retry if it did not. - On
HTTP 429, honour theRetry-Afterheader before retrying. Don't hammer the endpoint.
Logging discipline
- Log enough to debug, but redact sensitive fields on your side too: PAN, CVV,
and full
Authorizationheader values. - Don't capture full request/response bodies in production logs without masking. The JAD API masks PAN/email/phone in its own server-side audit log — your stack should match.
Reporting security issues
If you discover a vulnerability or suspect a credential or transaction has been compromised, contact [email protected] with the details. Don't post vulnerabilities publicly before they're addressed.
