PosTransactionDto specification — field reference for transaction data

PosTransactionDto Transaction Data Schema Reference API Smaregi Square POS Integration

This article explains all the fields of PosTransactionDto, the canonical model for the transaction data ReceiptRoller handles. Transaction data from every POS vendor (Smaregi, Square, and others) is converted into this model and then used through the database, dashboards, the REST API, and MCP tools.

Use it as a reference when reading or writing transactions from an external system via the API, or when you want to understand how vendor-side fields appear on ReceiptRoller.

Overview

PosTransactionDto represents a single transaction (a single checkout). Line items (per product) are held as an array in LineItems, and internally persisted as JSON in LineItemsJson.

  • Amounts are in the currency indicated by Currency (default JPY) and, unless noted otherwise, are tax-inclusive
  • All dates and times are stored in UTC and converted to JST for display
  • Keys: it has two IDs — TransactionId (ReceiptRoller internal ID) and ExternalTransactionId (the POS vendor-side ID)
  • Payments support multiple tenders (split checkout), held in the Payments array (the single-string PaymentMethod is kept for backward compatibility)
  • It is extended to capture what vendors send, including refunds, external linkage IDs, card information, and raw data

Identifiers

FieldTypeDescription
TransactionIdstringThe ReceiptRoller internal transaction ID. In most cases the POS-side ID is adopted as-is (it becomes the key for the idempotent upsert)
ExternalTransactionIdstringThe POS vendor-side transaction ID. Smaregi: transactionHeadId, Square: Payment.Id
OrganizationIdstring (Guid)The business account ID
StoreIdstring (Guid)Store ID
TerminalIdstring (Guid)The ID of the POS terminal (register)

Dates and times

FieldTypeDescription
TransactionDateTimeDateTime (UTC)The time the checkout occurred. Converted from Square created_at, Smaregi transactionDateTime
CreatedAtDateTime (UTC)The time the record was created on the ReceiptRoller side (for audit)
UpdatedAtDateTime (UTC)The time the record was updated on the ReceiptRoller side (for audit)

Amounts

FieldTypeDescription
CurrencystringThe currency code for all amounts (ISO-4217, default JPY). Square from money.currency, Smaregi fixed to JPY
TotalAmountdecimalTotal amount (tax-inclusive)
TaxAmountdecimalConsumption tax amount
SubtotalAmountdecimalSubtotal (tax-excluded) = TotalAmount - TaxAmount
DiscountAmountdecimalDiscount amount (held as a positive value, not a negative one)
TipAmountdecimal?Tip / service charge. Only when the source sends it separately (Square tip_money). null when not applicable

Line items

FieldTypeDescription
LineItemsList<PosTransactionLineItemDto>The array of per-product line items (a computed property; the actual storage is LineItemsJson)
LineItemsJsonstring (JSON)The JSON-persisted form of the line items. Don't read it directly — use LineItems
ItemCountintThe total line-item quantity (LineItems.Sum(li => li.Quantity))

PosTransactionLineItemDto

FieldTypeDescription
ProductNamestringProduct name. When there is a variation, in the form "Product name (variation name)"
QuantityintQuantity sold
UnitPricedecimalUnit price (tax-excluded)
SubtotaldecimalSubtotal (tax-inclusive)
TaxRatedecimalEffective tax rate (%). Square auto-computes it from the line item, Smaregi adopts taxRate
TaxAmountdecimal?Per-line tax amount. Square total_tax_money, Smaregi tax. null for sources / historical data that only carry a rate
DiscountAmountdecimal?Per-line discount amount. Square total_discount_money. null for sources that don't carry per-line discounts
CategorystringProduct category. Smaregi categoryName, Square currently empty
Skustring?Vendor SKU / product code. Smaregi productCode. Used for matching against a PIM product
CostPriceAtSaledecimal?A snapshot of the PIM cost price (tax-excluded) at the time of sale. Used for gross-profit calculation. null if the cost price is not set
ProductIdstring?The source product ID (when known)
CatalogObjectIdstring?The vendor catalog object ID (Square catalog_object_id, Smaregi productId). For inter-system linkage
Unitstring?Sales unit ("pcs", "kg", etc.). Only when the source has it
Notestring?Per-line remarks
ModifiersList<PosLineItemModifierDto>?Line-item options / modifiers (Square modifiers). Has Name and Amount

Payments

A transaction can have multiple tenders (split checkout). The full breakdown is held in Payments (the actual storage is PaymentsJson), and the single-string PaymentMethod holds the "primary tender" for backward compatibility.

