chatformdocs

Payment accounts

Connect, rename and disconnect the gateway accounts verified payments are paid into.

Verified payments are paid into your own Razorpay, Cashfree or Stripe account. These endpoints manage those accounts. They need the payment scopes, which no key preset includes: a key minted for anything else cannot connect or disconnect where your money goes.

EndpointScopeWhat it does
GET /v1/payment-accountspayment:readThe connected accounts. Credentials are never returned
POST /v1/payment-accounts/oauth/{provider}/startpayment:writeStart connecting stripe, razorpay or cashfree: { "returnTo" }, returns a consent url
POST /v1/payment-accounts/cashfree/onboardpayment:writeCreate a Cashfree account for a business that has none
PATCH /v1/payment-accounts/{id}payment:write{ "label" } to rename, { "isDefault": true } to make it the default
DELETE /v1/payment-accounts/{id}payment:writeDisconnect it
PROVIDER=stripe
curl -X POST https://api.chatform.in/v1/payment-accounts/oauth/$PROVIDER/start \
  -H "x-api-key: $CHATFORM_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"returnTo": "https://chatform.in/dashboard"}'

The reply is { url }: the gateway's consent page, for a person to open.

Good to know

  • No keys. Every gateway, Stripe included, connects by a person approving chatform on the gateway's own page. No gateway key is sent to or stored by chatform.
  • Connecting finishes in a browser. The consent url has to be opened by the person who created the key, signed in to chatform. It is single-use and expires in ten minutes. returnTo must be a page on the chatform app.
  • Cashfree onboarding returns an onboardingUrl for Cashfree's KYC, or { "useOAuth": true } when that email already has a Cashfree account.
  • Disconnecting revokes access at the gateway and deletes the stored credential. Forms still pointing at the account stop taking payments until you choose another.
  • Plan. Connecting needs a plan that collects payments; without one it is a 402.
  • The list is not paginated: it answers { accounts, enabled, providers }.

The payments themselves

GET /v1/forms/{id}/payments lists every checkout attempt on a form, newest first, for reconciling against your gateway. It needs response:read, takes status (default all) and response_id filters, and pages with a cursor like every other list. Verified payments →

On this page