A nyugtát ugyanaz a metódus sztornózza, mint a számlát: a documents.cancel(). A kérés, az opciók és a hibák a Bizonylatok: Sztornó oldalon vannak, itt csak a nyugtára jellemző részek.
import { } from 'tarcajs'
const = ()
const = await ..({
: [{ : 'Kávé', : 2, : 600, : 27 }],
: 'bankcard',
})
const = await ..(. ?? 0, { : 'Hibás tétel.' })
.(., ., .)Ami a nyugta sztornóján más#
| Nyugta sztornója | Számla sztornója | |
|---|---|---|
type | receipt_cancellation | cancellation |
| Sorszám | a nyugtatömb következő száma, például NYT-2026-2 | a számlatömb következő száma |
| Végösszeg | a nyugta végösszege negatívan | ugyanígy |
Élőben a nyugta sztornója 200-zal jött, receipt_cancellation típussal, NYT-2026-3 sorszámmal. Az eredeti nyugta utána cancelled: true.
Visszatérítés#
Ha egy online fizetést visszatérítesz, a tarcajs/payments teljes visszatérítésnél sztornózza a nyugtát. Részleges visszatérítésnél nyugtán nem ír semmit, hanem refund-proposal javaslatot ad, amelyet kézzel intézel: Visszatérítés.
A nyugta vendorId-ja a sztornó után is foglalt. Ha ugyanazt a fizetést újra nyugtáznád, új vendorId kell.
Minta#
A példa kiállít egy 1 200 Ft-os kártyás nyugtát, sztornózza, és lekéri az eredetit. A sztornó NYT-2026-2 sorszámot és −1 200 Ft végösszeget kap, az eredeti cancelled mezője true, a paymentStatus none. Az Elküldött kérések fülön a sztornó törzs nélkül megy, mert a példa nem ad meg okot.
Nyugta és a sztornója: receipt_cancellation típus, negatív végösszeg a nyugtatömbben.
Futtatás a sandboxbanimport { } from 'tarcajs'
const = ()
const = await ..({
: [{ : 'Kávé', : 2, : 600, : 27 }],
: 'bankcard',
})
const = await ..(. ?? 0)
const = await ..(. ?? 0)
.('sztornó:', ., ., .)
.('az eredeti nyugta:', ., ., .)GET /document-blocks?per_page=100&type=receipt HTTP/1.1POST /documents/receipt HTTP/1.1
content-type: application/json
{
"type": "receipt",
"payment_method": "bankcard",
"currency": "HUF",
"electronic": false,
"items": [
{
"name": "Kávé",
"unit_price": 600,
"vat": "27%",
"quantity": 2,
"unit": "db"
}
],
"block_id": 2
}POST /documents/1/cancel HTTP/1.1GET /documents/1 HTTP/1.1HTTP/1.1 200
content-type: application/json
{
"total": 1,
"per_page": 100,
"current_page": 1,
"last_page": 1,
"prev_page_url": null,
"next_page_url": null,
"data": [
{
"id": 2,
"name": "Nyugták",
"prefix": "NYT",
"custom_field1": "",
"custom_field2": "",
"type": "receipt"
}
]
}HTTP/1.1 201
content-type: application/json
{
"id": 1,
"invoice_number": "NYT-2026-1",
"type": "receipt",
"cancelled": false,
"block_id": 2,
"payment_status": "paid",
"payment_method": "bankcard",
"gross_total": 1200,
"currency": "HUF",
"conversion_rate": 1,
"invoice_date": "2026-11-16",
"fulfillment_date": "2026-11-16",
"due_date": "2026-11-16",
"paid_date": "2026-11-16",
"organization": {
"name": "Hamis Billingo teszt szervezet",
"tax_number": "00000000-0-00",
"bank_account": {
"id": null,
"name": "",
"account_number": "",
"account_number_iban": "",
"swift": ""
},
"address": {
"country_code": "HU",
"post_code": "1011",
"city": "Budapest",
"address": "Fő utca 1."
},
"small_taxpayer": false,
"ev_number": "",
"eu_tax_number": "",
"cash_settled": false
},
"partner": {
"id": 1,
"name": "Magánszemély",
"address": {
"country_code": "",
"post_code": "",
"city": "",
"address": ""
},
"emails": [],
"taxcode": "",
"iban": "",
"swift": "",
"account_number": "",
"phone": "",
"general_ledger_number": "",
"tax_type": "",
"custom_billing_settings": {
"payment_method": null,
"document_form": null,
"due_days": null,
"document_currency": null,
"template_language_code": null,
"discount": null,
"custom_label": null
},
"group_member_tax_number": "",
"giro_settings": {
"giro_default_settings": true,
"giro_payment_request_enabled": false,
"giro_different_amount_allowed": false
},
"partner_shipping": {
"match": true,
"name": "",
"mode": "none",
"address": {
"country_code": "HU",
"post_code": "",
"city": "",
"address": ""
}
},
"internal_comment": "",
"partner_show_type": null
},
"document_partner": {
"id": 1,
"name": "Magánszemély",
"address": {
"country_code": "",
"post_code": "",
"city": "",
"address": ""
},
"emails": [],
"taxcode": "",
"iban": "",
"swift": "",
"account_number": "",
"phone": "",
"tax_type": "",
"partner_shipping": {
"match": true,
"name": "",
"mode": "none",
"address": {
"country_code": "HU",
"post_code": "",
"city": "",
"address": ""
}
}
},
"electronic": false,
"comment": "",
"tags": [],
"notification_status": "none",
"language": "hu",
"items": [
{
"product_id": null,
"name": "Kávé",
"net_unit_amount": 472.440945,
"quantity": 2,
"unit": "db",
"net_amount": 944.88,
"gross_amount": 1200,
"vat": "27%",
"vat_amount": 255.12,
"entitlement": null,
"comment": "",
"sku": null,
"data_eraser_codes": null,
"is_deposit_fee": false,
"ean": null,
"is_connect_product": false,
"connected_item": null,
"connect_document_item_setting": null
}
],
"summary": {
"net_amount": 944.88,
"net_amount_local": 944.88,
"gross_amount_local": 1200,
"vat_amount": 255.12,
"vat_amount_local": 255,
"vat_rate_summary": [
{
"vat_name": "27%",
"vat_percentage": 0.27,
"vat_rate_net_amount": 944.88,
"vat_rate_vat_amount": 255.12,
"vat_rate_vat_amount_local": 255,
"vat_rate_gross_amount": 1200
}
]
},
"settings": {
"mediated_service": false,
"without_financial_fulfillment": false,
"online_payment": "no",
"should_send_email": false,
"round": "none",
"no_send_onlineszamla_by_user": false,
"dont_send_to_nav_reason": null,
"order_number": "",
"place_id": null,
"instant_payment": true,
"selected_type": "receipt",
"instant_payment_request": null,
"is_waybill_hide_prices": false
},
"online_szamla_status": "processing",
"kobak_receipt_status": "pending",
"kobak_receipt_message": null,
"related_documents": [],
"discount": null,
"correction_type": "receipt",
"recurring_id": null
}HTTP/1.1 200
content-type: application/json
{
"id": 2,
"invoice_number": "NYT-2026-2",
"type": "receipt_cancellation",
"cancelled": false,
"block_id": 2,
"payment_status": "none",
"payment_method": "bankcard",
"gross_total": -1200,
"currency": "HUF",
"conversion_rate": 1,
"invoice_date": "2026-11-16",
"fulfillment_date": "2026-11-16",
"due_date": "2026-11-16",
"paid_date": "2026-11-16",
"organization": {
"name": "Hamis Billingo teszt szervezet",
"tax_number": "00000000-0-00",
"bank_account": {
"id": null,
"name": "",
"account_number": "",
"account_number_iban": "",
"swift": ""
},
"address": {
"country_code": "HU",
"post_code": "1011",
"city": "Budapest",
"address": "Fő utca 1."
},
"small_taxpayer": false,
"ev_number": "",
"eu_tax_number": "",
"cash_settled": false
},
"partner": {
"id": 1,
"name": "Magánszemély",
"address": {
"country_code": "",
"post_code": "",
"city": "",
"address": ""
},
"emails": [],
"taxcode": "",
"iban": "",
"swift": "",
"account_number": "",
"phone": "",
"general_ledger_number": "",
"tax_type": "",
"custom_billing_settings": {
"payment_method": null,
"document_form": null,
"due_days": null,
"document_currency": null,
"template_language_code": null,
"discount": null,
"custom_label": null
},
"group_member_tax_number": "",
"giro_settings": {
"giro_default_settings": true,
"giro_payment_request_enabled": false,
"giro_different_amount_allowed": false
},
"partner_shipping": {
"match": true,
"name": "",
"mode": "none",
"address": {
"country_code": "HU",
"post_code": "",
"city": "",
"address": ""
}
},
"internal_comment": "",
"partner_show_type": null
},
"document_partner": {
"id": 1,
"name": "Magánszemély",
"address": {
"country_code": "",
"post_code": "",
"city": "",
"address": ""
},
"emails": [],
"taxcode": "",
"iban": "",
"swift": "",
"account_number": "",
"phone": "",
"tax_type": "",
"partner_shipping": {
"match": true,
"name": "",
"mode": "none",
"address": {
"country_code": "HU",
"post_code": "",
"city": "",
"address": ""
}
}
},
"electronic": false,
"comment": "",
"tags": [],
"notification_status": "none",
"language": "hu",
"items": [
{
"product_id": null,
"name": "Kávé",
"net_unit_amount": -472.440945,
"quantity": 2,
"unit": "db",
"net_amount": -944.88,
"gross_amount": -1200,
"vat": "27%",
"vat_amount": -255.12,
"entitlement": null,
"comment": "",
"sku": null,
"data_eraser_codes": null,
"is_deposit_fee": false,
"ean": null,
"is_connect_product": false,
"connected_item": null,
"connect_document_item_setting": null
}
],
"summary": {
"net_amount": -944.88,
"net_amount_local": -944.88,
"gross_amount_local": -1200,
"vat_amount": -255.12,
"vat_amount_local": -255,
"vat_rate_summary": [
{
"vat_name": "27%",
"vat_percentage": 0.27,
"vat_rate_net_amount": -944.88,
"vat_rate_vat_amount": -255.12,
"vat_rate_vat_amount_local": -255,
"vat_rate_gross_amount": -1200
}
]
},
"settings": {
"mediated_service": false,
"without_financial_fulfillment": false,
"online_payment": "no",
"should_send_email": false,
"round": "none",
"no_send_onlineszamla_by_user": false,
"dont_send_to_nav_reason": null,
"order_number": "",
"place_id": null,
"instant_payment": true,
"selected_type": "receipt",
"instant_payment_request": null,
"is_waybill_hide_prices": false
},
"online_szamla_status": "processing",
"kobak_receipt_status": "pending",
"kobak_receipt_message": null,
"related_documents": [
{
"id": 1,
"invoice_number": "NYT-2026-1"
}
],
"discount": null,
"correction_type": "receipt_cancellation",
"recurring_id": null
}HTTP/1.1 200
content-type: application/json
{
"id": 1,
"invoice_number": "NYT-2026-1",
"type": "receipt",
"cancelled": true,
"block_id": 2,
"payment_status": "none",
"payment_method": "bankcard",
"gross_total": 1200,
"currency": "HUF",
"conversion_rate": 1,
"invoice_date": "2026-11-16",
"fulfillment_date": "2026-11-16",
"due_date": "2026-11-16",
"paid_date": "2026-11-16",
"organization": {
"name": "Hamis Billingo teszt szervezet",
"tax_number": "00000000-0-00",
"bank_account": {
"id": null,
"name": "",
"account_number": "",
"account_number_iban": "",
"swift": ""
},
"address": {
"country_code": "HU",
"post_code": "1011",
"city": "Budapest",
"address": "Fő utca 1."
},
"small_taxpayer": false,
"ev_number": "",
"eu_tax_number": "",
"cash_settled": false
},
"partner": {
"id": 1,
"name": "Magánszemély",
"address": {
"country_code": "",
"post_code": "",
"city": "",
"address": ""
},
"emails": [],
"taxcode": "",
"iban": "",
"swift": "",
"account_number": "",
"phone": "",
"general_ledger_number": "",
"tax_type": "",
"custom_billing_settings": {
"payment_method": null,
"document_form": null,
"due_days": null,
"document_currency": null,
"template_language_code": null,
"discount": null,
"custom_label": null
},
"group_member_tax_number": "",
"giro_settings": {
"giro_default_settings": true,
"giro_payment_request_enabled": false,
"giro_different_amount_allowed": false
},
"partner_shipping": {
"match": true,
"name": "",
"mode": "none",
"address": {
"country_code": "HU",
"post_code": "",
"city": "",
"address": ""
}
},
"internal_comment": "",
"partner_show_type": null
},
"document_partner": {
"id": 1,
"name": "Magánszemély",
"address": {
"country_code": "",
"post_code": "",
"city": "",
"address": ""
},
"emails": [],
"taxcode": "",
"iban": "",
"swift": "",
"account_number": "",
"phone": "",
"tax_type": "",
"partner_shipping": {
"match": true,
"name": "",
"mode": "none",
"address": {
"country_code": "HU",
"post_code": "",
"city": "",
"address": ""
}
}
},
"electronic": false,
"comment": "",
"tags": [],
"notification_status": "none",
"language": "hu",
"items": [
{
"product_id": null,
"name": "Kávé",
"net_unit_amount": 472.440945,
"quantity": 2,
"unit": "db",
"net_amount": 944.88,
"gross_amount": 1200,
"vat": "27%",
"vat_amount": 255.12,
"entitlement": null,
"comment": "",
"sku": null,
"data_eraser_codes": null,
"is_deposit_fee": false,
"ean": null,
"is_connect_product": false,
"connected_item": null,
"connect_document_item_setting": null
}
],
"summary": {
"net_amount": 944.88,
"net_amount_local": 944.88,
"gross_amount_local": 1200,
"vat_amount": 255.12,
"vat_amount_local": 255,
"vat_rate_summary": [
{
"vat_name": "27%",
"vat_percentage": 0.27,
"vat_rate_net_amount": 944.88,
"vat_rate_vat_amount": 255.12,
"vat_rate_vat_amount_local": 255,
"vat_rate_gross_amount": 1200
}
]
},
"settings": {
"mediated_service": false,
"without_financial_fulfillment": false,
"online_payment": "no",
"should_send_email": false,
"round": "none",
"no_send_onlineszamla_by_user": false,
"dont_send_to_nav_reason": null,
"order_number": "",
"place_id": null,
"instant_payment": true,
"selected_type": "receipt",
"instant_payment_request": null,
"is_waybill_hide_prices": false
},
"online_szamla_status": "no_online_szamla_settings",
"kobak_receipt_status": "pending",
"kobak_receipt_message": null,
"related_documents": [],
"discount": null,
"correction_type": "canceled",
"recurring_id": null
}sztornó: NYT-2026-2 receipt_cancellation -1200
az eredeti nyugta: NYT-2026-1 true none