API reference

One payment API with any gateway behind it. Every request authenticates with an app's secret key as a Bearer token: the key says which app is calling, and the app's routes pick the gateway. The tenant key (Settings) acts as admin over every app (app picks one, the Default app otherwise). Create requests take an Idempotency-Key header: sending the same key again returns the first result with status 200. Start with POST /connect: the app decides whether it is a one-off payment or a subscription. The optional X-Pay-Version header is accepted and reserved for future changes.

Base URL

https://pay.contagorda.com/api/v1

Authentication

Every request sends a secret key as a Bearer token: an app key (Apps) for your products, or the tenant key (Settings) as admin. A missing or wrong key answers 401.

-H "Authorization: Bearer $PAY_SECRET_KEY"

Errors

401 and 404 answer { "error": message }. Validation answers 422 with { "errors": { field: message } } (sessions, subscriptions) or { "errors": [messages] } (gateways). A gateway failure answers 502 with the provider's message.

Connect

The entry point. One request creates what the app takes (a payment or a subscription) on the gateway its routes pick, and answers where to send the customer.

Sessions

One-off payments. Create a session, send the customer to its redirect_url, then trust the signed return and the session.paid webhook.

Config

The tenant and its active gateway configurations.

Are you sure?

Keyboard shortcuts

⌘ KSearch and navigate⌘ JOpen and close the Workbenchg hHomeg pPaymentsg cCustomersg sSubscriptionsg aAppsg gGateways?This listEscClose