HTTP Operation Type Object DTO Why-DTOs?
(Mutation) purchaseOpenItemSettlement PurchaseOpenItemSettlementGLDtoInput

Description

The PurchaseOpenItemSettlement service is designed to manage the settlement of open items in financial accounts, allowing users to adjust payments against outstanding invoices partially or fully.
The purpose of this action is to target open items that have not yet been fully paid (status = NOT_SPECIFIED or PARTIAL) related to a sales invoice.
A total or partial amount for each due date can be specified.
The action will then create a bank entry and modify the open items to align them with the elements mentioned in the action.
img

How to retrieve the IDs of open items?
  1. Retrieving open items from accounting entries
    This method is used when sales invoices have not been recorded in Sage Active, and only the accounting entries related to these invoices have been entered or imported.
    Open items are accessible via accountingEntries/accountingEntryLines/accountingEntryInvoice/openItems.
    Refer to the πŸ†• AccountingEntry - Pending Open Items of a Specific Invoice by Due Date example in the Postman collection under the Discover DATA LOADER Query Samples section.

  2. Retrieving open items directly from purchase invoices
    This approach is applicable when purchase invoices are available in Sage Active.
    It allows for direct access to open items without going through the accounting entries.
    Use purchaseOpenItemSettlement for direct retrieval.
    Refer to the πŸ†• purchaseInvoice - Pending Open Items of a Specific Invoice by Due Date example in the Postman collection under the Discover DATA LOADER Query Samples section.

Functionality

Input Parameters

Settlement Details: Specify the details of the settlement.

Open Items: Mandatory, specify the open items and the amounts for settlement.

Response

The service can return the following fields:

These fields confirm that the sales invoice has been successfully posted.

Key Value
Authorization Bearer Current access Token How to find?
X-TenantId Current tenant id How to find?
X-OrganizationId Current organization Id How to find?
x-api-key Primary or secondary subscription key of your app How to find?
graphQL Mutation
mutation($input: PurchaseOpenItemSettlementGLDtoInput!) {
  purchaseOpenItemSettlement(input: $input) {
    accountingEntryId
    accountingEntryNumber
  }
}
graphQL Variables
{
  "input": {
    "entryDate": "2024-01-01",
    "paymentMethodId": "815c1835-90dd-4e62-8504-79a3f97fac67",
    "description": "Full settlement of Invoice IN0022",
    "documentNumber": "IN00022",
    "thirdPartyId": "815c1835-9cb5-4e62-8504-79a3f97fac67",
    "purchaseOpenItemLinkagePaidAmounts": [
        {
            "openItemId": "815c1835-a4e7-4e62-8504-79a3f97fac67",
            "paidAmount": 500
        },{
            "openItemId": "815c1835-a647-4e62-8504-79a3f97fac67",
            "paidAmount": 792
        }
    ]
  }
}
Example Response: Returns the Identifiers of the Accounting Entry
{
  "accountingEntryId": "bb8f0f4d-5537-4e29-842d-6b0d9db8abfe"
  "accountingEntryNumber": 237
}

purchaseOpenItemSettlement Input parameters

Fields Type Description
entryDate Date Date of the entry
paymentMethodId UUID Bank Account and cash Id
description String Description of the settlement action
documentNumber String Reference number for the document
thirdPartyId UUID Third party involved
purchaseOpenItemLinkagePaidAmounts List List of open items and the paid amounts

purchaseOpenItemSettlement/purchaseOpenItemLinkagePaidAmount

Fields Type Description
openItemId UUID Unique identifier of the open item to settle.
paidAmount Number Amount paid for the specified open item.

purchaseOpenItemSettlement Response

Fields Type Description
id UUID Unique identifier of the financial entry created