Skip to main content
Glama
Payware MCP Server

Payware MCP Server

Official
by payware

payware_operations_simulate_callback

Read-onlyIdempotent

Simulate payware callback payloads to build and test webhook handlers against the real shape, including absent fields, fee breakdowns, items, tips and retry deduplication.

Instructions

[Merchant] Simulate callback scenarios for testing webhook handling.

Generates the payload a merchant's callbackUrl actually receives, so a handler can be built and tested against the real shape. Four properties of that shape are easy to get wrong:

1. Absent means absent, not zero. The payload omits properties with no value rather than sending null or 0. statusMessage, passbackParams, fee, feeFixed and feeRate are all simply missing when they do not apply. A missing fee means the fee is unknown for that transaction - it does not mean the transaction was free. Do not write a handler that reads payload.fee as a number without checking it is there.

2. finalized is absent on EXPIRED. An expired transaction is closed by the platform's expiry sweep, which sets no finalization moment. Every other status carries one.

3. EXPIRED is a non-payment, not a failure. The payer never paid within timeToLive. Release the order or the stock, as you would for a cancellation - do not treat it as an error to retry.

4. Deduplicate on (transactionId, callbackType). payware retries a callback up to 15 times, backing off from about a second to at most 5 minutes between attempts, until the endpoint answers any 2xx. That pair is stable across every retry of the same event, and it is the key payware guarantees. A handler that does not deduplicate will eventually process one payment twice.

Payments with a product, a placement, a session or lines. The payload also carries, when they apply and absent otherwise: productId (the product the payment came from), placementId (the placement it is attributed to, Premium only), sessionId (the purchase session's pa id) and items with their total (type, productId, name, quantity, unitPrice, amount, and country on a delivery line payware priced; no images). total is the sum of the lines, what was sold. A tip is never a line: the payload carries it as tip (absent without one), yours, sent when you created the payment, or the payer's, added in their bank where your shop allows tips; the payer paid total + tip and the fee applies to the whole of it. On CONFIRMED amount is net of the fee, so amount + fee = total + tip; on any other status nothing was paid and amount equals total + tip. Give items (and tip) and leave amount out: the tool works it out, and refuses an amount the server would never send with those lines.

Not on this payload: deliveryAddress (removed 2026-08-07 - fetch it from payware_operations_get_transaction_history, which is authenticated and tenant-scoped), producerPartnerId, transactionType and initiatedBy (the last two are carried on TRANSACTION_PROCESSED, which merchants do not receive).

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": {
      "transactionId": "<transactionId>"
    },
    "name": "payware_operations_simulate_callback"
  }
}

Input Schema

