Skip to content

API reference

API: Payments

Markdown version

MethodPathWhat it doesScope
GET/v1/paymentsPayments on calls: whether the Stripe key and webhook secret are set, the webhook URL, the settings (on/off, approval threshold, maximum, link expiry), deposit rules and recent payment requestssettings:read
PUT/v1/paymentsChange the payment settings (owner). The key is the secret stripe_payments_key (a restricted key: Checkout Sessions write); the webhook's signing secret is stripe_webhook_secretintegrations:write
POST/v1/payments/deposit-rulesAdd a deposit rule (owner): a fixed amount or a percent of a catalog product's price, for a product or a named service. The voice agent can only charge what a rule sayssettings:write
DELETE/v1/payments/deposit-rules/:idTurn a deposit rule off (owner)settings:write
PUT/v1/payments/deposit-rules/:idChange a deposit rule (owner): saved as a new versionsettings:write
POST/v1/payments/stripe/webhook/:idStripe webhooks (public; Stripe-Signature HMAC-SHA256 over {t}.{raw body}, 5-minute tolerance; each event applied once). checkout.session.completed marks the payment paid and texts the confirmation (no sign-in)—

Examples

GET /v1/payments

Payments on calls: whether the Stripe key and webhook secret are set, the webhook URL, the settings (on/off, approval threshold, maximum, link expiry), deposit rules and recent payment requests

curl -s "https://api.closefinch.com/v1/payments" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/payments`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

PUT /v1/payments

Change the payment settings (owner). The key is the secret stripe_payments_key (a restricted key: Checkout Sessions write); the webhook's signing secret is stripe_webhook_secret

curl -s -X PUT "https://api.closefinch.com/v1/payments" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/payments`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/payments/deposit-rules

Add a deposit rule (owner): a fixed amount or a percent of a catalog product's price, for a product or a named service. The voice agent can only charge what a rule says

curl -s -X POST "https://api.closefinch.com/v1/payments/deposit-rules" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/payments/deposit-rules`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

DELETE /v1/payments/deposit-rules/$ID

Turn a deposit rule off (owner)

curl -s -X DELETE "https://api.closefinch.com/v1/payments/deposit-rules/$ID" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/payments/deposit-rules/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

PUT /v1/payments/deposit-rules/$ID

Change a deposit rule (owner): saved as a new version

curl -s -X PUT "https://api.closefinch.com/v1/payments/deposit-rules/$ID" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/payments/deposit-rules/${id}`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

Request and response schemas: https://www.closefinch.com/openapi.json. All resources: API reference.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.

Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.