FieldTypeDescription
PaymentMethodstring (enum)Normalizes the primary payment method:
Cash / CreditCard / QR / IC / Other
PaymentsList<PosPaymentDto>The full breakdown of tenders (a computed property; the actual storage is PaymentsJson)
PaymentsJsonstring (JSON)The JSON-persisted form of the tender breakdown
ReceiptNumberstringReceipt number (the number issued on the POS side)

PosPaymentDto

FieldTypeDescription
MethodstringThe normalized method (Cash / CreditCard / QR / IC / Other), or the source's raw name if not supported
AmountdecimalThe amount of this tender
TenderedAmountdecimal?Amount tendered (when the source reports it)
ChangeAmountdecimal?Change (when the source reports it)
Brandstring?Card brand (VISA, Mastercard, etc.). Card payments only
Last4string?Last 4 digits of the card. Displayable (the PAN is not stored)
ExternalIdstring?The source-side payment ID (when it differs from the transaction ID)

Refunds

The refund breakdown for a (partially) refunded transaction. Held in Refund (the actual storage is RefundJson).

FieldTypeDescription
RefundPosRefundDto?The refund breakdown (null if none)
RefundJsonstring (JSON)The JSON-persisted form of the refund breakdown

PosRefundDto

FieldTypeDescription
AmountdecimalRefund amount
IsPartialboolWhether it is a partial refund
Reasonstring?Refund reason
OriginalTransactionIdstring?The original transaction being refunded
RefundedAtDateTime?Refund date and time

Note: the model and API shape are ready, and refund data is reflected if it exists. Because Square / Smaregi send refunds as a separate Webhook event, capturing refunds end-to-end is handled by a separate sync process.

External linkage and receipt URL

Holds the source POS's various IDs and receipt URL so a transaction can be reconciled back to its originating record.

FieldTypeDescription
ReceiptUrlstringThe customer-facing receipt URL (Square receipt_url). It is a structured field (previously stored in Notes, now deprecated)
ExternalIdsPosExternalIdsDto?Cross-vendor IDs (a computed property; the actual storage is ExternalIdsJson)
ExternalIdsJsonstring (JSON)The JSON-persisted form of the external IDs

PosExternalIdsDto

FieldTypeDescription
ProviderOrderIdstring?The vendor's order ID (Square order_id)
LocationIdstring?The vendor's location ID (Square location_id)
ProviderCustomerIdstring?The vendor's customer ID (Square customer_id, Smaregi customerId)

Raw data

FieldTypeDescription
RawJsonstring (JSON)The raw source payload at import time. Kept so that fields not modeled (card fingerprint, etc.) can be recovered. For server-internal use; not returned by the API

Staff

FieldTypeDescription
StaffNamestringThe responsible staff name (empty if it could not be obtained)
StaffIdstringThe POS vendor-side staff ID (Square: team_member_id, Smaregi: staffId)

Status and source

FieldTypeDescription
Statusstring (enum)Completed / Voided / Refunded / Pending. For display, StatusDisplayName
Sourcestring (enum)API (auto-imported from the POS) / Webhook (pushed from the POS) / CSV (bulk import) / Manual (manual entry)
NotesstringRemarks / memo. The receipt URL moved to ReceiptUrl, so it is no longer stored here

CRM linkage

When a transaction is linked to a customer (POS-side member information, a phone/email match, etc.), ReceiptRoller's ICrmCustomerResolver fills in the following fields.

FieldTypeDescription
MembershipCodestring?The ReceiptRoller membership number. null if it could not be linked
CrmCustomerIdstring?The ID of the CRM customer record. null if it could not be linked

The source-side raw customer ID can be referenced separately via ExternalIds.ProviderCustomerId.

Display helpers

Computed properties for use on the UI side. They are not stored directly in the DB.

  • PaymentMethodDisplayName — the localized name of the payment method (e.g. "Credit card")
  • StatusDisplayName — the localized name of the status (e.g. "Completed", "Voided")
  • StatusBadgeClass — the CSS class for a Bootstrap badge
  • SourceDisplayName — the display name of the source
  • FormattedDateTime — the date/time in "yyyy/MM/dd HH:mm" form
  • FormattedTotal — the total amount with thousands separators

Backward compatibility

All of the extension fields above are additive and nullable, and persisted as JSON columns. No Table Storage migration is needed, and existing rows and existing LineItemsJson remain valid as-is. New fields are populated from newly imported transactions onward (reflecting them in past data requires a re-sync).

Per-vendor mapping

For exactly which fields each POS vendor populates, see the per-vendor mapping articles below.

Related guides

Published: 2026-05-29 Updated: 2026-07-05