주 콘텐츠로 건너뛰기
버전: 1.x

영수증 데이터 참조

WCPOS 로직리스 HTML 템플릿과 감열 XML 템플릿은 동일한 표준 영수증 페이로드에서 렌더링됩니다. {{order.number}}, {{store.name}}, {{totals.total_display}}와 같은 Mustache 점 경로를 사용합니다. 배열은 섹션으로 렌더링됩니다:

{{#lines}}
{{name}} x {{qty}} — {{line_total_display}}
{{/lines}}

표준 계약은 서버의 WCPOS 영수증 데이터 빌더에서 생성되며, 앱의 오프라인 영수증 렌더러에서 미러링됩니다. 영수증은 로컬 데이터에서 즉시 열리고 서버 응답이 사용 가능해지면 해당 응답으로 업그레이드되므로, 사용자 정의 템플릿에서는 PHP 주문 메서드 대신 아래 필드를 사용해야 합니다.

렌더링 규칙

통화 필드

숫자 금액 필드는 숫자로 유지되며, 렌더러가 템플릿 출력용으로 로케일 인식 _display 필드를 추가합니다:

숫자 필드표시 필드
totals.totaltotals.total_display
lines[].line_totallines[].line_total_display
payments[].amountpayments[].amount_display
tax_summary[].tax_amounttax_summary[].tax_amount_display

영수증 인쇄 시 _display 필드를 사용하는 것이 좋습니다. 숫자 필드는 조건부 섹션이나 기계 판독용 출력에만 사용하십시오.

세금 표시 관련 필드

여러 필드에는 세금 포함 및 세금 제외 변형과 함께 표시용 편의 값이 있습니다. 편의 값은 매장의 장바구니 세금 표시 설정을 따릅니다.

편의 필드세금 포함 필드세금 제외 필드
lines[].unit_pricelines[].unit_price_incllines[].unit_price_excl
lines[].unit_subtotallines[].unit_subtotal_incllines[].unit_subtotal_excl
lines[].line_subtotallines[].line_subtotal_incllines[].line_subtotal_excl
lines[].discountslines[].discounts_incllines[].discounts_excl
lines[].line_totallines[].line_total_incllines[].line_total_excl
fees[].totalfees[].total_inclfees[].total_excl
shipping[].totalshipping[].total_inclshipping[].total_excl
discounts[].totaldiscounts[].total_incldiscounts[].total_excl
totals.subtotaltotals.subtotal_incltotals.subtotal_excl
totals.discount_totaltotals.discount_total_incltotals.discount_total_excl
totals.totaltotals.total_incltotals.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는 렌더링 시점에 갱신되므로 재인쇄 시 유용합니다.

최상위 섹션

섹션타입설명
orderobject주문 식별 정보, 상태, 날짜, 메모, 결제 URL 정보
storeobject매장 식별 정보, 주소, 연락처, 세금 ID, 로고, 영업시간, 푸터 텍스트
cashierobject주문을 처리한 사용자
customerobject고객 표시 이름, 주소, 세금 ID
linesarray상품 항목
feesarray수수료 항목
shippingarray배송 항목
discountsarray쿠폰/할인 항목
totalsobject주문 합계, 결제 합계, 환불 요약 및 항목 수
taxobject섹션 가드를 위한 세금 표시 모드 플래그
tax_summaryarray세율별 세금 요약 항목
has_tax_summarybooleantax_summary 존재 여부 확인용 편의 가드
paymentsarray결제 항목
refundsarray주문에 적용된 환불 내역
fiscalobject재정 통합에 의해 채워지는 재정 스냅샷 필드
presentation_hintsobject서식 및 렌더러 힌트
i18nobject기본 제공 및 사용자 정의 템플릿용 번역된 레이블

order

필드타입예시 / 설명
order.idnumber1234
order.numberstring사용자에게 표시되는 주문 번호, 예: "10045"
order.currencystringISO 통화 코드, 예: "USD"
order.customer_notestring고객/주문 메모
order.wc_statusstringWooCommerce 상태 슬러그 원본값, 예: "processing"
order.status_labelstring사용자 정의 상태를 포함한 현지화된 상태 레이블
order.created_viastring출처/채널, 예: "woocommerce-pos"
order.needs_paymentboolean결제 섹션 표시 여부
order.payment_urlstring사용 가능한 경우 주문 결제 URL
order.createddate object주문 생성 날짜
order.paiddate object결제 날짜, 미결제 시 빈 문자열
order.completeddate object완료 날짜, 미완료 시 빈 문자열
order.printeddate object렌더링 시점의 인쇄/재인쇄 타임스탬프

매장

필드타입예시 / 설명
store.idnumber매장 ID, 삭제된 매장의 경우 이전 ID
store.namestring매장 표시 이름
store.address.address_1string도로명 주소 1
store.address.address_2string상세 주소
store.address.citystring시/구/군
store.address.statestring시/도
store.address.postcodestring우편번호
store.address.countrystringISO 국가 코드
store.address_linesarray미리 서식이 지정된 주소 줄; 대부분의 템플릿에 권장
store.tax_idsarray구조화된 사업자 등록번호; 단일 세금 ID 대신 이 배열을 반복 사용
store.phonestring매장 전화번호
store.emailstring매장 이메일
store.logostring/null매장 로고 URL 또는 데이터 URI
store.opening_hoursstring/null간략한 영업시간 텍스트
store.opening_hours_verticalstring/null여러 줄 영업시간 블록
store.opening_hours_inlinestring/null쉼표로 구분된 영업시간 텍스트
store.opening_hours_notesstring/null영업시간 관련 자유 텍스트 메모
store.personal_notesstring/null영수증 하단/개인 메모
store.policies_and_conditionsstring/null환불, 반품 또는 이용약관 텍스트
store.footer_imprintstring/null법적 고지 하단 문구

세금 ID 객체

store.tax_idscustomer.tax_ids는 동일한 구조의 객체를 포함합니다:

필드타입설명
typestringeu_vat, de_steuernummer, au_abn, br_cpf, us_ein 또는 other와 같은 식별자
valuestring인쇄할 세금 ID 값
countrystring/null확인된 경우 ISO 국가 코드
labelstring/null렌더링 전에 결정되는 현지화된 표시 라벨

예시:

{{#store.tax_ids}}
{{label}}: {{value}}
{{/store.tax_ids}}

cashier

필드타입예시 / 설명
cashier.idnumberWordPress 사용자 ID, 알 수 없는 경우 0
cashier.namestring계산원 표시 이름

customer

필드타입예시 / 설명
customer.idnumber/null고객 ID, 비회원의 경우 null
customer.namestring고객 표시 이름 또는 비회원 라벨
customer.billing_address.*objectWooCommerce 청구 주소 필드
customer.shipping_address.*objectWooCommerce 배송 주소 필드
customer.tax_idsarray주문에서 스냅샷된 고객 세금 ID 구조

일반적인 주소 키에는 first_name, last_name, company, address_1, address_2, city, state, postcode, country, email, phone이 포함됩니다.

lines

{{#lines}}...{{/lines}}로 반복합니다.

필드타입설명
keystring고정 라인 키/주문 항목 ID
skustring상품 SKU
namestring상품 또는 라인 표시 이름
qtynumber판매 수량
qty_refundednumber해당 라인의 환불 수량
unit_subtotal / _incl / _exclnumber할인 전 단가
unit_price / _incl / _exclnumber할인 후 단가
line_subtotal / _incl / _exclnumber할인 전 항목 소계
discounts / _incl / _exclnumber양수 값으로 표시된 할인 금액
line_total / _incl / _exclnumber최종 항목 합계
total_refundednumber해당 항목의 총 환불 금액(양수 값)
taxesarray해당 항목의 세율별 세금 행
metaarray{key, value} 쌍으로 구성된 주문 항목 메타
attributesarray{key, value} 쌍으로 구성된 상품/옵션 속성

서식이 적용된 변형에는 unit_subtotal_display, unit_price_display, line_subtotal_display, discounts_display, line_total_display 및 세금 포함/제외 _display 변형이 포함됩니다.

수수료 및 배송

{{#fees}}...{{/fees}}{{#shipping}}...{{/shipping}}으로 반복합니다.

필드타입설명
labelstring수수료 라벨 또는 배송 방법 이름
method_idstring배송 방법 ID (배송에만 해당)
total / _incl / _exclnumber표시용, 세금 포함, 세금 제외 합계
taxesarray세율별 세금 행
metaarray{key, value} 메타 쌍

서식 적용 변형: total_display, total_incl_display, total_excl_display.

할인

{{#discounts}}...{{/discounts}}로 반복합니다.

필드타입설명
labelstring쿠폰 설명 또는 코드 대체값
codestring쿠폰 코드
codesstring결합된 코드의 레거시/표시 대체값
total / _incl / _exclnumber양수 값으로 표시된 할인 금액

형식화된 변형: total_display, total_incl_display, total_excl_display. 할인을 음수 행으로 표시하려면 템플릿에 직접 마이너스 기호를 추가하십시오.

합계

필드타입설명
totals.subtotal / _incl / _exclnumber할인 적용 전 주문 소계
totals.discount_total / _incl / _exclnumber양수 값으로 표시된 주문 할인 합계
totals.tax_totalnumber총 세금 금액
totals.total / _incl / _exclnumber주문 총합계
totals.paid_totalnumber결제/적용된 금액
totals.change_totalnumber고객에게 반환된 거스름돈
totals.refund_totalnumber양수 값으로 표시된 총 환불 금액
totals.net_totalnumbertotal - refund_total, 최솟값 0으로 제한
totals.total_qtynumber품목 수량의 합계
totals.line_countnumber상품 품목 행의 수

서식이 적용된 변형에는 subtotal_display, discount_total_display, tax_total_display, total_display, paid_total_display, change_total_display, refund_total_display, net_total_display가 포함되며, 해당하는 경우 포함/제외 변형도 제공됩니다.

tax 및 tax_summary

표시 모드 조건에는 tax를, 항목별 세율 행에는 tax_summary를 사용하십시오.

세금 필드타입설명
tax.displaystringincl 또는 excl
tax.display_inclboolean가격이 세금 포함으로 표시될 때 True
tax.display_exclboolean가격이 세금 별도로 표시될 때 True
tax.breakdownstringhidden, single, 또는 itemized
tax.breakdown_hiddenboolean세금 행이 숨겨져야 할 때 True
tax.breakdown_singleboolean단일 세금 합계가 선호될 때 True
tax.breakdown_itemizedboolean세율별 행이 선호될 때 True
has_tax_summarybooleantax_summary에 행이 포함되어 있을 때 True

tax_summary{{#tax_summary}}...{{/tax_summary}}로 반복합니다.

필드타입설명
codestring세율 ID/코드
ratenumber/null확인된 세율 백분율
labelstring세율 라벨
compoundboolean복합 세율 여부
taxable_amount_exclnumber/null세금 제외 과세 기준 금액
tax_amountnumber징수된 세액
taxable_amount_inclnumber/null세금 포함 과세 기준 금액

서식이 적용된 변형: taxable_amount_excl_display, tax_amount_display, taxable_amount_incl_display.

결제

{{#payments}}...{{/payments}}로 반복합니다.

필드타입설명
method_idstring결제 방법 식별자
method_titlestring결제 방법 표시 이름
amountnumber주문에 적용된 금액
transaction_idstring게이트웨이 거래 ID
tenderednumber현금 지불 금액(있는 경우)
changenumber현금 거스름돈(있는 경우)

형식화된 변형: amount_display, tendered_display, change_display.

환불

{{#refunds}}...{{/refunds}}로 반복합니다. 환불 금액은 양수 절대값이며, 마이너스 기호를 앞에 붙이거나 별도의 반품 항목 블록을 렌더링할지는 템플릿에서 결정합니다.

필드타입설명
idnumber환불 레코드 ID
datedate object환불 생성 날짜
amountnumber환불 합계
subtotalnumber환불된 항목 소계
tax_totalnumber환불된 세금
shipping_totalnumber환불된 배송비
shipping_taxnumber환불된 배송 세금
reasonstring환불 사유
refunded_by_idnumber/null환불을 처리한 사용자 ID
refunded_by_namestring환불을 처리한 사용자 표시 이름
refunded_paymentboolean결제 게이트웨이를 통해 결제가 환불되었는지 여부
destinationstringoriginal_method, cash, 또는 manual
gateway_idstring환불에 사용된 게이트웨이 ID
gateway_titlestring게이트웨이 표시 제목
processing_modestring공급자/수동 처리 모드
linesarray환불된 상품 행
feesarray환불된 수수료 행
shippingarray환불된 배송 행

환불 항목 필드에는 name, sku, qty, total, total_incl, total_excl, line_total, unit_total, taxes가 포함됩니다. 환불 수수료 및 배송 행은 label, total, total_incl, total_excl, taxes를 사용합니다. 합계 및 세액에 대해 표시 변형이 추가됩니다.

fiscal

fiscal 필드는 기본적으로 비어 있으며, 재정 통합 또는 WCPOS Pro 스냅샷 보강을 통해 채워집니다.

필드타입설명
fiscal.immutable_idstring불변 재정 식별자
fiscal.receipt_numberstring재정 영수증 번호
fiscal.sequencenumber/null시퀀스 카운터
fiscal.hashstring해시/서명 값
fiscal.qr_payloadstring세금 검증용 QR 페이로드
fiscal.tax_agency_codestring세무 당국 코드
fiscal.signed_atstring세금 서명 타임스탬프
fiscal.signature_excerptstring표시용 서명 발췌
fiscal.document_labelstring문서 라벨 (예: 세금계산서)
fiscal.is_reprintboolean재인쇄 여부
fiscal.reprint_countnumber재인쇄 횟수
fiscal.extra_fieldsarray/object관할권별 고유 값

presentation_hints

이 필드들은 주로 렌더러와 포매터에서 사용됩니다. 필요 시 템플릿에서도 사용할 수 있습니다.

필드타입설명
presentation_hints.display_taxstringincl, excl, hidden, itemized 또는 single
presentation_hints.prices_entered_with_taxboolean카탈로그 가격에 세금이 포함되어 있는지 여부
presentation_hints.rounding_modestringWooCommerce 세금 반올림 설정
presentation_hints.localestring서식 지정에 사용되는 로케일
presentation_hints.timezonestring영수증 시간대
presentation_hints.currency_positionstring통화 기호 위치
presentation_hints.currency_symbolstring통화 기호
presentation_hints.price_thousand_separatorstring천 단위 구분 기호
presentation_hints.price_decimal_separatorstring소수점 구분 기호
presentation_hints.price_num_decimalsnumber소수 자릿수
presentation_hints.price_display_suffixstringWooCommerce 가격 표시 접미사
presentation_hints.order_barcode_typestring갤러리 템플릿에서 사용하는 바코드 유형

i18n

가능한 경우 텍스트를 하드코딩하는 대신 i18n 라벨을 사용하세요:

{{i18n.order}} #{{order.number}}
{{i18n.cashier}}: {{cashier.name}}
{{i18n.total}}: {{totals.total_display}}

일반적인 키에는 order, date, cashier, customer, item, sku, qty, unit_price, discount, subtotal, total, tax, paid, tendered, change, tax_summary, refunded, net_total, customer_note, thank_you_purchase, opening_hoursstore_tax_id_label_eu_vat, customer_tax_id_label_other와 같은 세금 ID 라벨 키가 포함됩니다. 확장 기능을 통해 추가 키가 추가될 수 있습니다.