Supplier & Customer Payment

  • This module handles any type of payment made by a customer or a to a supplier.

  • For payments to a supplier:

    • set the value of payment_type to Pay

    • set the value of party_type to Supplier

    • set the value of party to the name of the supplier

  • For payments by a customer:

    • set the value of payment_type to Receive

    • set the value of party_type to Customer

    • set the value of party to the name of the customer

  • If you need to attach a payment against an existing document such as a Purchase Invoice, make sure you provide the details of the document under the payment_references field. If you are not attaching to an existing document, do not provide values to the payment_references. However, note that by not doing so, you will have to manually reconcile payments yourself

  • The id of the existing document must be provided and is the id that exists on the backend.

  • If you are unsure which ID it is, you can get the ids using the .list endpoint of the respective document type such as {SERVER_URL}/api/method/eclectics.api.purchase_invoice.list and pass the relevant filters. You can then filter through the returned items and pick the one of interest

  • The standard type of the document must also be specified e.g Purchase Invoice

Create a Supplier Payment Entry

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.payment_entry.create

  • Method: POST

  • Payload:

{
    "transaction_date": "2025-04-10",
    "created_by": "Nyaga",
    "created_on": "2025-04-16",
    "approved_by": "Steve",
    "approved_on": "2025-04-20",
    "company_code": "001",
    "branch_code": "Branch 2",
    "branch_dim_code": "Branch Dim 2",
    "document_type": "Contractual",
    "document_no": "333/45",
    "contract_no": "333/45/2025",
    "customer_no": "CUST-1",
    "customer_name": "XYZ Customer",
    "reversed": false,
    "document_date": "2025-01-02",
    "enquiry_no": "INQ/1/2025",
    "payment_type": "Pay",
    "mode_of_payment": "Cash",
    "party_type": "Supplier",
    "party": "Summit Traders Ltd.",
    "paid_amount": 300,
    "posting_date": "2025-02-24",
    "transaction_code": "COP",
    "reference_no": null,
    "reference_date": null,
    "payable_receivable_account": "0001906-TZS",
    "payment_references": [
        {
            "document_type": "Purchase Invoice",
            "document_name": "ACC-PINV-2025-00005",
            "allocated_amount": 100
        }
    ]
}
  • Headers:

{
    "Authorization": "token <YOUR_TOKEN>"
}
  • These fields may not be exhaustive. Check the general guidance section on how to check all the parameters that an endpoint can accept

Create a Multi-Currency Supplier Payment Entry

Notes:

Warning

You will be able to include accounts which have different currencies in a Payment Entry. If you have a Mode of Payment which refers to an account that is different from the company base currency, you must provide the exchange against the base currency.

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.payment_entry.create

  • Method: POST

  • Payload:

{
    "transaction_date": "2025-04-10",
    "created_by": "Nyaga",
    "created_on": "2025-04-16",
    "approved_by": "Steve",
    "approved_on": "2025-04-20",
    "company_code": "001",
    "branch_code": "Branch 2",
    "branch_dim_code": "Branch Dim 2",
    "document_type": "Contractual",
    "document_no": "333/45",
    "contract_no": "333/45/2025",
    "customer_no": "CUST-1",
    "customer_name": "XYZ Customer",
    "reversed": false,
    "document_date": "2025-01-02",
    "enquiry_no": "INQ/1/2025",
    "payment_type": "Pay",
    "mode_of_payment": "Wire Transfer USD",
    "party_type": "Supplier",
    "party": "Summit Traders Ltd.",
    "paid_amount": 30,
    "posting_date": "2025-02-24",
    "transaction_code": "COP",
    "exchange_rate": 2598.4401,
    "reference_no": "TRFFFSG245874",
    "reference_date": "2025-01-31",
    "payable_receivable_account": "0001906-TZS",
    "payment_references": [
        {
            "document_type": "Purchase Invoice",
            "document_name": "ACC-PINV-2025-00005",
            "allocated_amount": 10
        }
    ]
}
  • In the example above, the mode of payment Wire Transfer USD is linked to an account that has its currency as USD. For this payment, a total of 30 USD was paid and only 10 USD went towards clearing the purchase invoice ACC-PINV-2025-00005. The prevailing exchange of 1USD - TSZ is 2598.4401.

  • Headers:

{
    "Authorization": "token <YOUR_TOKEN>"
}
  • These fields may not be exhaustive. Check the general guidance section on how to check all the parameters that an endpoint can accept

