Payments API
Auto-generated from the OpenAPI spec. Run
node docs-site/scripts/fetch-openapi.jsto regenerate.
POST /api/v1/payments/stripe/checkout
Stripe Checkout
Create a one-off Stripe Checkout Session for a membership type.
Requires the studio to have Stripe connected and self-service purchases
enabled. Note that no shipped client calls this endpoint — the mobile app
and widget both use POST /api/billing/checkout-session instead — but it
is reachable with any client access token, so it is validated and tested
on the same terms.
success_url and cancel_url must be destinations Agon recognises: the
agon:// mobile deep-link scheme, the widget's own origin, this studio's
tunnel URL, or a loopback address. Anything else is refused with 400
CHECKOUT_INVALID_REDIRECT_URL before any Stripe object is created — an
arbitrary redirect would let this studio's Stripe account mint a
studio-branded checkout session pointing at someone else's site.
Request body
| Field | Required | Type | Description |
|---|---|---|---|
membership_type_id | Yes | integer | |
success_url | Yes | string | |
cancel_url | Yes | string |
Responses
- 200 — Successful Response
- 422 — Validation Error
POST /api/v1/payments/{payment_id}/refund
Refund Payment
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
payment_id | path | Yes | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
GET /api/v1/payments/{payment_id}
Get Payment
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
payment_id | path | Yes | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
GET /api/v1/payments
List Payments
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
client_id | query | No | integer | |
page | query | No | integer | |
page_size | query | No | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
POST /api/v1/payments
Record Manual Payment
Request body
| Field | Required | Type | Description |
|---|---|---|---|
client_id | Yes | integer | |
membership_id | No | integer | |
amount | Yes | number | |
currency | No | string | |
provider | No | string | |
notes | No | string |
Responses
- 201 — Successful Response
- 422 — Validation Error
currency accepts only EUR, GBP, CHF, USD, SEK, NOK, DKK, PLN, CZK and RON,
and defaults to EUR. Any other value is rejected with 422.
The list is restricted to currencies whose minor unit is 1/100, because amounts are converted to minor units before reaching the payment provider. A zero-decimal currency would be charged 100 times over.