Documentation · Platon API

Transactions

Issue an e-receipt from a structured POS transaction.

Endpoint

POST /platon/transactions

Submit a structured POS transaction to generate and deliver a digital receipt. The receipt can include itemized product lines, VAT details per product, and one or more credit card payment records.

Example request

cURL

curl --request POST \ '{BASE_URL}/platon/transactions' \ --header 'Authorization: Bearer {YOUR_API_TOKEN}' \ --header 'Content-Type: application/json' \ --data '{ "requestId": "0efc54d1-a04c-46f1-94d2-ee58fd740485", "amount": "37", "shopId": 1, "externalTransactionRef": "698547865872", "tillId": 1, "timezone": "Europe/Paris", "mode": "email", "currencySymbol": "€", "shopName": "Main Street", "shopStreet": "149 Av. de Bretagne", "shopCity": "Lille", "shopPostalCode": "59000", "receipts": [{ "products": [{ "name": "Keyboard", "price": "15", "quantity": "1", "genCode": "895471234", "family": "Electronics", "vat": { "label": "VAT 20%", "amount": "3", "rate": "20%" } }] }], "creditCardPayments": [{ "cardNetwork": "VISA", "paymentDate": "2024-05-12", "paymentTime": "13:45", "merchantName": "Acme Corp", "maskedCardNumber": "*1234", "amount": "37", "currencySymbol": "€", "paymentType": "Credit" }], "customer": { "email": "customer@example.com" } }'

Response

A successful request returns HTTP status 201 Created with an empty body, or a plain-text URL when the web receipt feature is enabled for your account. That URL points to a hosted page where customers can view and download their receipt.

When mode is email or email_and_print, an email is sent to the customer only if a valid email address is present in the customer.email field.

Delivery modes

ValueDescription
emailSend the receipt by email to the customer. Requires a valid customer.email.
printGenerate a paper receipt at the POS terminal. No email is sent.
email_and_printSend by email and generate a paper receipt simultaneously.
no_printRecord the transaction without delivering a receipt.

Request body reference

StructuredTransactionDTO

FieldTypeRequiredDescription
requestIdstringYesUUID v4 used for idempotency. Duplicate requests with the same value are ignored.
modestringYesDelivery mode. See Delivery modes.
receiptsStructuredReceipt[]YesOne or more receipts, each containing a list of products.
amountstringNoTotal transaction amount. May be negative (refund).
shopIdnumberNoInternal shop identifier.
externalTransactionRefstringNoYour own reference for this transaction.
externalReceiptRefstringNoYour own reference for this receipt.
tillIdnumberNoPOS register or till identifier.
transactionDatestringNoISO 8601 date string of when the transaction occurred.
timezonestringNoIANA timezone name (e.g. Europe/Paris).
currencySymbolstringNoCurrency symbol (, $) or ISO code (EUR).
companyNamestringNoMerchant company name displayed on the receipt.
shopNamestringNoStore name displayed on the receipt.
shopPhonestringNoStore phone number.
shopStreetstringNoStore street address.
shopCitystringNoStore city.
shopPostalCodestringNoStore postal code.
customerCustomerNoCustomer contact details, consents, and preferences.
creditCardPaymentsCreditCardPaymentDTO[]NoPayment breakdown for card transactions. Multiple entries supported.
vatsVatDTO[]NoVAT summary for the entire transaction (as opposed to per-product VAT).
barcodeStructuredBarcodeNoOptional barcode for receipt validation or lookup.
tagsstring[]NoCustom metadata tags.

StructuredReceipt

FieldTypeRequiredDescription
productsStructuredProductDTO[]NoList of products included in the receipt.

StructuredProductDTO

FieldTypeRequiredDescription
namestringYesProduct name.
pricestringYesLine total (price × quantity).
quantitystringYesNumber of units purchased.
genCodestringYesProduct barcode or identifier.
familystringYesProduct category.
guaranteestringNoWarranty duration (e.g. 2 years).
vatRatestringNoVAT rate applied to this product (e.g. 20%).
unitPricestringNoPrice per unit, before multiplying by quantity.
quantityUnitstringNoUnit label for the quantity (e.g. kg, L).
metadataobjectNoArbitrary key-value metadata (values are arrays of strings). Use for coupons, discounts, or custom attributes.

CreditCardPaymentDTO

Attach one or more card payment records to the receipt. Each entry represents a single card transaction.

FieldTypeRequiredDescription
cardNetworkstringYesCard network (e.g. VISA, MasterCard).
paymentDatestringYesPayment date in ISO format (e.g. 2024-05-12).
paymentTimestringYesTime of payment (e.g. 13:45).
merchantNamestringYesMerchant display name.
maskedCardNumberstringYesMasked card number (e.g. *1234). Leading asterisks are added automatically if omitted.
amountstringYesAmount charged on this card.
currencySymbolstringYesCurrency symbol or ISO code.
paymentTypestringYesCredit or Debit.
paymentMethodstringNoHow the card was used (e.g. Contactless, PIN).
transactionReferencestringNoUnique identifier for this card transaction.
authorizationNumberstringNoAuthorization code returned by the card network.
terminalIdstringNoPayment terminal identifier.
storeIdstringNoStore location identifier.
merchantIdstringNoMerchant identifier (e.g. SIRET).
merchantPostalCodestringNoMerchant postal code.
merchantCitystringNoMerchant city.
bankCodestringNoBank or processing code.
cardTransactionIdstringNoInternal card transaction identifier.
merchantCustomHeaderstringNoCustom header text displayed in the merchant section of the receipt.

StructuredBarcode

FieldTypeRequiredDescription
typestringYesBarcode format. Supported values: 128, 012, 008, 013, 125, 039.
valuestringYesData to encode in the barcode.

Customer

FieldTypeRequiredDescription
emailstringNoCustomer email address. Required for email delivery modes.
consentsConsent[]NoList of customer consent records (e.g. marketing opt-in).
preferencesPreference[]NoCustomer preferences (e.g. preferred receipt delivery channel).
customCustomField[]NoArbitrary key-value pairs for custom customer attributes.