Create a Customer Payment Entry

Details

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.payment_entry.create

  • Method: POST

  • Payload:

{
    "transaction_date": "2025-04-10",
    "created_by": "Nyaga",
    "created_on": "2025-04-16",
    "approved_by": "Steve",
    "approved_on": "2025-04-20",
    "company_code": "001",
    "branch_code": "Branch 2",
    "branch_dim_code": "Branch Dim 2",
    "document_type": "Contractual",
    "document_no": "333/45",
    "contract_no": "333/45/2025",
    "customer_no": "CUST-1",
    "customer_name": "XYZ Customer",
    "reversed": false,
    "document_date": "2025-01-02",
    "enquiry_no": "INQ/1/2025",
    "title": "First Customer Payment",
    "payment_type": "Receive",
    "mode_of_payment": "Cash",
    "party_type": "Customer",
    "party": "West View Software Ltd.",
    "paid_amount": 1000,
    "posting_date": "2025-02-19",
    "reference_no": null,
    "reference_date": null,
    "payable_receivable_account": "0001906-TZS",
    "payment_references": [
        {
            "document_name": "ACC-SINV-2025-00003",
            "document_type": "Sales Invoice",
            "allocated_amount": 1000
        }
    ]
}
  • Headers:

{
    "Authorization": "token <YOUR_TOKEN>"
}
  • These fields may not be exhaustive. Check the general guidance section on how to check all the parameters that an endpoint can accept

Create a Multi-Currency Customer Payment Entry

Warning

  • You will be able to include accounts which have different currencies in a Payment Entry. If you have a Mode of Payment which refers to an account that is different from the company base currency, you must provide the exchange against the base currency.

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.payment_entry.create

  • Method: POST

  • Payload:

{
    "transaction_date": "2025-04-10",
    "created_by": "Nyaga",
    "created_on": "2025-04-16",
    "approved_by": "Steve",
    "approved_on": "2025-04-20",
    "company_code": "001",
    "branch_code": "Branch 2",
    "branch_dim_code": "Branch Dim 2",
    "document_type": "Contractual",
    "document_no": "333/45",
    "contract_no": "333/45/2025",
    "customer_no": "CUST-1",
    "customer_name": "XYZ Customer",
    "reversed": false,
    "document_date": "2025-01-02",
    "enquiry_no": "INQ/1/2025",
    "title": "First Multi Currency Payment",
    "payment_type": "Receive",
    "mode_of_payment": "Wire Transfer USD",
    "party_type": "Customer",
    "party": "West View Software Ltd.",
    "paid_amount": 100,
    "posting_date": "2025-02-19",
    "exchange_rate": 2598.4401,
    "reference_no": "TRSG232XX344",
    "reference_date": "2025-01-31",
    "payable_receivable_account": "0001906-TZS",
    "payment_references": [
        {
            "document_name": "ACC-SINV-2025-00003",
            "document_type": "Sales Invoice",
            "allocated_amount": 100
        }
    ]
}
  • In the example above, the mode of payment Wire Transfer USD is linked to an account that has its currency as USD. For this payment, a total of 100 USD was received and the full amount went towards clearing the purchase invoice ACC-PINV-2025-00005. The prevailing exchange of 1USD - TSZ is 2598.4401.

  • Headers:

{
    "Authorization": "token <YOUR_TOKEN>"
}
  • These fields may not be exhaustive. Check the general guidance section on how to check all the parameters that an endpoint can accept

Get a list of Payment Entries

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.payment_entry.list

  • Method: GET

  • Payload:

{
    "fields": [
        "name",
        "posting_date",
        "payment_type",
        "party_type",
        "party",
        "paid_amount"
    ],
    "filters": [["posting_date", "<", "2025-02-24"]],
    "start": 0,
    "page_length": 0,
    "order_by": "creation desc"
}
  • Headers:

{
    "Authorization": "token <YOUR_TOKEN>"
}

Get a single Payment Entry

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.payment_entry.get

  • Method: GET

  • Payload:

{
    "doc_id_": "ACC-PAY-2025-00011"
}
  • Headers:

{
    "Authorization": "token <YOUR_TOKEN>"
}

Delete a Payment Entry

  • Endpoint: {SERVER_URL}/api/method/eclectics.api.payment_entry.delete

  • Method: DELETE

  • Payload:

{
    "doc_id_": "ACC-PAY-2025-00011"
}
  • Headers:

{
    "Authorization": "token <YOUR_TOKEN>"
}