Skip to main content
These APIs use the portal user token from Portal token. They are scoped to the token’s sub customer. Reads require portal:read; writes require portal:write and act only on that customer’s data.

Authentication

The gateway verifies aud=clink-agent-platform-portal, token_use=access, and the required scope, then passes the verified customer identity to cwallet. There is no request parameter for selecting a different customer or email. Clink responses use the standard envelope:
The examples below show data.

Common behavior

  • pageNum and pageSize use 1-based pagination.
  • Order lists accept status, from, and to filters.
  • Lists are scoped to the customer, not to an Agent. Orders, refunds, and authorizations created by any Agent for that customer are returned.
  • A missing record, or a record owned by another customer, is returned as 404.
  • Writes are limited to the user’s own risk rules, billing address, purchase instructions, card-binding sessions, payment credentials, payment results, and payment methods. All other endpoints are read-only.
  • Request amounts on the write endpoints are decimal strings in major currency units: "12.50" means USD 12.50. Do not send minor units.

Get account

List payment methods

status is ACTIVE or DISABLED. PAN and CVV are never returned. is_default identifies the card used by default; the default card can be deleted. To add a card, use Bind a card. To bind a card and authorize a purchase in one flow, omit payment_instrument_id in Create instruction. To remove a card, use Delete payment method.

Bind a card

Creates a short-lived card-binding session for the token’s customer and returns a URL that the user opens to add a card. Requires portal:write. This endpoint does not create an instruction and does not authorize spending. Use it when the user only needs to add a card. To bind a card and sign in one flow, omit payment_instrument_id in Create instruction instead.
There are no body fields for choosing a customer. The session is always created for the token’s customer.

Response

Each call creates a new, independent session with a short TTL. When the user opens the link and completes the card-binding ceremony, the card is added to the customer’s payment methods (List payment methods). No instruction or authorization is created. The link can be reopened or re-exchanged while the session is still pending; it stops working once the card-binding ceremony completes or the session expires.
Treat the card-binding link as a credential. Do not forward it, screenshot it, or write it to logs; anyone who has the link can open it while it is valid and complete card binding for that customer. Deliver it only to the intended user.

Delete payment method

Deletes one of the token’s customer’s payment methods. Requires portal:write.
A successful deletion returns 200 with deleted: true. The deletion is immediate and the response does not include a user-facing page URL. A payment method that does not exist, or that belongs to another customer, returns the same 404, so the response does not reveal whether another customer’s card exists. The default card can be deleted. Repeating the request after a successful deletion returns 404.

List orders

truncated: true means the status/time filtered scan reached Clink’s internal scan bound; total describes the records scanned, not necessarily the customer’s complete matching history. Without filters, the endpoint reads one page and does not use the bounded scan.

Get order

The detail response includes order time, amount breakdown, merchant, payment method, card scheme, products, shipping address and amount, agent_info, and a refund_summary:

List refunds

Get refund

Returns one refund with the fields shown above. A refund owned by another customer is returned as 404.

List authorizations

Get authorization

The detail response includes the instruction fields, mandates, and usages. usages are raw usage records; compute used and remaining amounts from them when rendering the portal. An instruction owned by another customer is returned as 404. client_reference_id in authorization responses is the instruction’s own field. For instructions created through the portal, Clink generates a random value for it; it is not the create request’s request_id and not the client_reference_id sent to Get credential and Report credential result. Do not use it to reconcile a purchase.

Create instruction

Creates a purchase instruction (spending authorization) for the token’s customer and returns a short-lived activation link that the user opens to approve it with a Passkey. Requires portal:write. payment_instrument_id selects one of two signing modes: For the first mode, read payment_instrument_id from List payment methods. In the second mode, do not send a card number, CVV, or any other card field; the user enters card details on the Clink page. Customer identity always comes from the token; the request body has no customer or email field. After the activation link’s signing session is exchanged, an existing-card instruction continues to /authorize/{paymentInstrumentId}?instructionId=...; a bind-and-sign instruction continues to /bind-authorize?instructionId=..., where the user binds a card and authorizes in one Passkey ceremony.

Request fields

Each mandate contains:

Example request

Response

Treat the activation link as a credential. Do not forward it, screenshot it, or write it to logs; anyone who has the link can open it while it is valid and obtain a Clink browser login session for that customer. Deliver it only to the intended user.

Activate the instruction

Creating an instruction is not an authorization. An instruction with an existing card is CREATED; an instruction that will bind a card is PENDING. Both become ACTIVE only after the user completes Passkey verification on Clink’s page. The link can be reopened or refreshed while it is valid, but the instruction can be signed only once.
  1. Send the user to activation_url in a browser.
  2. For CREATED, the user reviews the card and completes Passkey verification. For PENDING, the user binds a card and completes Passkey verification in the same ceremony. The page establishes the browser session and continues to the authorization step.
  3. Poll GET /agent/platform/authorizations/{instructionId} until status is ACTIVE.
If the user does not complete the flow, the instruction stays CREATED or PENDING and authorizes no spending. Only send the link to the intended user; it is an activation link, not a portal token.

Idempotency

request_id is the idempotency key, and the rules are identical in both signing modes. Clink keeps the idempotency record for 24 hours by default; after that window, retrying the same request_id creates a new instruction. Within the window, retrying with identical parameters returns the same instruction_id; a normal retry on an instruction that is not yet signed returns a fresh activation link. If the retried request_id refers to an instruction that is already signed or final, Clink returns the instruction without a new activation_url or activation_expires_at (both fields are omitted); read GET /agent/platform/authorizations/{instructionId} for the current status. Reusing a request_id with different parameters returns 409 with code 71211011 (portal_conflict).

