Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Payment proposals and approvals

    How a payment proposal moves from draft to confirmed or rejected by the bank, who may approve it, and how one payment file is made.

    On this page

    A payment proposal is the plan to pay one bill. You prepare it, an approver approves it, and you export the approved proposals as one table. Your bank executes the payments. Treasury follows each one until a statement confirms it or the bank returns it.

    Status

    The path is draft, awaiting_approval, approved, exported, then confirmed or rejected_by_bank. A decline sends awaiting_approval back to draft.

    StatusMeaning
    draft Prepared for a bill and not sent yet, or sent back by an approver with a reason.
    awaiting_approval Sent for approval. An approver whose authority covers the amount approves or declines it.
    approved Approved. It can go into a payment file.
    exported Part of a payment file. Your bank executes it.
    confirmed A statement shows the debit booked. A later return can still move it to rejected_by_bank.
    rejected_by_bank The bank returned or rejected the payment. bankReason holds its words. This status is final.

    The proposal object

    FieldMeaning
    numberThe number of the proposal, such as PP-1003. It goes into the payment file and into the reference of the payment.
    openItemIdThe bill to pay. billNumber is its number.
    accountIdThe account the payment leaves.
    amountThe amount to pay, at most what the bill still owes.
    dueOnThe day the bill is due. executeOn is the day the payment is executed: the scheduled day until the proposal is exported, then the day of its file.
    statusOne of the six statuses above.
    requiredAuthorityaccountant or director: the authority an approver needs for this amount.
    preparedByWho prepared the proposal.
    approvalsThe approvals given: who and when.
    declinedThe last refusal, with its reason, or null.
    batchIdThe payment file the proposal was exported in, or null.
    bankReasonThe reason the bank gave when it returned the payment, or null.
    revisionSend it as expectedRevision when you change the proposal.

    Who may approve

    Approval depends on the amount. The account has a limit: up to it an accountant approves, above it a director. The limit is a setting of the account, so read requiredAuthority on the proposal instead of comparing amounts yourself. A director may approve any amount.

    listPeople returns the people of the account with the authority each holds: accountant, director or null. A person with null prepares payments and approves none. The person who prepared a proposal never approves or declines it, whatever authority that person holds.

    The people of the account

    [
      {
        "name": "Sorin Avram",
        "role": "Purchasing",
        "authority": null
      },
      {
        "name": "Ioana Marin",
        "role": "Chief accountant",
        "authority": "accountant"
      },
      {
        "name": "Ana Rusu",
        "role": "Finance director",
        "authority": "director"
      }
    ]

    approvePayment sends the personId of the approver. The checks run in this order, and the first that fails answers.

    CodeHTTPWhat it means
    invalid_payment_status422The payment proposal is not in a status that allows this.
    not_an_approver422The person named in personId does not approve payments in this account.
    self_approval422The person who prepared a payment proposal does not approve or decline it.
    insufficient_authority422The amount needs a higher approval than the approver holds.

    Decline

    declinePayment needs a reason and the personId of an approver other than the preparer (reason_required, not_an_approver, self_approval). The proposal goes back to draft, and declined keeps who, when and why. Send it for approval again when it is ready; that clears declined.

    JSON

    {
      "number": "PP-1005",
      "status": "draft",
      "requiredAuthority": "director",
      "declined": {
        "by": "Ana Rusu",
        "at": "2026-11-23T07:12:00Z",
        "reason": "Ask for the credit note first"
      }
    }

    Export: one table, one execution day

    exportPayments takes approved proposals and returns a payment file: one table with a header row and one row for each payment. The proposals move to exported and carry the batchId of the file. The file has one executeOn day, the earliest scheduled executeOn of its payments, so no payment is late. Each exported proposal then carries the day of its file in its own executeOn. See Accounts and balances for how a day is chosen.

    The table of a payment file

    {
      "executeOn": "2026-12-04",
      "rows": [
        [
          "payment",
          "beneficiary",
          "account",
          "amount",
          "currency",
          "execution_date",
          "reference"
        ],
        [
          "PP-1006",
          "Ambalaje Carpatin SRL",
          "RO** **** **** **** **** 0000",
          "4120.75",
          "RON",
          "2026-12-04",
          "AC-2026-0761 PP-1006"
        ]
      ]
    }

    A file holds payments of one account. Payments of two accounts are refused with mixed_accounts, an empty list with batch_empty, and a proposal that is not approved with invalid_payment_status. The reference of each row ends with the proposal number; the next section depends on it.

    How a statement confirms a payment

    When you import a statement, an exported proposal becomes confirmed if a booked debit names the proposal number in its reference and equals the amount of the proposal. A pending line confirms nothing; it can after a later statement books it.

    When the bank returns the payment

    A statement line with status returned and a returnOf that points at the payment line moves the proposal to rejected_by_bank. This works from exported and from confirmed. bankReason holds the reason of the bank as written.

    JSON

    {
      "number": "PP-1002",
      "status": "rejected_by_bank",
      "bankReason": "Beneficiary account closed"
    }

    One active proposal for each bill

    A bill has one proposal at a time. A second one is refused with bill_has_proposal while the first is in any status except rejected_by_bank. After the bank rejects a payment, match its return: the bill then owes its amount again, and you can prepare a new proposal. Before that, the amount is refused with amount_exceeds_open. See Handle a returned payment.

    Next: Prepare and approve payments and Payment proposals in the API reference.