Skip to main content

Payments API

The Payments API allows you to process payments for tickets, accommodations, and subscriptions.

Get Payment Configuration

Get payment configuration (public endpoint, no authentication required).

Endpoint: GET /payments/config

Response:

{
"stripe": {
"publicKey": "pk_test_...",
"enabled": true
},
"currency": "EUR"
}

Create Payment

Create a new payment for tickets, accommodations, or subscriptions.

Endpoint: POST /payments

Headers:

  • X-F-Authorization: Client token (required)
  • X-F-Authentication: User token (required)

Request Body:

{
"payment_type": "ticket",
"entity_type": "ticket",
"entity_id": "ticket-id",
"amount": 100.00,
"pointsToUse": 0,
"stripePaymentMethodId": "pm_..."
}

Payment Types:

  • ticket: Payment for festival tickets
  • accommodation: Payment for accommodation
  • subscription: Payment for subscription plans

Response:

{
"id": "payment-id",
"status": "succeeded",
"amount": 100.00,
"currency": "EUR",
"payment_type": "ticket",
"entity_id": "ticket-id"
}

Get Payment

Get details of a specific payment.

Endpoint: GET /payments/:id

Headers:

  • X-F-Authorization: Client token (required)
  • X-F-Authentication: User token (required)

Response:

{
"id": "payment-id",
"status": "succeeded",
"amount": 100.00,
"currency": "EUR",
"payment_type": "ticket",
"entity_id": "ticket-id",
"createdAt": "2024-01-01T00:00:00Z"
}

List User Payments

Get all payments for the authenticated user.

Endpoint: GET /payments

Headers:

  • X-F-Authorization: Client token (required)
  • X-F-Authentication: User token (required)

Query Parameters:

  • limit (optional): Number of results to return
  • offset (optional): Number of results to skip
  • status (optional): Filter by payment status

Response:

[
{
"id": "payment-id",
"status": "succeeded",
"amount": 100.00,
"currency": "EUR",
"payment_type": "ticket",
"entity_id": "ticket-id",
"createdAt": "2024-01-01T00:00:00Z"
}
]