AssignPaymentTransactionToSalesInvoiceCommandRequestInput
Assigns a payment transaction to a sales invoice: the money is recorded as a payment of the invoice. Without ‘amount’, the ERP records what is open on the document, at most what is left of the transaction (less a cash discount the payment terms allow); when nothing is open on the document, it links the one payment of the document that matches and has no transaction yet, for example a payment from the shop, or else records what is left of the transaction as an overpayment. With ‘amount’, it always records a new payment of that amount; the document may become overpaid. A transaction of money sent or taken back records a payout (a negative payment). Fees of the payment provider that belong to the transaction are booked as order costs. A document that becomes fully paid starts its workflows. For a split, call it once per document. Errors: PAYMENT_TRANSACTION_NOT_FOUND (the payment transaction was not found); PAYMENT_ACCOUNT_HIDDEN (the payment account is hidden; show it with ‘ShowPaymentAccount’ first); PAYMENT_TRANSACTION_IGNORED (the transaction is ignored; unignore it first); PAYMENT_TRANSACTION_IS_FEE (the transaction is a fee; fees are attached to the sales order of the transaction they belong to); PAYMENT_TRANSACTION_NOT_COMPLETED (the transaction is not completed yet); NO_OPEN_AMOUNT (nothing of the transaction is left to assign); AMOUNT_NOT_POSITIVE (the amount is not greater than 0); AMOUNT_EXCEEDS_OPEN_AMOUNT (the amount is more than is left of the transaction: more than ‘openAmount’, for money sent or taken back more than its magnitude); OPEN_AMOUNT_CHANGED (the open amount of the transaction differs from ‘expectedOpenAmount’); CURRENCY_MISMATCH (the transaction and the document have different currencies); PAYMENT_TRANSACTION_ALREADY_ASSIGNED_TO_DOCUMENT (the transaction already has a payment on this document; change that payment instead); SALES_INVOICE_NOT_FOUND (the sales invoice was not found); SALES_INVOICE_IS_DRAFT (the sales invoice is a draft); SALES_INVOICE_CANCELLED (the sales invoice is cancelled); SALES_INVOICE_TYPE_NOT_SUPPORTED (the invoice is not a regular sales invoice, for example a collective or a down payment invoice). - Request
AssignPaymentTransactionToSalesInvoiceCommandRequestInputFields
The ID of the payment transaction.
The ID of the sales invoice.
The amount to assign, greater than 0, with at most two decimals, in the currency of the transaction. For a transaction of money sent or taken back it is the amount paid back, and it is compared with the magnitude of 'openAmount' (AMOUNT_EXCEEDS_OPEN_AMOUNT). Omitted means the default described above.
The open amount the caller expects the transaction to have, signed as 'openAmount' returns it (negative for money sent or taken back). When given and the open amount differs, nothing is assigned; this protects against assigning the same money twice.
Whether to suppress the automatic workflows this call would start: the events of the payment transaction and, when a sales order or a sales invoice becomes fully paid, its workflows. Events for other systems are still published. Defaults to false when omitted.
Client-supplied idempotency key. When provided, a repeated request with the same key and payload replays the original result instead of re-executing the mutation.
Was this page helpful?