Request parameters

  • tenant - (mandatory) - business tenant
  • account_id - (conditional) - Account ID
  • account_name - (conditional) - Account Name
  • account_code - (conditional) - Account Code
  • amount - (mandatory) - Payment Amount
  • balance_name - (optional; default default_payment_balance()) - name of the balance where to add payment on; if not provided, will be taken from configuration
  • invoice_id - (optional; default "") - which invoice should be covered, if any
  • channel - (optional; default "default") - Payment processing channel
  • paym_ext_id - (optional; default hash()) - External Payment ID


One of conditional parameters: account_id, or account_code, or account_name - is mandatory to be provided.

Response parameters

Besides usual processing_result section, successful AddPayment API response also contains

  • AddPayment.response.balance_name
  • AddPayment.response.balance_before
  • AddPayment.response.balance_after


Request:

{
  "tenant": "zegoal",
  "account_id": 13,
  "amount": 700
}
CODE


Response (success):

{
  "AddPayment": {
    "request": {
      "tenant": "zegoal",
      "amount": 700,
      "account_id": 13
    },
    "response": {
      "tenant": "zegoal",
      "result": "successful",
      "payment_id": 2,
      "payment_distrib_mode": "partial",
      "paym_ext_id": "DA0OrDQBVxyx",
      "invoice_id": "",
      "channel": "default",
      "balance_name": "Money_BYN",
      "balance_before": 700,
      "balance_after": 1400,
      "amount": 700,
      "acc_id": 13,
      "TZ": "Europe/Minsk"
    }
  }
}
CODE

Response (error), e.g. when acc_id or amount are not provided:

{
  "processing_result": {
    "text": "Not all required parameters matched",
    "status": "error",
    "code": 1
  },
  "processing_date": "2018-01-10 13:55:39 +00:00",
  "AddPayment": {
    "response": "false",
    “request": {
      "tenant": "taskvizor",
      "paym_ext_id": "qwerty123",
      "amount": 123
    }
  }
}
CODE