O.Z.O.R.A. Payments API (0.0.1)

Download OpenAPI specification:

Payment and transaction management service.

Git Commit ID: 6cb74c5c6f21a394787dd1ee692443b2710091a2
Software Version: 0.0.1
Build: 2026-10-21 11:01:45

Payments

Handle Stripe webhook events

Receives Stripe webhook events (e.g. checkout.session.completed, checkout.session.expired). Verifies the webhook signature, saves the event into the transaction record, and updates the transaction status.

This is a public endpoint — no JWT required. Called directly by Stripe servers. The request body must be raw (not parsed as JSON) for signature verification.

Request Body schema: application/json
required
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "message": "string"
}

Handle Stripe Checkout backref redirect

Browser-facing endpoint. Stripe redirects the customer here after a Checkout attempt. Retrieves the Checkout Session from Stripe, saves it into the transaction record and redirects the customer to {frontend_url}/check?ticket_nr=...&email=...&message=....

If the request cannot be verified plain-text error are returned.

This is a public endpoint - no JWT required.

query Parameters
ticket_nr
required
string

Full ticket number, set by us in the start URL.

email
required
string

Ticket holder email, set by us in the start URL.

frontend_url
required
string <uri>

The frontend to redirect to set by us in the start URL.

session_id
required
string

Stripe Checkout Session ID appended by Stripe.

stripe_status
required
string

Status from the redirect URL (success or cancel), set by us in the start URL.

Responses

Handle SimplePay IPN (Instant Payment Notification)

Receives the SimplePay IPN callback after a payment is completed/confirmed. Saves the IPN data and status into the transaction record. Responds with the HMAC-SHA384 signature in the Signature header (required by SimplePay protocol).

This is a public endpoint — no JWT required. Called directly by SimplePay servers.

Request Body schema: application/json
required
orderRef
required
string

Transaction reference (format "TR123")

status
required
string

Payment status from SimplePay (e.g. FINISHED)

Responses

Request samples

Content type
application/json
{
  • "orderRef": "string",
  • "status": "string"
}

Handle SimplePay backref redirect

Browser-facing endpoint. SimplePay redirects the customer here after a payment attempt. Verifies the signature, decodes the SimplePay response, saves it into the transaction record (the backref event also becomes the transaction status unless the IPN has already arrived or the status is FINISHED) and redirects the customer to {frontend_url}/check?ticket_nr=...&email=...&message=....

If the request cannot be verified plain-text error are returned

This is a public endpoint — no JWT required.

query Parameters
ticket_nr
required
string

Full ticket number, set by us in the start URL.

email
required
string

Ticket holder email, set by us in the start URL.

frontend_url
required
string <uri>

Origin of the frontend to redirect to (must be listed in ALLOWED_ORIGINS), set by us in the start URL.

r
required
string

Base64 encoded SimplePay response JSON, appended by SimplePay.

s
required
string

Signature of the decoded JSON string, appended by SimplePay.

Responses

Search transactions by ID

Searches for a transaction by its integer ID. Returns at most one result.

This is a service endpoint — it is primarily called by the tickets service (via payments_client.js) during ID searches, using a service JWT that carries the original user's privileges. Direct user JWT calls are also accepted.

Requires the Priv payments_search permission. For service JWT calls, the permission is checked from servicePrivs (forwarded user privs). For direct user JWT calls, the permission is checked from privs.

Privilege name Sample values Description
Priv payments_search * true Grants access to search for transactions. Without it, the request is denied with 403.
* required permission.
Authorizations:
bearerAuthserviceAuth
Request Body schema: application/json
required
search_term
required
integer

The transaction ID to search for.

Responses

Request samples

Content type
application/json
{
  • "search_term": 1234
}

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

Storno and optionally refund a finished payment transaction

Stornos a previously finished payment. Takes the original transaction id and always creates the reversing transaction

With refund option as false (or not sent) it is a storno: only the credit note is issued, no money is moved, - any payment method accepted.

With refund=true it also refunds the full original amount at the payment provider. Currently supported for SimplePay, Stripe and Teya.

Requires a logged-in staff user with the payments_refund privilege.

Authorizations:
bearerAuth
Request Body schema: application/json
required
transaction_id
required
integer

The id of the original (finished) transaction to reverse

refund
boolean

When true, refund the full amount at the original payment provider AND issues the credit note. When false or omitted, only the credit is issued.

Responses

Request samples

Content type
application/json
{
  • "transaction_id": 1234,
  • "refund": false
}

Response samples

Content type
application/json
Example
{
  • "transaction_id": 1235,
  • "status": "FINISHED",
  • "message": "Refund processed."
}

Start a new payment process

Initiates a payment for a ticket. A JWT is optional

The endpoint validates the requested payment code against the template's available payment options, creates a transaction record, and calls the payment provider (SimplePay or Stripe Checkout). Returns the redirect URL for the payment provider's hosted payment page.

Request Body schema: application/json
required
ticket_id
required
integer

The ticket ID to pay for

code
required
string

The payment option code selected by the user. Format: {FEE_TYPE}-{CURRENCY}-{PROCESSOR} Examples: NORMAL-TOTAL-FEE-EUR-SIMPLE, FULL-FEE-HUF-STRIPE-INTENTS

required
object

Billing/invoicing data. document_type at least is required and determines the required billing fields.

Responses

Request samples

Content type
application/json
{
  • "ticket_id": 42,
  • "code": "NORMAL-TOTAL-FEE-EUR-SIMPLE",
  • "metas": {
    }
}

Response samples

Content type
application/json
{
  • "redirect_url": "string",
  • "transaction_id": 0
}

