Skip to main content
POST
/
operations
Create operation
curl --request POST \
  --url https://api.openfiskal.com/v1/operations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'X-OpenFiskal-Merchant: <x-openfiskal-merchant>' \
  --data '
{
  "source": "POS",
  "currency": "USD",
  "pretax_amount": "9.00",
  "tax_amount": "0.95",
  "tip_amount": "0.00",
  "total_amount": "9.95",
  "line_items": [
    {
      "title": "Café Latte",
      "quantity": 2,
      "unit_price": "4.50",
      "total_amount": "9.00",
      "taxes": [
        {
          "name": "State SUT",
          "rate": "0.105",
          "tax_amount": "1.58"
        }
      ]
    }
  ],
  "type": "sale",
  "register_id": "reg_abc123",
  "external_id": "order-12345",
  "related_operation_id": "op_abc123",
  "note": "Customer requested extra napkins"
}
'
{
  "id": "<string>",
  "merchant_id": "<string>",
  "source": "POS",
  "status": "open",
  "currency": "EUR",
  "resource_version": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "pretax_amount": "<string>",
  "tax_amount": "<string>",
  "tip_amount": "<string>",
  "total_amount": "<string>",
  "line_items": [
    {
      "id": "<string>",
      "title": "<string>",
      "quantity": 123,
      "unit_price": "<string>",
      "total_amount": "<string>",
      "taxes": [
        {
          "id": "<string>",
          "name": "<string>",
          "rate": "<string>",
          "tax_amount": "<string>"
        }
      ]
    }
  ],
  "payments": [
    {
      "id": "<string>",
      "payment_id": "<string>",
      "method": "<string>",
      "amount": "<string>",
      "currency": "<string>",
      "status": "pending",
      "processor": "<string>",
      "card_brand": "<string>",
      "processor_reference": "<string>",
      "processed_at": "2023-11-07T05:31:56Z"
    }
  ],
  "type": "sale",
  "location_id": "<string>",
  "register_id": "<string>",
  "session_id": "<string>",
  "external_id": "<string>",
  "fiscal_information": {
    "regime": "KassenSichV",
    "document_number": "<string>",
    "document_type": "<string>",
    "tss_serial_number": "<string>",
    "pos_client_serial_number": "<string>",
    "signature_algorithm": "<string>",
    "time_format": "<string>",
    "start_event": {
      "signed_at": "2023-11-07T05:31:56Z"
    },
    "end_event": {
      "signed_at": "2023-11-07T05:31:56Z",
      "transaction_counter": 123,
      "signature": "<string>",
      "public_key": "<string>",
      "process_type": "<string>",
      "process_data": "<string>"
    },
    "verification": {
      "qr_data": "<string>"
    }
  },
  "completed_at": "2023-11-07T05:31:56Z",
  "voided_at": "2023-11-07T05:31:56Z",
  "void_reason": "<string>",
  "note": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://dev.openfiskal.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-OpenFiskal-Merchant
string
required

Merchant identifier returned by the merchants resource.

Idempotency-Key
string
required

Unique key per endpoint, merchant, and tenant. Retained for at least 24 hours.

Body

application/json

Discriminated request body. The type field selects the variant.

source
enum<string>
required
Available options:
POS,
ONLINE
Example:

"POS"

currency
string
required

ISO 4217 currency code

Example:

"USD"

pretax_amount
string
required

Total before taxes

Example:

"9.00"

tax_amount
string
required

Total tax amount

Example:

"0.95"

tip_amount
string
required

Tip amount

Example:

"0.00"

total_amount
string
required

Total amount (pretax + tax + tip)

Example:

"9.95"

line_items
object[]
required
type
enum<string>
required
Available options:
sale
Example:

"sale"

register_id
string

Required for POS, must be null for ONLINE.

Example:

"reg_abc123"

external_id
string

Merchant or POS identifier for the upstream order.

Example:

"order-12345"

For returns/exchanges: the OpenFiskal operation ID of the original sale. Exactly one of related_operation_id or external_related_operation must be set.

Example:

"op_abc123"

For returns/exchanges of sales that were never ingested into OpenFiskal (typically during platform migration). Exactly one of related_operation_id or external_related_operation must be set.

note
string
Example:

"Customer requested extra napkins"

Response

Operation created

id
string
required
merchant_id
string
required
source
enum<string>
required
Available options:
POS,
ONLINE
status
enum<string>
required
Available options:
open,
completed,
voided
currency
string
required

ISO 4217 currency code.

Example:

"EUR"

resource_version
number
required

Current server-issued version for the operation, starting at 1. Returned as ETag header.

created_at
string<date-time>
required
updated_at
string<date-time>
required
pretax_amount
string
required
tax_amount
string
required
tip_amount
string
required
total_amount
string
required
line_items
object[]
required
payments
object[]
required
type
enum<string>
required
Available options:
sale
Example:

"sale"

location_id
string | null

Only set for source: POS.

register_id
string | null

Only set for source: POS.

session_id
string | null

The RegisterSession this Operation is bound to. Set on every POS Operation; null for ONLINE goods-movement (no register, hence no session). On session-event variants this is the session being opened, adjusted, or closed; on goods-movement variants it is the session the operation was rung up during.

external_id
string | null

Merchant or POS identifier for the upstream order.

fiscal_information
FiscalInformationKassenSichV · object

The Fiskaly signature attached to this Operation, when one exists. Null until the operation has been signed.

completed_at
string<date-time> | null
voided_at
string<date-time> | null
void_reason
string | null
note
string | null

Merchant free-text note for the goods-movement event.