Skip to content
Get started

Errors, statuses & go-live

Agentcard payment and connection states, Linq's error model, and the checklist to ship to production.

StatusTerminal?Meaning
needs_connectionnoThe handle isn’t connected yet.
connectingnoConnection in progress.
awaiting_user_actionnoWaiting on the customer (e.g. approval).
readynoCard available — retrieve the handoff and pay.
authorizednoMerchant placed a hold on the card.
succeededyesCharge settled.
declinedyesCharge declined; create a new payment to retry.
canceledyesYou canceled the payment.
expiredyesThe payment lapsed before completing.

not_connected · pending · connected · revoked

Every error returns the same envelope:

{
"success": false,
"error": {
"status": 400,
"code": 1002,
"message": "Phone number must be in E.164 format",
"doc_url": "https://docs.linqapp.com/error/codes/1xxx/1002/"
},
"trace_id": "3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f"
}

Every error carries a doc_url pointing at the page for that code — follow it rather than guessing from the message. On 429, error also includes retry_after (seconds to wait before retrying).

CodeHTTPMeaningFix
1001400Missing required fieldInclude handle, amount_cents, currency.
1002400Phone not E.164Format the handle as +14155550123.
1003400Invalid request bodyCheck JSON + Content-Type: application/json.
1005400Invalid parameter valuee.g. bad currency or negative amount.
1007429Rate limit exceededBack off using retry_after.
2004401UnauthorizedSend a valid Authorization: Bearer token.
2005403Access deniedToken lacks access to this resource/org.

An unknown paymentId or handle returns 404 with the same envelope — read the code and doc_url from the response rather than assuming a fixed code. The full list is at Error Codes.

  • Re-fetch on every webhook — never trust the status in the event body.
  • Dedupe payments on Idempotency-Key and webhooks on webhook-id.
  • Never log or store the fetched card number (PAN/CVC).
  • Treat declined / canceled / expired as terminal — create a fresh payment to retry.
  • Agentcard connected for the production org in the Linq dashboard.
  • Production API token stored server-side only (never shipped to the client/agent).
  • Webhook subscription created; signing_secret stored securely.
  • Webhook signatures verified (Standard Webhooks: HMAC-SHA256, 5-min replay window).
  • Webhook handler returns 2xx fast and is idempotent (dedupe on webhook-id).
  • Idempotency-Key sent on every payment create.
  • Amounts sent as amount_cents (minor units) everywhere.
  • Card handoff redeemed just-in-time; PAN/CVC never logged or stored.
  • succeeded confirmed by polling GET /payments/{id} (no succeeded webhook).
  • connection.revoked handled (stop paying a revoked handle).
  • Full loop rehearsed end to end against a handle you control.