Skip to content
Get started

Create & complete a payment

Create a payment for a connected customer, wait until it's ready, and hand the card to your agent.

Once a customer’s handle is connected, your agent can pay a merchant on their behalf with a card from their Agentcard Wallet. A payment moves through a short lifecycle; you create it, wait for ready, then retrieve the card handoff.

Base URL: https://api.linqapp.com/api/partner/v3.

Terminal window
curl -X POST https://api.linqapp.com/api/partner/v3/payments \
-H "Authorization: Bearer $LINQ_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"handle": "+14155550123",
"amount_cents": 2500,
"currency": "usd",
"description": "Burger order",
"merchant": { "name": "DoorDash", "url": "doordash.com" }
}'
FieldRequiredNotes
handleyesConnected customer — phone (E.164) or email.
amount_centsyesInteger, minor units (2500 = $25.00 USD).
currencyyesISO currency code, lowercase (usd).
descriptionnoShown to the customer.
merchant.name / merchant.urlnoWhere the agent will spend.
metadatanoYour own key/value pairs.

Always send an Idempotency-Key; retrying the same key returns the original payment instead of creating a second one.

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "needs_connection",
"handle": "+14155550123",
"amount_cents": 2500,
"currency": "usd",
"description": "Burger order",
"attach_url": "https://zero.linqapp.com/...",
"approval_url": "https://zero.linqapp.com/..."
}

If the handle isn’t connected yet, status is needs_connection — send the customer to attach_url to add a card, or approval_url to approve with a passkey, to finish connecting.

Don’t poll in a tight loop — react to webhooks, then re-fetch for authoritative status:

Terminal window
curl https://api.linqapp.com/api/partner/v3/payments/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer $LINQ_API_KEY"

Payment statuses:

StatusMeaning
needs_connectionThe handle isn’t connected — send them through connect first.
connectingConnection in progress.
awaiting_user_actionWaiting on the customer (e.g. approval).
readyThe card is available — retrieve the handoff.
authorizedThe merchant placed a hold on the card.
succeededThe charge settled.
declinedThe charge was declined.
canceledYou canceled the payment.
expiredThe payment lapsed before completing.

3. Retrieve the card and let the agent pay

Section titled “3. Retrieve the card and let the agent pay”

When status is ready, fetch the handoff and let your agent redeem it at Agentcard. Details never pass through Linq — see Cards & credentials.

Terminal window
curl https://api.linqapp.com/api/partner/v3/payments/550e8400-e29b-41d4-a716-446655440000/credentials \
-H "Authorization: Bearer $LINQ_API_KEY"

You’ll get payment.authorized when the merchant holds the card, then the payment settles to succeeded — poll GET /payments/{id} to confirm, as there is no succeeded webhook. If the charge fails you’ll get payment.declined.

Cancel one that hasn’t completed:

Terminal window
curl -X POST https://api.linqapp.com/api/partner/v3/payments/550e8400-e29b-41d4-a716-446655440000/cancel \
-H "Authorization: Bearer $LINQ_API_KEY"
  • Re-fetch the payment on any webhook rather than trusting the event body.
  • declined, canceled, and expired are terminal — create a new payment to retry.