영수증 데이터 참조
WCPOS 로직리스 HTML 템플릿과 열전사 XML 템플릿은 동일한 표준 영수증 페이로드에서 렌더링됩니다. {{order.number}}, {{store.name}}, {{totals.total_display}}와 같은 Mustache 점 경로를 사용합니다. 배열은 섹션으로 렌더링됩니다:
{{#lines}}
{{name}} x {{qty}} — {{line_total_display}}
{{/lines}}
표준 계약은 서버의 WCPOS 영수증 데이터 빌더에서 생성되며, 앱의 오프라인 영수증 렌더러에서 미러링됩니다. 영수증은 로컬 데이터에서 즉시 열리고 서버 응답이 사용 가능해지면 해당 응답으로 업그레이드되므로, 사용자 정의 템플릿에서는 PHP 주문 메서드 대신 아래 필드를 사용해야 합니다.
영수증 데이터 v1.1에는 각 상품 라인에 대해 기록된 정가, 쿠폰 적용 전 판매가, 절약액 필드가 추가되었습니다. 또한 주문 단위 절약 합계도 제공되며, 여기에는 정가 대비 절약액과 WooCommerce 할인을 합산한 총 절약액 값이 포함됩니다. 이 값은 주문 합계나 리포트를 변경하지 않습니다.
영수증 구조 지도
인쇄된 영수증의 모든 부분은 데이터 계약의 한 섹션에서 나옵니다. 양쪽에 마우스를 올리면 대응 관계가 보이고, 클릭하면 해당 섹션의 필드로 이동합니다. 이 페이지의 모든 예시는 동일한 샘플 주문을 사용합니다.
store.name · store.address_lines · store.tax_ids · store.logoorder.number · order.created · cashier.name · customer.namelines[] · line_savings · savings_in_discountstotals.* · discounts[] · fees[] · shipping[] · totals.total_savedpayments[]store.personal_notes · store.policies_and_conditions · i18n.thank_you_purchase자주 쓰는 레시피
대부분의 템플릿 수정은 이 세 가지 중 하나입니다. 각 카드는 인쇄 결과를 먼저 보여준 다음 정확한 마크업을 보여줍니다 — 로직리스 HTML이든 열전사 XML이든 그대로 복사해 넣으면 됩니다. 세 번째 카드는 위의 샘플 주문이 아니라 v1.9 이전의 레거시 주문을 보여줍니다.
{{#lines}}
{{#line_savings}}
<s>{{line_regular_total_display}}</s>
{{i18n.savings}}: -{{line_savings_display}}
{{/line_savings}}
{{/lines}}{{#totals.total_saved_complete}}
{{#totals.total_saved}}
{{i18n.total_saved}}:
{{totals.total_saved_display}}
{{/totals.total_saved}}
{{/totals.total_saved_complete}}{{#lines}}
{{#line_savings}}
{{^savings_in_discounts}}
{{i18n.savings}}: -{{line_savings_display}}
{{/savings_in_discounts}}
{{/line_savings}}
{{/lines}}렌더링 규칙
통화 필드
숫자 금액 필드는 숫자로 유지되며, 렌더러가 템플릿 출력용으로 로케일 인식 _display 필드를 추가합니다:
| 숫자 필드 | 표시 필드 |
|---|---|
totals.total | totals.total_display |
lines[].line_total | lines[].line_total_display |
payments[].amount | payments[].amount_display |
tax_summary[].tax_amount | tax_summary[].tax_amount_display |
영수증 인쇄 시 _display 필드를 사용하는 것이 좋습니다. 숫자 필드는 조건부 섹션이나 기계 판독용 출력에만 사용하십시오.
세금 표시 관련 필드
여러 필드에는 세금 포함 및 세금 제외 변형과 함께 표시용 편의 값이 있습니다. 편의 값은 매장의 장바구니 세금 표시 설정을 따릅니다.
| 편의 필드 | 세금 포함 필드 | 세금 제외 필드 |
|---|---|---|
lines[].regular_price | lines[].regular_price_incl | lines[].regular_price_excl |
lines[].selling_price | lines[].selling_price_incl | lines[].selling_price_excl |
lines[].unit_savings | lines[].unit_savings_incl | lines[].unit_savings_excl |
lines[].line_regular_total | lines[].line_regular_total_incl | lines[].line_regular_total_excl |
lines[].line_selling_total | lines[].line_selling_total_incl | lines[].line_selling_total_excl |
lines[].line_savings | lines[].line_savings_incl | lines[].line_savings_excl |
lines[].unit_price | lines[].unit_price_incl | lines[].unit_price_excl |
lines[].unit_subtotal | lines[].unit_subtotal_incl | lines[].unit_subtotal_excl |
lines[].line_subtotal | lines[].line_subtotal_incl | lines[].line_subtotal_excl |
lines[].discounts | lines[].discounts_incl | lines[].discounts_excl |
lines[].line_total | lines[].line_total_incl | lines[].line_total_excl |
fees[].total | fees[].total_incl | fees[].total_excl |
shipping[].total | shipping[].total_incl | shipping[].total_excl |
discounts[].total | discounts[].total_incl | discounts[].total_excl |
totals.subtotal | totals.subtotal_incl | totals.subtotal_excl |
totals.discount_total | totals.discount_total_incl | totals.discount_total_excl |
totals.sale_savings_total | totals.sale_savings_total_incl | totals.sale_savings_total_excl |
totals.total_saved | totals.total_saved_incl | totals.total_saved_excl |
totals.total | totals.total_incl | totals.total_excl |
날짜 객체
날짜 필드는 미리 포맷된 여러 변형을 포함하는 객체입니다. Mustache 내부에서 날짜 포맷을 처리할 필요가 없습니다.
| 필드 | 설명 |
|---|---|
datetime, date, time | 기본 날짜/시간 문자열 |
datetime_short, datetime_long, datetime_full | 로케일 기반 결합 형식 |
date_short, date_long, date_full | 로케일 기반 날짜 전용 형식 |
date_ymd, date_dmy, date_mdy | 고정 순서 날짜 형식 |
weekday_short, weekday_long | 요일 이름 |
day, month, month_short, month_long, year | 개별 날짜 구성 요소 |
사용 가능한 날짜 객체: order.created, order.paid, order.completed, order.printed, refunds[].date. order.printed는 렌더링 시점에 갱신되므로 재인쇄 시 유용합니다.
최상위 섹션
| 섹션 | 타입 | 설명 |
|---|---|---|
order | object | 주문 식별 정보, 상태, 날짜, 메모, 결제 URL 정보 |
store | object | 매장 식별 정보, 주소, 연락처, 세금 ID, 로고, 영업시간, 푸터 텍스트 |
cashier | object | 주문을 처리한 사용자 |
customer | object | 고객 표시 이름, 주소, 세금 ID |
lines | array | 상품 항목 |
fees | array | 수수료 항목 |
shipping | array | 배송 항목 |
discounts | array | 쿠폰/할인 항목 |
totals | object | 주문 합계, 결제 합계, 환불 요약 및 항목 수 |
tax | object | 섹션 가드를 위한 세금 표시 모드 플래그 |
tax_summary | array | 세율별 세금 요약 항목 |
has_tax_summary | boolean | tax_summary 존재 여부 확인용 편의 가드 |
payments | array | 결제 항목 |
refunds | array | 주문에 적용된 환불 내역 |
fiscal | object | 재정 통합에 의해 채워지는 재정 스냅샷 필드 |
presentation_hints | object | 서식 및 렌더러 힌트 |
i18n | object | 기본 제공 및 사용자 정의 템플릿용 번역된 레이블 |
가격들의 관계
하나의 상품 라인에는 여러 가격이 담기며, 실제 금액 위에서 보면 이름의 의미가 분명해집니다. 아래는 샘플 주문의 에스프레소 라인입니다 — 정가 $17.00인 상품이 $14.50에 판매되고, 그 위에 10% 쿠폰이 적용되었습니다:
unit_price → 13.05 · line_total → 26.10lines[].discounts → 2.90 on this lineunit_savings → 2.50 · line_savings → 5.00totals.sale_savings_total = 5.00totals.discount_total = 5.28totals.total_saved = 10.28판매 절약액과 쿠폰 할인은 서로 다른 개념입니다. 판매 절약액은 판매가를 기록된 정가와 비교한 값이고, discounts는 WooCommerce 자체의 쿠폰 계산 결과입니다. WooCommerce 주문 합계와 리포트에는 쿠폰 부분만 포함되며, 그래서 두 가지를 합쳐 고객에게 보여주는 단일 수치로 total_saved가 존재합니다.
필드 참조
전체 필드 참조는 아래에 섹션별로 그룹화되어 있습니다. 모든 항목은 기본적으로 접혀 있으니 필요한 그룹을 펼치세요.
order — 식별 정보, 상태, 날짜
order
| 필드 | 타입 | 예시 / 설명 |
|---|---|---|
order.id | number | 1042 |
order.number | string | 사용자에게 표시되는 주문 번호, 예: "1042" |
order.currency | string | ISO 통화 코드, 예: "USD" |
order.customer_note | string | 고객/주문 메모 |
order.wc_status | string | WooCommerce 상태 슬러그 원본값, 예: "processing" |
order.status_label | string | 사용자 정의 상태를 포함한 현지화된 상태 레이블 |
order.created_via | string | 출처/채널, 예: "woocommerce-pos" |
order.needs_payment | boolean | 결제 섹션 표시 여부 |
order.payment_url | string | 사용 가능한 경우 주문 결제 URL |
order.created | date object | 주문 생성 날짜 |
order.paid | date object | 결제 날짜, 미결제 시 빈 문자열 |
order.completed | date object | 완료 날짜, 미완료 시 빈 문자열 |
order.printed | date object | 렌더링 시점의 인쇄/재인쇄 타임스탬프 |
store — 식별 정보, 주소, 연락처, 영업시간
store
| 필드 | 타입 | 예시 / 설명 |
|---|---|---|
store.id | number | 매장 ID, 삭제된 매장의 경우 이전 ID |
store.name | string | 매장 표시 이름 |
store.address.address_1 | string | 도로명 주소 1 |
store.address.address_2 | string | 상세 주소 |
store.address.city | string | 시/구/군 |
store.address.state | string | 시/도 |
store.address.postcode | string | 우편번호 |
store.address.country | string | ISO 국가 코드 |
store.address_lines | array | 미리 서식이 지정된 주소 줄; 대부분의 템플릿에 권장 |
store.tax_ids | array | 구조화된 사업자 등록번호; 단일 세금 ID 대신 이 배열을 반복 사용 |
store.phone | string | 매장 전화번호 |
store.email | string | 매장 이메일 |
store.logo | string/null | 매장 로고 URL 또는 데이터 URI |
store.opening_hours | string/null | 간략한 영업시간 텍스트 |
store.opening_hours_vertical | string/null | 여러 줄 영업시간 블록 |
store.opening_hours_inline | string/null | 쉼표로 구분된 영업시간 텍스트 |
store.opening_hours_notes | string/null | 영업시간 관련 자유 텍스트 메모 |
store.personal_notes | string/null | 영수증 하단/개인 메모 |
store.policies_and_conditions | string/null | 환불, 반품 또는 이용약관 텍스트 |
store.footer_imprint | string/null | 법적 고지 하단 문구 |
세금 ID 객체
store.tax_ids와 customer.tax_ids는 동일한 구조의 객체를 포함합니다:
| 필드 | 타입 | 설명 |
|---|---|---|
type | string | eu_vat, de_steuernummer, au_abn, br_cpf, us_ein 또는 other와 같은 식별자 |
value | string | 인쇄할 세금 ID 값 |
country | string/null | 확인된 경우 ISO 국가 코드 |
label | string/null | 렌더링 전에 결정되는 현지화된 표시 라벨 |
예시:
{{#store.tax_ids}}
{{label}}: {{value}}
{{/store.tax_ids}}
cashier — 주문을 처리한 사용자
cashier
| 필드 | 타입 | 예시 / 설명 |
|---|---|---|
cashier.id | number | WordPress 사용자 ID, 알 수 없는 경우 0 |
cashier.name | string | 계산원 표시 이름 |
customer — 이름, 주소, 세금 ID
customer
| 필드 | 타입 | 예시 / 설명 |
|---|---|---|
customer.id | number/null | 고객 ID, 비회원의 경우 null |
customer.name | string | 고객 표시 이름 또는 비회원 라벨 |
customer.billing_address.* | object | WooCommerce 청구 주소 필드 |
customer.shipping_address.* | object | WooCommerce 배송 주소 필드 |
customer.tax_ids | array | 주문에서 스냅샷된 고객 세금 ID 구조 |
일반적인 주소 키에는 first_name, last_name, company, address_1, address_2, city, state, postcode, country, email, phone이 포함됩니다.
lines — 상품 항목
lines
{{#lines}}...{{/lines}}로 반복합니다. 샘플 값은 샘플 주문의 에스프레소 라인입니다.
모든 금액 필드는 쌍으로 제공됩니다. 숫자 값({{#…}} 가드에 사용하세요 — 0과 null은 섹션을 숨기며, null 필드에는 _display 짝이 아예 없습니다)과 인쇄용 _display 문자열입니다. incl/excl 표시가 있는 필드는 _incl과 _excl 변형도 제공되며, 각각 자체 _display를 가집니다.
null이므로 섹션으로 감싸세요.discounts에 포함된 v1.9.0 이전 주문에서 true입니다 — 중복 계산 방지 플래그입니다.{key, value} 쌍으로 구성된 주문 항목 메타입니다.{key, value} 쌍으로 구성된 상품/옵션 속성입니다.정가 및 절약액 표시하기
단가 기준 레이아웃에서는 기록된 정가, 판매가, 절약액을 다음과 같이 표시합니다:
{{#lines}}
{{#unit_savings}}
<span style="text-decoration: line-through;">{{regular_price_display}}</span>
<span>{{selling_price_display}}</span>
<span>{{i18n.savings}}: -{{unit_savings_display}}</span>
{{/unit_savings}}
{{/lines}}
수량이 중요한 경우에는 라인 합계 필드를 사용하세요:
{{#lines}}
{{#line_savings}}
<span style="text-decoration: line-through;">{{line_regular_total_display}}</span>
<span>{{i18n.savings}}: -{{line_savings_display}}</span>
{{/line_savings}}
{{/lines}}
selling_price는 쿠폰 적용 전 가격입니다. WooCommerce 할인 적용 후의 최종 금액에는 unit_price 또는 line_total을 사용하세요.
이전 WCPOS 주문에는 정가에서 판매가로의 인하분이 이미 discounts에 포함되어 있을 수 있습니다. 사용자 정의 템플릿에서 라인 절약액과 라인 할인을 모두 인쇄한다면, 동일한 인하분이 두 번 표시되지 않도록 savings_in_discounts를 사용하세요:
{{#lines}}
{{#line_savings}}
<span style="text-decoration: line-through;">{{line_regular_total_display}}</span>
{{^savings_in_discounts}}
<span>{{i18n.savings}}: -{{line_savings_display}}</span>
{{/savings_in_discounts}}
{{/line_savings}}
{{#discounts}}
<span>{{i18n.discount}}: -{{discounts_display}}</span>
{{/discounts}}
{{/lines}}
템플릿이 라인 단위 discounts 행을 인쇄하지 않는다면 savings_in_discounts가 true여도 line_savings를 계속 표시하세요. 기본 제공 템플릿은 이 구분을 자동으로 처리합니다.
fees 및 shipping
fees 및 shipping
{{#fees}}...{{/fees}} 및 {{#shipping}}...{{/shipping}}으로 반복합니다.
| 필드 | 타입 | 설명 |
|---|---|---|
label | string | 수수료 라벨 또는 배송 방법 이름 |
method_id | string | 배송 방법 ID (배송에만 해당) |
total / _incl / _excl | number | 표시용, 세금 포함, 세금 제외 합계 |
taxes | array | 세율별 세금 행 |
meta | array | {key, value} 메타 쌍 |
서식 적용 변형: total_display, total_incl_display, total_excl_display.
discounts — 쿠폰/할인 항목
discounts
{{#discounts}}...{{/discounts}}로 반복합니다.
| 필드 | 타입 | 설명 |
|---|---|---|
label | string | 쿠폰 설명 또는 코드 대체값 |
code | string | 쿠폰 코드 |
total / _incl / _excl | number | 양수 값으로 표시된 할인 금액 |
서식 적용 변형: total_display, total_incl_display, total_excl_display. 할인을 음수 행으로 표시하려면 템플릿에 직접 마이너스 기호를 추가하십시오.
totals — 주문, 결제, 환불 및 항목 합계
totals
샘플 값은 샘플 주문에서 가져온 것이며, 이 주문은 이후 $7.25의 부분 환불을 받았습니다.
금액 필드는 라인 항목과 동일한 쌍 구조를 따릅니다. 가드용 숫자 값과 인쇄용 _display 문자열이 있으며, 표시된 항목에는 _incl/_excl 변형이 함께 제공됩니다.
절약한 모든 금액을 고객에게 하나의 수치로 보여주고 싶다면 total_saved를 사용하세요. 템플릿에서 discount_total과 sale_savings_total을 더해 직접 계산하지 마세요. v1.9.0 이전에 생성된 주문은 POS 가격 절약액이 이미 WooCommerce 할인 합계에 포함되어 있을 수 있습니다. 표준 total_saved 필드는 이 중복을 감지하여 제거합니다.
어떤 상품 라인이든 신뢰할 수 있는 집계를 내기에 충분한 가격 데이터가 기록되어 있지 않으면 절약 합계는 null이 되고 total_saved_complete는 false가 됩니다. 먼저 total_saved_complete로 행을 감싼 다음, total_saved로 0인 값을 숨기세요:
{{#totals.total_saved_complete}}
{{#totals.total_saved}}
<span>{{i18n.total_saved}}: {{totals.total_saved_display}}</span>
{{/totals.total_saved}}
{{/totals.total_saved_complete}}
가격을 표시하는 기본 제공 템플릿은 세금 포함 변형(total_saved_incl 및 total_saved_incl_display)으로 동일한 가드 구조를 사용하며, 완전한 값이 0보다 클 때만 총 절약액을 표시합니다.
tax 및 tax_summary — 표시 가드 및 세율별 행
tax 및 tax_summary
표시 모드 조건에는 tax를, 항목별 세율 행에는 tax_summary를 사용하십시오.
| 세금 필드 | 타입 | 설명 |
|---|---|---|
tax.display | string | incl 또는 excl |
tax.display_incl | boolean | 가격이 세금 포함으로 표시될 때 True |
tax.display_excl | boolean | 가격이 세금 별도로 표시될 때 True |
tax.breakdown | string | hidden, single, 또는 itemized |
tax.breakdown_hidden | boolean | 세금 행이 숨겨져야 할 때 True |
tax.breakdown_single | boolean | 단일 세금 합계가 선호될 때 True |
tax.breakdown_itemized | boolean | 세율별 행이 선호될 때 True |
has_tax_summary | boolean | tax_summary에 행이 포함되어 있을 때 True |
tax_summary를 {{#tax_summary}}...{{/tax_summary}}로 반복합니다.
| 필드 | 타입 | 설명 |
|---|---|---|
code | string | 세율 ID/코드 |
rate | number/null | 확인된 세율 백분율 |
label | string | 세율 라벨 |
compound | boolean | 복합 세율 여부 |
taxable_amount_excl | number/null | 세금 제외 과세 기준 금액 |
tax_amount | number | 징수된 세액 |
taxable_amount_incl | number/null | 세금 포함 과세 기준 금액 |
서식이 적용된 변형: taxable_amount_excl_display, tax_amount_display, taxable_amount_incl_display.
payments — 결제 항목
payments
{{#payments}}...{{/payments}}로 반복합니다.
| 필드 | 타입 | 설명 |
|---|---|---|
method_id | string | 결제 방법 식별자 |
method_title | string | 결제 방법 표시 이름 |
amount | number | 주문에 적용된 금액 |
transaction_id | string | 게이트웨이 거래 ID |
tendered | number | 현금 지불 금액(있는 경우) |
change | number | 현금 거스름돈(있는 경우) |
서식 적용 변형: amount_display, tendered_display, change_display.
refunds — 환불 내역
refunds
{{#refunds}}...{{/refunds}}로 반복합니다. 환불 금액은 양수 절대값이며, 마이너스 기호를 앞에 붙이거나 별도의 반품 항목 블록을 렌더링할지는 템플릿에서 결정합니다.
| 필드 | 타입 | 설명 |
|---|---|---|
id | number | 환불 레코드 ID |
date | date object | 환불 생성 날짜 |
amount | number | 환불 합계 |
subtotal | number | 환불된 항목 소계 |
tax_total | number | 환불된 세금 |
shipping_total | number | 환불된 배송비 |
shipping_tax | number | 환불된 배송 세금 |
reason | string | 환불 사유 |
refunded_by_id | number/null | 환불을 처리한 사용자 ID |
refunded_by_name | string | 환불을 처리한 사용자 표시 이름 |
refunded_payment | boolean | 결제 게이트웨이를 통해 결제가 환불되었는지 여부 |
destination | string | original_method, cash, 또는 manual |
gateway_id | string | 환불에 사용된 게이트웨이 ID |
gateway_title | string | 게이트웨이 표시 제목 |
processing_mode | string | 공급자/수동 처리 모드 |
lines | array | 환불된 상품 행 |
fees | array | 환불된 수수료 행 |
shipping | array | 환불된 배송 행 |
환불 항목 필드에는 name, sku, qty, total, total_incl, total_excl, line_total, unit_total, taxes가 포함됩니다. 환불 수수료 및 배송 행은 label, total, total_incl, total_excl, taxes를 사용합니다. 합계 및 세액에 대해 표시 변형이 추가됩니다.
fiscal — 재정 통합 스냅샷
fiscal
fiscal 필드는 기본적으로 비어 있으며, 재정 통합 또는 WCPOS Pro 스냅샷 보강을 통해 채워집니다.
| 필드 | 타입 | 설명 |
|---|---|---|
fiscal.immutable_id | string | 불변 재정 식별자 |
fiscal.receipt_number | string | 재정 영수증 번호 |
fiscal.sequence | number/null | 시퀀스 카운터 |
fiscal.hash | string | 해시/서명 값 |
fiscal.qr_payload | string | 세금 검증용 QR 페이로드 |
fiscal.tax_agency_code | string | 세무 당국 코드 |
fiscal.signed_at | string | 세금 서명 타임스탬프 |
fiscal.signature_excerpt | string | 표시용 서명 발췌 |
fiscal.document_label | string | 문서 라벨 (예: 세금계산서) |
fiscal.is_reprint | boolean | 재인쇄 여부 |
fiscal.reprint_count | number | 재인쇄 횟수 |
fiscal.extra_fields | array/object | 관할권별 고유 값 |
presentation_hints — 서식 및 렌더러 힌트
presentation_hints
이 필드들은 주로 렌더러와 포매터에서 사용됩니다. 필요 시 템플릿에서도 사용할 수 있습니다.
| 필드 | 타입 | 설명 |
|---|---|---|
presentation_hints.display_tax | string | incl, excl, hidden, itemized 또는 single |
presentation_hints.prices_entered_with_tax | boolean | 카탈로그 가격에 세금이 포함되어 있는지 여부 |
presentation_hints.rounding_mode | string | WooCommerce 세금 반올림 설정 |
presentation_hints.locale | string | 서식 지정에 사용되는 로케일 |
presentation_hints.timezone | string | 영수증 시간대 |
presentation_hints.currency_position | string | 통화 기호 위치 |
presentation_hints.currency_symbol | string | 통화 기호 |
presentation_hints.price_thousand_separator | string | 천 단위 구분 기호 |
presentation_hints.price_decimal_separator | string | 소수점 구분 기호 |
presentation_hints.price_num_decimals | number | 소수 자릿수 |
presentation_hints.price_display_suffix | string | WooCommerce 가격 표시 접미사 |
presentation_hints.order_barcode_type | string | 갤러리 템플릿에서 사용하는 바코드 유형 |
i18n — 번역된 레이블
i18n
가능한 경우 텍스트를 하드코딩하는 대신 i18n 라벨을 사용하세요:
{{i18n.order}} #{{order.number}}
{{i18n.cashier}}: {{cashier.name}}
{{i18n.total}}: {{totals.total_display}}
일반적인 키에는 order, date, cashier, customer, item, sku, qty, unit_price, regular_price, selling_price, savings, discount, subtotal, total_saved, total, tax, paid, tendered, change, tax_summary, refunded, net_total, customer_note, thank_you_purchase, opening_hours 및 store_tax_id_label_eu_vat, customer_tax_id_label_other와 같은 세금 ID 라벨 키가 포함됩니다. 확장 기능을 통해 추가 키가 추가될 수 있습니다.