fn probe()
Request a resource WITHOUT paying and record the parsed payment
fn mintToken(paymentMethodId: string, maxAmount: string, currency: string, expiresAt?: number, sellerNetworkId?: string, externalId?: string)
Mint a fiat Shared Payment Token from an existing payment method
| Argument | Type | Required | Description |
|---|
| paymentMethodId | string | yes | Existing payment method (pm_...). Raw-PAN creation is PCI-gated in |
| maxAmount | string | yes | Usage-limit ceiling, minor units string. |
| currency | string | yes | Usage-limit currency (ISO, lowercase). |
| expiresAt? | number | no | Unix timestamp for usage_limits.expires_at. |
| sellerNetworkId? | string | no | Seller network profile the token is granted to (defaults to networkId). |
| externalId? | string | no | Correlation id; also drives the Idempotency-Key. |
fn pay(sptId: string, maxAmount: string, currency: string, expectedNetworkId?: string, expectedRealm?: string, externalId?: string)
Pay for a resource end-to-end: request it, parse the 402 stripe
| Argument | Type | Required | Description |
|---|
| sptId | string | yes | Shared Payment Token (spt_...) to present. |
| maxAmount | string | yes | Spend ceiling, minor units string. The challenge amount must not |
| currency | string | yes | Expected challenge currency. Mismatch blocks the payment. |
| expectedNetworkId? | string | no | Pin the payee: the Stripe Business Network Profile (profile_...) the |
| expectedRealm? | string | no | Pin the challenge realm (issuing authority); mismatch blocks the payment. |
| externalId? | string | no | Correlation id. |
fn getIssuedToken(sptId: string)
Retrieve an issued Shared Payment Token
| Argument | Type | Required | Description |
|---|
| sptId | string | yes | Shared Payment Token id (spt_...). |
fn revokeToken(sptId: string)
Revoke an issued Shared Payment Token
| Argument | Type | Required | Description |
|---|
| sptId | string | yes | Shared Payment Token id (spt_...). |
fn createChallenge(amount: string, currency: string, description?: string, externalId?: string, expiresInSeconds?: number, networkId?: string, scope?: string)
Produce seller challenge material for a payment-gated resource:
| Argument | Type | Required | Description |
|---|
| amount | string | yes | Amount demanded, minor units string. |
| currency | string | yes | Currency (ISO, lowercase). |
| description? | string | no | |
| externalId? | string | no | |
| expiresInSeconds? | number | no | Challenge validity window; recommended to keep challenges short-lived. |
| networkId? | string | no | Override the global networkId. |
| scope? | string | no | Bind the challenge to a specific resource/route. Carried inside the |
fn verifyCredential(authorizationHeader: string, expectedAmount?: string, expectedCurrency?: string, expectedScope?: string)
Verify a received Authorization: Payment credential — HMAC-bound
| Argument | Type | Required | Description |
|---|
| authorizationHeader | string | yes | The received Authorization value ("Payment <base64url>"). |
| expectedAmount? | string | no | |
| expectedCurrency? | string | no | |
| expectedScope? | string | no | Require the credential's challenge `opaque` to equal this route scope |
fn chargeToken(sptId?: string, amount?: string, currency?: string, authorizationHeader?: string, expectedScope?: string, description?: string, externalId?: string)
Settle a granted Shared Payment Token via a confirmed
| Argument | Type | Required | Description |
|---|
| sptId? | string | no | Granted token to settle (or pass authorizationHeader). |
| amount? | string | no | Minor units string. |
| currency? | string | no | |
| authorizationHeader? | string | no | Full received credential; verified (HMAC + expiry) before settling. |
| expectedScope? | string | no | When settling from an authorizationHeader, require the challenge |
| description? | string | no | |
| externalId? | string | no | |
fn issueReceipt(chargeId: string, externalId?: string)
Produce the Payment-Receipt header value for a SETTLED charge
| Argument | Type | Required | Description |
|---|
| chargeId | string | yes | Settled PaymentIntent id (pi_...). |
| externalId? | string | no | |
fn getCharge(chargeId: string)
Retrieve a charge (GET /v1/payment_intents/{id}).
| Argument | Type | Required | Description |
|---|
| chargeId | string | yes | PaymentIntent id (pi_...). |
fn listCharges(externalId?: string, createdGte?: number, createdLte?: number, maxResults: number, pageSize: number)
Reconciliation fan-out: list charges by created range
| Argument | Type | Required | Description |
|---|
| externalId? | string | no | Filter by metadata externalId (uses /v1/payment_intents/search). |
| createdGte? | number | no | Unix lower bound. |
| createdLte? | number | no | Unix upper bound. |
| maxResults | number | yes | |
| pageSize | number | yes | |
fn refundCharge(chargeId: string, amount: string, reason?: enum, externalId?: string)
Refund a settled charge (POST /v1/refunds) with
| Argument | Type | Required | Description |
|---|
| chargeId | string | yes | PaymentIntent id (pi_...) to refund. |
| amount | string | yes | Refund amount, minor units string. Must not exceed the remaining |
| reason? | enum | no | |
| externalId? | string | no | |
fn getGrantedToken(sptId: string)
Retrieve a granted Shared Payment Token (seller view). Card
| Argument | Type | Required | Description |
|---|
| sptId | string | yes | Shared Payment Token id (spt_...). |
fn createTestGrantedToken(maxAmount: string, currency: string, paymentMethodId: string, expiresAt?: number)
TEST MODE ONLY: fabricate a granted Shared Payment Token via
| Argument | Type | Required | Description |
|---|
| maxAmount | string | yes | Usage-limit ceiling, minor units string. |
| currency | string | yes | Usage-limit currency. |
| paymentMethodId | string | yes | Payment method the fabricated granted token draws on (required by the |
| expiresAt? | number | no | |
fn listConsumerPaymentMethods()
List the consumer's Link wallet payment methods (csmrpd_). Fan-out:
fn getSpendRequest(id: string)
Retrieve a consumer spend request by lsrq_ (single-shot; interval 0).
| Argument | Type | Required | Description |
|---|
| id | string | yes | Spend request id (lsrq_...). |
fn cancelSpendRequest(id: string)
Cancel a PENDING consumer spend request (read-before-cancel). Note:
| Argument | Type | Required | Description |
|---|
| id | string | yes | Spend request id (lsrq_...). |
fn createSpendRequest(amount: string, currency: string, context: string, networkId?: string, paymentMethodId?: string, externalId?: string)
Create a consumer Link spend request — the PRIMARY (binding) guard
| Argument | Type | Required | Description |
|---|
| amount | string | yes | Amount to authorise, minor-units STRING (e.g. "500" = $5.00). |
| currency | string | yes | Currency (ISO, lowercase). US-only Link; default usd. |
| context | string | yes | Purchase description + rationale the consumer READS when approving. |
| networkId? | string | no | Payee Business Network Profile (profile_...). Defaults to the global |
| paymentMethodId? | string | no | Consumer Link payment method (csmrpd_...). Omit to let the consumer pick |
| externalId? | string | no | Correlation id; also anchors the deterministic intent key persisted on |
fn paySpendRequest(id: string, maxAmount: string, currency: string, expectedNetworkId?: string, expectedRealm?: string, externalId?: string)
Spend an APPROVED consumer grant against an MPP-protected URL, by
| Argument | Type | Required | Description |
|---|
| id | string | yes | Approved spend request id (lsrq_...) to spend. |
| maxAmount | string | yes | ADVISORY pre-flight ceiling (minor units). NOTE: the binding cap is the |
| currency | string | yes | Expected challenge currency (advisory). |
| expectedNetworkId? | string | no | Advisory payee pin for the pre-flight challenge. |
| expectedRealm? | string | no | Advisory realm pin. |
| externalId? | string | no | Correlation id. |
Resources
challenge(infinite)— Probe result: HTTP status + parsed payment challenges.
payment(infinite)— Buyer payment attempt — written on EVERY pay outcome (audit trail).
issuedToken(infinite)— Issued Shared Payment Token (buyer view).
challengeSpec(infinite)— Seller challenge material: WWW-Authenticate value + problem+json body.
credential(infinite)— Seller-side credential verification verdict.
charge(infinite)— Seller charge (PaymentIntent) state.
receipt(infinite)— Issued Payment-Receipt header value for a settled charge.
refund(infinite)— Refund outcome — written on every refundCharge attempt (audit trail).
grantedToken(infinite)— Granted Shared Payment Token (seller view; card details trimmed).
summary(infinite)— Fan-out listing summary.
spendRequest(infinite)— Consumer Link spend-request lifecycle — written on EVERY outcome
consumerPaymentMethod(infinite)— Consumer Link payment method (csmrpd_; display as link-cli returns