Get transactions for a ticket

Returns all transaction records associated with the given ticket ID, ordered by transaction ID ascending.

Requires the Priv payments_search permission.

Also requires ticket access via either Priv tickets_search_flags/years/events OR Priv tickets_get_flags/years/events (all three of whichever set). The ticket must match the user's allowed scope. Ticket access is verified via the tickets service.

Privilege name Sample values Description
Priv payments_search * true Grants access to view transactions. Without it, the request is denied with 403.
Priv tickets_search_flags/years/events HU,26,OZ Alternative ticket access - all three required within this set.
Priv tickets_get_flags/years/events HU,26,OZ Alternative ticket access - all three required within this set.
* payments_search is required; either tickets_search or tickets_get set is also required.
Authorizations:
bearerAuth
Request Body schema: application/json
required
ticket_id
required
integer

Ticket ID to retrieve transactions for

Responses

Request samples

Content type
application/json
{
  • "ticket_id": 42
}

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

Get transactions with logs for a ticket

Returns all transaction records associated with the given ticket ID, ordered by transaction ID ascending. Each transaction includes its log entries (ordered newest first) unless include_logs is set to false

This is a service endpoint - it can only be called by other microservices using a service JWT.

Authorizations:
serviceAuth
Request Body schema: application/json
required
ticket_id
required
integer

Ticket ID to retrieve transactions for

include_logs
boolean
Default: true

Whether to include each transaction's log entries. Defaults to true.

Responses

Request samples

Content type
application/json
{
  • "ticket_id": 42,
  • "include_logs": true
}

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

Query and finalize a Teya terminal payment

Queries the Teya POSLink API for the current status of one TEYA transaction and, when the terminal has reached a final state (SUCCESSFUL / FAILED / CANCELLED), records the result and (on success) advances the ticket. This is the on-demand fast path for the frontend.

Requires a logged-in staff user with access to the ticket (verified via the tickets service).

Authorizations:
bearerAuth
Request Body schema: application/json
required
transaction_id
required
integer

The TEYA transaction ID returned by /new

Responses

Request samples

Content type
application/json
{
  • "transaction_id": 1234
}

Response samples

Content type
application/json
{
  • "status": "SUCCESSFUL",
  • "finished": true,
  • "success": true
}

Get available payment options for a ticket

Returns the list of available payment options for a given ticket. The caller must provide the ticket_id, ticket_status, template, and optionally metas.

This is a service endpoint - it can only be called by other microservices using a service JWT.

Authorizations:
serviceAuth
Request Body schema: application/json
required
ticket_id
required
integer

The ticket ID

ticket_status
required
string

Current status of the ticket

template
required
object

The ticket's template (getFormattedListItem format)

Array of objects

Ticket metas (needed for transferred tickets' transfer_price_eur/huf)

Responses

Request samples

Content type
application/json
{
  • "ticket_id": 42,
  • "ticket_status": "registered",
  • "template": { },
  • "metas": [
    ]
}

Response samples

Content type
application/json
{
  • "payment_options": [
    ],
  • "payment_options_reason": "public context, include SIMPLE EUR, no valid payment_simplepay_huf, status registered, full price period, 1 options"
}

Get a single transaction

Returns one transaction by its id with the same data the tickets service /get-ticket returns in its transactions array: the transaction fields, the id of its storno transaction if there is one and its log entries.

Permissions

Requires the Priv payments_search permission.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
integer

Transaction ID

Responses

Request samples

Content type
application/json
{
  • "id": 1234
}

Response samples

Content type
application/json
{
  • "transaction": {
    }
}

Get ticket IDs linked to payments

Returns the distinct non-null ticket IDs referenced by transactions.

This is a service endpoint - it can only be called by other microservices using a service JWT.

Authorizations:
serviceAuth

Responses

Response samples

Content type
application/json
{
  • "ticket_ids": [
    ]
}

Get transactions

Searches for transactions using an array of sequential search steps. Each step has an action (extend, constrain or omit) and a search_fields object.

How the 'action' parameter works

The endpoint walks through the steps in order, maintaining a set of matched transactions. Each step modifies that set based on its action:

Action Description
extend Runs the search and adds the matching transactions to the current set. Used as the very first step it seeds the set; later steps add more transactions to it.
constrain Runs the search restricted to the current set, then keeps only the transactions that match. If the current set is empty, the step is skipped (no effect).
omit Runs the search restricted to the current set, then removes the matching transactions from it. If the current set is empty, the step is skipped (no effect).

Inside a single step, multiple search_fields are combined with AND. The first step should always be an extend - constrain and omit only operate on an existing set, so using them first is a no-op.

Search fields

FieldMatching
id_from / id_toTransaction id range (inclusive).
created_from / created_toCreation date range (inclusive), on the transaction's created_at. YYYY-MM-DD.
ticket_nrTicket number (e.g. HUDA2663434), resolved to the linked ticket id via the tickets service.
id_accountExact account id.
product_kindCase-insensitive substring match (e.g. COMPLEMENTARY, registration).
currencyExact, case-insensitive.
debitExact amount.
payment_modeCase-insensitive substring match.
backrefMatches the value against any value stored anywhere inside the backref jsonb.
ipnMatches the value against any value stored anywhere inside the ipn jsonb.
statusExact, case-insensitive.
document_typeExact, case-insensitive.
document_noExact, case-insensitive.

Permissions

Requires the Priv payments_search permission.

Authorizations:
bearerAuth
Request Body schema: application/json
required
Array (non-empty)
action
required
string
Enum: "extend" "constrain" "omit"
required
object

Responses

Request samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}