@agorio/sdk • Docs
Interface: IntentMandate
AP2 Client — Agent Payments Protocol (FIDO Alliance)
GA in agorio v0.8. Implements the full AP2 mandate lifecycle: IntentMandate → CartMandate → SignedMandate → payment result
Real deployments must supply a sign function backed by a FIDO2/WebAuthn
authenticator (ES256 / EdDSA). The default signer is a deterministic mock
(prefix: “mock_sig_”) suitable for testing and CI only.
Receivers (merchants / payment gateways) can use verifyMandateShape to
sanity-check incoming SignedMandates before handing them to a real verifier.
Usage: const client = new Ap2Client({ merchantId: ‘merchant_xyz’ }); const intent = client.createIntentMandate({ amount: ‘49.99’, currency: ‘USD’ }); const cart = client.attachCart(intent, lineItems); const signed = await client.sign(cart); const result = await client.submitPayment(signed, paymentUrl);
Extended by
Properties
amount
amount:
string
Total amount to be charged
Defined in
src/client/ap2-client.ts:30
createdAt
createdAt:
string
ISO-8601 creation timestamp
Defined in
src/client/ap2-client.ts:35
currency
currency:
string
Defined in
src/client/ap2-client.ts:31
expiresAt
expiresAt:
number
Unix timestamp (ms) at which this mandate expires
Defined in
src/client/ap2-client.ts:33
mandateId
mandateId:
string
Unique mandate identifier
Defined in
src/client/ap2-client.ts:26
merchantId
merchantId:
string
Merchant receiving the payment
Defined in
src/client/ap2-client.ts:28