Get credential

Requests a single-use payment credential for one purchase against an activated instruction and mandate. Requires portal:write. The response has two modes, depending on whether your platform has a public key registered with Clink:
  • Registered public key (matched: true): Clink seals the card fields into a key/payload envelope that only your platform can decrypt with the matching private key.
  • No registered public key (matched: false): when plaintext mode is enabled server-side and gateway response redaction is live, Clink returns the DPAN and dynamic CVV in plaintext in the response. The card can be used directly, but these fields reach your backend in plaintext.
Register a public key with Clink to use the encrypted mode; this is recommended for production.

Public key registration

Contact Clink to register your platform’s RSA public key in each environment; it is mapped to your platform client name. The registered key selects the response mode: with a key the credential is sealed to it; without one, Clink returns plaintext card fields only when plaintext mode is enabled server-side and gateway response redaction is live (the MCP-equivalent fallback). With the default gate off, the endpoint fails closed instead. Register the key before production use.
Without a registered public key, when plaintext mode is enabled server-side, the response returns the DPAN and dynamic CVV in plaintext to your backend. Keep these fields out of logs, model input, and ordinary storage, and do not keep them beyond the checkout. Register a public key with Clink (recommended for production) to switch to the sealed key/payload mode. This plaintext fallback matches MCP get_credential. Do not enable plaintext mode in environments where gateway response redaction is not yet active: it is config-gated server-side by portal-plaintext-enabled (default off), and with the gate off the endpoint fails closed with 71211012 (credential_public_key_not_configured) instead of returning plaintext card fields.

Request fields

Each product in products contains:

Example request

Response

matched selects the response shape.
Clink seals the credential to your registered public key. The card fields are inside payload.
The sealed response contains only matched, key, payload, and expires_at; in that mode card, display, and the ID fields are omitted and the IDs are inside the decrypted payload. The plaintext response contains no key or payload. Plaintext card fields: In plaintext mode, number and securityCode are always present; the remaining fields are optional and omitted when not provided.

Decrypt the sealed response

When matched is true, decrypt key and payload with your platform private key. The decrypted payload contains orderId, paymentExecutionDetailId, clientReferenceId, status, the network credential (DPAN, dynamic CVV, and expiry), and cardholder and address fields. The envelope format and a decryption example are in Decryption. Keep decrypted card fields out of logs, model input, and ordinary records, and use the validity information in the decrypted payload to decide when to use the credential; expires_at is only an estimate. Save client_reference_id; Report credential result uses it.

Idempotency

client_reference_id is the idempotency key. Retrying with the same client_reference_id returns the same credential: the same sealed envelope when matched is true, and in plaintext mode the same card from the server-side encrypted cache, with no second issuance. Reusing it with different parameters returns 409 with code 71211011 (portal_conflict).

Report credential result

Reports the outcome observed on the merchant page after using a credential. Requires portal:write. Clink uses the report to close the order and the instruction usage. A report records what the merchant page showed; it does not execute or verify the payment.
This is the payment result confirmation endpoint. It is the only entry point for confirming or reporting a transaction result; there is no separate confirm-transaction API. Use it to report the final outcome, including after an UNKNOWN report, within the 24-hour reporting window described below.

Request fields

failure_reason accepts CARD_DECLINED, AUTHENTICATION_REQUIRED, AMOUNT_CHANGED, CREDENTIAL_EXPIRED, CREDENTIAL_LOST, MERCHANT_ERROR, BUYER_CANCELLED, or OTHER.

Example request

Response

Reporting rules

  • Clink accepts a terminal result until report_deadline, 24 hours after the credential is issued. A report after the window returns 410 with code 71211018 (report_window_expired).
  • A usage that does not exist, or does not belong to the token’s customer, returns 404.
  • Clink compares terminal results in two classes: SUCCEEDED is success; FAILED and NOT_SUBMITTED are both failure. Repeating a result in the same class returns the recorded result with HTTP 200; for example, reporting FAILED after NOT_SUBMITTED does not conflict. Reporting the other class after a terminal result is recorded returns 409 with code 71211017 (result_already_reported).
  • SUCCEEDED, FAILED, and NOT_SUBMITTED close the usage and are delivered to Clink’s existing payment-result pipeline.
  • UNKNOWN records no terminal result, publishes no result message, and returns PENDING; report the final outcome before report_deadline.
  • paid_amount and currency_code must be sent together. When paid_amount differs from the authorized amount, Clink records paid_amount_mismatch: true and keeps the authorized amount.

Risk rules

Read and replace the user’s global default risk rules. The update is a full replacement of the settings object.
autoSuspendEnabled is a fixed safety behaviour in the current version: Clink always returns true, and the value is ignored on write. It is present in the request schema for compatibility, but it cannot disable auto-suspend. The PUT response returns the saved settings. A portal:read-only token can read this endpoint but receives 403 on PUT.

Billing address

Read or replace the user’s billing address.
The PUT response returns the updated address. Clink validates the required fields and reuses the existing wallet billing-address rules (including the configured country list and city/line1 requirements for those countries). A portal:read-only token receives 403 on PUT.

Errors

Business errors use the standard envelope without data: code is a numeric business code and msg is a human-readable description. Judge an error by the HTTP status together with code, not by a string error code.