NameRequiredDescriptionDefault
feeNopayware's fee on this transaction plus VAT where it applies, at the currency's smallest payable unit (e.g. '0.29'). The payer's institution transfers it to payware alongside the merchant's payment, and amount is net of it. Not always two decimals - it follows the currency. Pass null to model the anomaly case, where a transaction has no recorded fee and the server OMITS the property entirely; that is deliberately distinguishable from a genuine '0.00'.
tipNoThe payment's tip, a decimal string (e.g. '2.00'): the merchant's own, sent when it created the payment, or the payer's, added in their bank where the shop allows tips. Never a line: the callback carries it as tip, absent without one. With items the payer paid total + tip, so on CONFIRMED amount + fee = total + tip, and on any other status amount = total + tip.
itemsNoLines of a payment that has them (a product payment with a quantity, a purchase session, a merchant payment created with items): the callback then carries items and their total (the sum of the lines: what was sold). Each line: type (ITEM, SHIPPING, DISCOUNT, TAX or SURCHARGE), name, amount, and for an ITEM productId, quantity and unitPrice, for a SHIPPING line payware priced the country (a merchant's own lines carry none). A tip is never a line: give it as tip. Callback lines carry no images or terms. With items, leave amount out: on CONFIRMED it is worked out as total + tip minus fee, on any other status it is total + tip.
poiIdNoSet to simulate a POI sale: the callback then carries the poiId of the POI that created the transaction
amountNoTransaction amount (e.g., '57.60'; that is the default without items). With items leave it out: on CONFIRMED it is total minus fee, on any other status the total; a different value is refused
feeVatNoThe VAT included in fee (fee minus feeVat is payware's fee excluding VAT), at the same scale; zero when no VAT applies (reverse charge, or a merchant outside the EU). Present exactly when fee is (server TransactionCallbackPayload). Defaults to zero.
statusNoTransaction status to simulateCONFIRMED
feeRateNoVariable rate of the applicable fee configuration, e.g. '0.0150' = 1.5%. Informational, same as feeFixed. Pass null to model a transaction with no fee configuration.0.0150
currencyNoTransaction currencyEUR
feeFixedNoFixed fee component of the applicable fee configuration, e.g. '0.1000'. Informational, for reconciliation. Present on FINALIZED callbacks since 2026-08-21 - before that a merchant got the total fee but not the breakdown that produced it. Pass null to model a transaction with no fee configuration, where it is omitted.0.1000
productIdNoSet to simulate a payment that came from a product: the callback then carries the productId (from the product snapshot)
sessionIdNoSet to simulate a payment that came from an agent purchase session: the callback then carries the session's pa id
callbackUrlNoURL where callback would be sent (for simulation only)
placementIdNoSet to simulate a payment attributed to a placement (Premium merchants): the callback then carries the placementId
tipEnteredByNoWith tip: who entered it, MERCHANT (on create) or PAYER (in the bank app). Default PAYER. The callback carries it only with a tip.
paymentMethodNoPayment method chosen by customer. A2A = direct transfer. CARD_FUNDED = card-linked account. BNPL = buy now pay later. INSTANT_CREDIT = credit line.
statusMessageNoCustom status message for the transaction callback
transactionIdYesTransaction ID to simulate callback for

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.4.0
    • changedInput schema / properties / items / description
      Previous value: -"Lines of a payment that has them (a product payment with a quantity, a purchase session, a merchant payment created with items): the callback then carries items and their total (the sum of the lines: what the payer paid). Each line: type (ITEM, SHIPPING, DISCOUNT, TAX or SURCHARGE), name, amount, and for an ITEM productId, quantity and unitPrice, for a SHIPPING line payware priced the country (a merchant's own lines carry none). Callback lines carry no images or terms. With items, leave amount out: on CONFIRMED it is worked out as total minus fee, on any other status it is the total."New value: +"Lines of a payment that has them (a product payment with a quantity, a purchase session, a merchant payment created with items): the callback then carries items and their total (the sum of the lines: what was sold). Each line: type (ITEM, SHIPPING, DISCOUNT, TAX or SURCHARGE), name, amount, and for an ITEM productId, quantity and unitPrice, for a SHIPPING line payware priced the country (a merchant's own lines carry none). A tip is never a line: give it as tip. Callback lines carry no images or terms. With items, leave amount out: on CONFIRMED it is worked out as total + tip minus fee, on any other status it is total + tip."
    • addedInput schema / properties / tip
      Added value: +{
      +  "description": "The payment's tip, a decimal string (e.g. '2.00'): the merchant's own, sent when it created the payment, or the payer's, added in their bank where the shop allows tips. Never a line: the callback carries it as tip, absent without one. With items the payer paid total + tip, so on CONFIRMED amount + fee = total + tip, and on any other status amount = total + tip.",
      +  "type": "string"
      +}
    • addedInput schema / properties / tipEnteredBy
      Added value: +{
      +  "description": "With tip: who entered it, MERCHANT (on create) or PAYER (in the bank app). Default PAYER. The callback carries it only with a tip.",
      +  "enum": [
      +    "MERCHANT",
      +    "PAYER"
      +  ],
      +  "type": "string"
      +}
  2. Changed6 schema fields changedv2.3.0
    • removedInput schema / properties / amount / default
      Removed value: -"57.60"
    • changedInput schema / properties / amount / description
      Previous value: -"Transaction amount (e.g., '57.60')"New value: +"Transaction amount (e.g., '57.60'; that is the default without items). With items leave it out: on CONFIRMED it is total minus fee, on any other status the total; a different value is refused"
    • addedInput schema / properties / items
      Added value: +{
      +  "description": "Lines of a payment that has them (a product payment with a quantity, a purchase session, a merchant payment created with items): the callback then carries items and their total (the sum of the lines: what the payer paid). Each line: type (ITEM, SHIPPING, DISCOUNT, TAX or SURCHARGE), name, amount, and for an ITEM productId, quantity and unitPrice, for a SHIPPING line payware priced the country (a merchant's own lines carry none). Callback lines carry no images or terms. With items, leave amount out: on CONFIRMED it is worked out as total minus fee, on any other status it is the total.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "amount": {
      +        "description": "The line total, a decimal string; negative only on a DISCOUNT",
      +        "type": "string"
      +      },
      +      "country": {
      +        "description": "SHIPPING lines payware priced: ISO 3166-1 alpha-2 country of the delivery. A merchant's own lines carry none",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "What the line is. A payware-priced delivery line is named \"Delivery\"",
      +        "type": "string"
      +      },
      +      "productId": {
      +        "description": "ITEM lines of payware products: the product id (pr + 8 characters)",
      +        "type": "string"
      +      },
      +      "quantity": {
      +        "description": "ITEM lines: how many",
      +        "maximum": 99,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "type": {
      +        "description": "Kind of line",
      +        "enum": [
      +          "ITEM",
      +          "SHIPPING",
      +          "DISCOUNT",
      +          "TAX",
      +          "SURCHARGE"
      +        ],
      +        "type": "string"
      +      },
      +      "unitPrice": {
      +        "description": "ITEM lines: price of one unit, a decimal string",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "name",
      +      "amount"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / placementId
      Added value: +{
      +  "description": "Set to simulate a payment attributed to a placement (Premium merchants): the callback then carries the placementId",
      +  "type": "string"
      +}
    • addedInput schema / properties / productId
      Added value: +{
      +  "description": "Set to simulate a payment that came from a product: the callback then carries the productId (from the product snapshot)",
      +  "type": "string"
      +}
    • addedInput schema / properties / sessionId
      Added value: +{
      +  "description": "Set to simulate a payment that came from an agent purchase session: the callback then carries the session's pa id",
      +  "type": "string"
      +}
  3. First observedv2.2.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, and the description is consistent with that while adding real behavior the agent could not infer: absent-not-zero omission semantics, no finalization on EXPIRED, and that retries run up to 15 times with backoff until a 2xx. It does not say plainly that nothing is actually dispatched to callbackUrl beyond the parenthetical in the schema, which is the one behavioral point left implicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loading is strong: the purpose sentence comes first, then a numbered list of the four payload traps an agent or developer is most likely to get wrong. It runs long and the items/tip arithmetic is repeated inside the schema as well, but the density is mostly earned by genuine domain subtleties.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 18-parameter, enum-heavy simulation tool with no output schema, the description covers what matters: the payload shape produced, what is deliberately absent, cross-parameter arithmetic constraints, retry/deduplication behavior, and where removed fields like deliveryAddress must be fetched instead. An agent has enough to call it correctly without further exploration.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description goes beyond it by explaining cross-parameter interaction: with items the tool derives amount, refuses a value the server would never send, and enforces amount + fee = total + tip on CONFIRMED only. It also explains the null-versus-absent distinction for fee, feeFixed and feeRate conceptually rather than restating their descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb and resource ('Simulate callback scenarios') and immediately narrows the scope to webhook-handler testing by generating the exact payload a merchant's callbackUrl receives. Nothing in the sibling list does this, so an agent can distinguish it without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is explicit ('so a handler can be built and tested against the real shape') and several construction rules are given, such as 'Give items (and tip) and leave amount out' and fetching deliveryAddress from payware_operations_get_transaction_history instead. It stops short of naming any when-not-to-use condition or an alternative simulation tool, so it is clear but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools