payware_operations_create_transaction
Create a payment transaction with amount, currency, reason, and optional QR/barcode, item lines, tips, callback URL, and deferred transfer settings for merchant payments.
Instructions
[Merchant] Create a new payware transaction. Parameters map to the following API structure:
๐ ROOT LEVEL (Transaction metadata):
shop, account, friendlyName, callbackUrl, passbackParams
producerPartnerId, terminalId, terminalManufacturer (POS terminal producer attribution - see below)
๐ฐ TRANSACTION DATA (trData object):
amount, currency, reasonL1, reasonL2, tip (your own tip inside amount - see below)
โ๏ธ TRANSACTION OPTIONS (trOptions object):
type, timeToLive (see below), deferredAllowed (deferred Merchant Leg opt-in - see below)
๐ฑ QR OPTIONS (qrOptions object - only when type=QR):
qrFormat, qrBorder, qrErrorCorrection, qrScale, qrVersion
๐ BARCODE OPTIONS (barOptions object - only when type=BARCODE):
barFormat, barModuleWidth, barBarHeight, barFontSize, barHumanReadableLocation
๐ AUTHENTICATION (not sent to API, used for JWT signing):
partnerId, privateKey
Actual API Request Structure:
{
"shop": "...",
"account": "...",
"friendlyName": "...",
"callbackUrl": "...",
"passbackParams": "...",
"trData": {
"amount": "25.50",
"currency": "EUR",
"reasonL1": "...",
"reasonL2": "..."
},
"trOptions": {
"type": "QR",
"timeToLive": 300
},
"qrOptions": { ... }
}๐งพ LINES (items, root level, optional): what the payer's bank shows instead of one amount - items with quantity and unit price, delivery, discounts, taxes. 1-50 lines that sum exactly to trData.amount, or to trData.amount minus tip when you send one (400 ERR_ITEMS_DO_NOT_SUM); malformed lines, or a line with a country (payware sets it only on delivery lines it prices), are 400 ERR_INVALID_ITEMS; an empty list is 400 ERR_ITEMS_EMPTY (leave items out instead). Not for an amount of 0. Every payment, with lines or without, is paid exactly the amount it asks (the payer's bank gets 409 ERR_AMOUNT_NOT_TOTAL for anything else), plus a tip where one is allowed. A tip is never a line: a TIP line in your items is 400 ERR_INVALID_ITEMS. payware records the tip on the payment and returns it as tip beside items and total, which stay what was sold: the payer paid total + tip, and the payware fee applies to the whole of it. The response, the callback and the transaction history carry items, total and tip back. Lines change nothing about who is paid.
๐ TIP (tip, sent as trData.tip, optional): one tip per payment, recorded on it and never a line.
Yours, for a till that asks the payer before it shows the code:
amountis what the payer pays, tip included, andtipis the part that is the tip, above 0 and at most the amount before it (400ERR_INVALID_TIP).items, if any, add up toamountminustip. The payer's bank shows it, pays exactlyamountand offers no second tip. No shop setting is needed.The payer's, without yours: where your shop allows tips (
tipsAllowed, the portal's shop form), the payer may add a tip in their bank, and pays the amount plus the tip. Elsewhere the payer pays exactly the amount: there is no paying more without a tip.Either way it comes back as
tipin the response, the callback and the transaction history, and the payware fee applies to the whole amount.
โฑ๏ธ PAYMENT LIFETIME (timeToLive, sent as trOptions.timeToLive, 120 seconds when left out): payware accepts 60 seconds up to the merchant's own ceiling, which is 600 by default and which the merchant can raise in the portal (Settings > Authentication, Longest payment lifetime) up to 2,592,000 (30 days). Above the ceiling the server answers 400 ERR_INVALID_TTL. This tool checks 60 to 2,592,000 before sending; only payware knows the ceiling. An ISV acting for a merchant gets that merchant's ceiling and cannot change it. The e-commerce plugins keep 60-600, because their buyer is waiting at the checkout.
โณ DEFERRED MERCHANT LEG (optional, trOptions.deferredAllowed)
By default the payer's institution pays this transaction with an instant or an internal transfer.
deferredAllowed: true also lets it use an ordinary credit transfer that settles later. Rules:
Honoured only on your own call without POS terminal producer fields. With
producerPartnerId,terminalIdorterminalManufacturerthe transaction is refused with 400ERR_DEFERRED_TRANSFER_NOT_ALLOWED: a till payment stays instant or internal.A deferred payment stays ACTIVE, i.e. pending, until the transfer settles, which can take days, and so can stay ACTIVE past its
timeToLive. Keep polling or wait for the callback; never treat it as expired yourself. CONFIRMED arrives once the money has reached your account.Echoed as
deferredAllowed: truein the create response and on status reads when set; absent otherwise. Leave it out for instant or internal only.
๐ญ POS TERMINAL PRODUCER ATTRIBUTION (optional, root level)
Only relevant if the transaction originates on a POS terminal whose producer has a revenue-share agreement with payware. Three fields, all optional:
producerPartnerId- the 8-character partnerId payware issued to the terminal producer. An unrecognised value fails the transaction with a 400 (ERR_INVALID_PRODUCER_ID) - it is deliberately not ignored, so that a terminal configured with the wrong id fails on its first sale where an installer can see it. Omit the field entirely when there is no producer arrangement; never send an empty string.terminalId- the producer's own identifier for the physical terminal. Max 64 chars, no control characters. payware records it and never interprets it: no format, no uniqueness enforcement, and nothing about pricing or attribution depends on it.terminalManufacturer- device manufacturer as the terminal reports it. Max 64 chars, no control characters. Recorded for provenance. payware's internal attribution review counts each producer's sales by reported manufacturer, so a build running on another vendor's hardware stands out; it is never blocked.
Two things worth knowing:
It never changes what the merchant is charged. The producer's share comes out of payware's own fee, not out of a higher price for the merchant, whose fee always follows the fee hierarchy.
None of the three is returned. They do not appear in the create response, in
get_transaction_status, in transaction history, or in any callback. What a producer earned is visible on their own dashboard and settlements - attribution is recorded against the fee, not against the transaction.
If an ISV's software made the call, the ISV is attributed and the producer is not, even when the ISV's software is running on that producer's hardware.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"currency": "<currency>",
"reasonL1": "<reasonL1>"
},
"name": "payware_operations_create_transaction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tip | No | ๐ฐ TRANSACTION DATA: your own tip inside amount, sent as trData.tip, e.g. "2.00": a tip the payer chose at your till before you showed the code. A plain decimal above 0 at the currency's scale, at most the amount before it, so at most half of amount (400 ERR_INVALID_TIP). amount is what the payer pays, tip included; items, if any, add up to amount minus tip. The payer's bank shows the tip, pays exactly amount and offers no second tip. Needs no shop setting. Leave it out to let the payer add a tip in their bank, where your shop allows tips. | |
| shop | No | ๐ ROOT LEVEL: Shop code (if not supplied, default shop is used) | |
| type | No | Transaction type | |
| items | No | Optional lines the payer's bank shows, 1 to 50, e.g. [{"type":"ITEM","name":"Vase","quantity":2,"unitPrice":"40.00","amount":"80.00"},{"type":"SHIPPING","name":"Delivery","amount":"5.00"}]. The lines must sum EXACTLY to amount, or to amount minus tip when you send one (400 ERR_ITEMS_DO_NOT_SUM otherwise; anything else malformed is 400 ERR_INVALID_ITEMS; an empty list is 400 ERR_ITEMS_EMPTY: send at least one line or leave items out). ITEM: quantity 1-99, unitPrice 0 or more, amount = quantity x unitPrice. DISCOUNT: amount below 0. Every other type: amount 0 or more. Amounts are decimal strings at the currency's payable scale, at most 15 significant and 15 integer digits. Needs an amount above zero. No images, product ids or country here: payware sets country only on the delivery lines it prices. No TIP line (400 ERR_INVALID_ITEMS): a tip is never a line. Your own goes in tip; the payer's, added in their bank where your shop allows tips, comes back as tip too. | |
| amount | No | Amount as currency value (e.g., 25.50 for โฌ25.50 or '15.75' for $15.75). Can be 0 for amount-flexible transactions. At most 15 significant digits and 15 integer digits (400 ERR_INVALID_AMOUNT_LENGTH) | |
| account | No | ๐ ROOT LEVEL: Account identifier (if not supplied, determined from payware portal) | |
| qrScale | No | QR OPTIONS (type=QR): pixels per module, 1-100, irrelevant for SVG (default 16) | |
| currency | Yes | Transaction currency (ISO 3-character code) | |
| qrBorder | No | QR OPTIONS (type=QR): quiet zone around the code, in modules, 1-10 (default 4) | |
| qrFormat | No | QR OPTIONS (type=QR): image format, PNG, JPG or SVG (default SVG) | |
| reasonL1 | Yes | Transaction grounds description (required) | |
| reasonL2 | No | Transaction grounds description continuation (optional) | |
| barFormat | No | BARCODE OPTIONS (type=BARCODE): image format, PNG, JPG or SVG (default SVG) | |
| partnerId | No | ๐ AUTHENTICATION: Partner ID from payware dashboard (not sent in API request). Uses PAYWARE_PARTNER_ID env var as default. | |
| qrVersion | No | QR OPTIONS (type=QR): QR version, 1-40, higher holds more data (default 3) | |
| privateKey | No | ๐ AUTHENTICATION: RSA private key for JWT token creation (not sent in API request). Accepts PEM format with/without headers or raw base64 content. Uses environment-specific private key as default. | |
| terminalId | No | ๐ญ ROOT LEVEL: Opaque identifier of the physical terminal, scoped to the producer's own estate. payware assumes no format and enforces no uniqueness; it is recorded for provenance and never affects attribution or pricing. Make it unique within your own estate anyway - that is what lets you answer 'which terminal produced this sale' later. Not returned in any response or callback. | |
| timeToLive | No | โ๏ธ TRANSACTION OPTIONS: Time allowed for payment initiation in seconds (sent as trOptions.timeToLive; 120 when left out). payware accepts 60 up to the merchant's own ceiling: 600 by default, which the merchant can raise in the portal (Settings > Authentication, Longest payment lifetime) up to 2592000 (30 days). Above the ceiling is 400 ERR_INVALID_TTL; this tool checks 60 to 2592000 only, as it cannot see the ceiling. An ISV acting for a merchant gets that merchant's ceiling and cannot change it. The e-commerce plugins keep 60-600, because their buyer is waiting at the checkout. Once the payer's institution has started the payment, the transaction stays ACTIVE past it until the money has moved (seconds for an instant transfer, days with deferredAllowed); never infer EXPIRED from the clock. | |
| useSandbox | No | Use sandbox environment for testing | |
| barFontSize | No | BARCODE OPTIONS (type=BARCODE): font size of the human-readable text, 0-24 (default 12) | |
| callbackUrl | No | ๐ ROOT LEVEL: HTTPS URL to receive transaction status callbacks. Must be https://, must present a publicly-trusted TLS certificate, and must resolve to a public address - internal/private addresses are rejected (ERR_UNRESOLVABLE_CALLBACK_URL). | |
| barBarHeight | No | BARCODE OPTIONS (type=BARCODE): bar height in pixels, 15-1000 (default 100) | |
| friendlyName | No | ๐ ROOT LEVEL: Account holder recognizable name (if not supplied, merchant alias is used) | |
| barModuleWidth | No | BARCODE OPTIONS (type=BARCODE): module width in pixels, 1-10 (default 2) | |
| idempotencyKey | No | Optional. Sent as the Idempotency-Key header. Use one value per payment (a UUID is typical) and the same value on every retry of it: a retry with the same key and body within 24 hours returns the transaction the first call created instead of a new one, and the result reports replayed: true. The same key with a different body is refused (422 ERR_IDEMPOTENCY_KEY_REUSED); a retry while the first call still runs gets 409 ERR_IDEMPOTENCY_KEY_IN_PROGRESS. | |
| passbackParams | No | ๐ ROOT LEVEL: Additional parameters passed back in callbacks (max 200 chars) | |
| deferredAllowed | No | โ๏ธ TRANSACTION OPTIONS: Opt this transaction in to a deferred Merchant Leg (sent as trOptions.deferredAllowed). Optional; omit it for instant or internal only. When true, the payer's institution may also pay by an ordinary credit transfer that settles later. Not for a terminal sale: combined with producerPartnerId, terminalId or terminalManufacturer it is refused with 400 ERR_DEFERRED_TRANSFER_NOT_ALLOWED. A deferred payment stays ACTIVE (pending) until the transfer settles, which can take days and can outlast timeToLive: keep polling or wait for the callback, never treat it as expired yourself. Echoed as deferredAllowed: true when set. | |
| producerPartnerId | No | ๐ญ ROOT LEVEL: partnerId of the POS terminal producer whose terminal produced this transaction. Must be a partner registered with payware and flagged as a producer - an unrecognised value REJECTS the transaction (400 ERR_INVALID_PRODUCER_ID) rather than being ignored. Omit entirely when there is no producer arrangement; never send an empty string. Selects the producer's revenue share out of payware's own fee and never changes what the merchant is charged. Not returned in any response or callback. | |
| qrErrorCorrection | No | QR OPTIONS (type=QR): error correction, LOW (7%), MEDIUM (15%), QUARTILE (25%) or HIGH (30%) (default QUARTILE) | |
| terminalManufacturer | No | ๐ญ ROOT LEVEL: Device manufacturer as reported by the terminal. Recorded for provenance; a mismatch against the expected producer is surfaced in settlement review and never blocks the transaction. Not returned in any response or callback. | |
| barHumanReadableLocation | No | BARCODE OPTIONS (type=BARCODE): where the human-readable text goes (default NONE) |