Skip to content
Linq Copy agent prompt

Payments

Let an agent pay on a customer’s behalf with a single-use virtual card. Connect a customer once, then create a payment — a virtual card is minted scoped to that purchase and the card details are handed back for checkout.

Create a payment (agent pays on a customer's behalf)
client.Payments.New(ctx, body) (*Payment, error)
POST/v3/payments
Get a payment
client.Payments.Get(ctx, paymentID) (*Payment, error)
GET/v3/payments/{paymentId}
Cancel a payment
client.Payments.Cancel(ctx, paymentID) (*Payment, error)
POST/v3/payments/{paymentId}/cancel
Get a payment's card-reveal handoff
client.Payments.Credentials(ctx, paymentID) (*PaymentCredentialsResponse, error)
GET/v3/payments/{paymentId}/credentials
ModelsExpand Collapse
type Payment struct{…}
ID stringOptional
AmountCents int64Optional
formatint64
ApprovalURL stringOptional

Present on awaiting_user_action once a card is on file and the charge needs the customer’s passkey. Re-send the create request with the same Idempotency-Key to collect the payment after they approve.

AttachURL stringOptional

Present on awaiting_user_action when the customer has no card on file yet. A hosted page — open it for them; it stays valid for about 48 hours. Not returned on needs_connection: connect the handle first.

Currency stringOptional
Description stringOptional
Handle stringOptional
Merchant PaymentMerchantOptional

The merchant the card is minted against, echoed from the request.

Name stringOptional
URL stringOptional
Metadata map[string, string]Optional

Your own key/values, echoed back from the request.

Status PaymentStatusOptional
One of the following:
const PaymentStatusNeedsConnection PaymentStatus = "needs_connection"
const PaymentStatusConnecting PaymentStatus = "connecting"
const PaymentStatusAwaitingUserAction PaymentStatus = "awaiting_user_action"
const PaymentStatusReady PaymentStatus = "ready"
const PaymentStatusAuthorized PaymentStatus = "authorized"
const PaymentStatusSucceeded PaymentStatus = "succeeded"
const PaymentStatusDeclined PaymentStatus = "declined"
const PaymentStatusCanceled PaymentStatus = "canceled"
const PaymentStatusExpired PaymentStatus = "expired"