Mark Invoices and Bills as Paid

Marking invoices as paid is not always a straightforward process due to the underlying business logic in accounting systems like Quickbooks, Sage, NetSuite, Xero, etc. In many cases, the invoice status is a computed field, which means it cannot be directly modified. Below are the different ways to mark invoices and bills as paid via the Accounting API.

Invoices Payments

Apideck provides a solution to update the status of an invoice by allocating a payment to it. This process effectively marks the invoice as paid. Here's how it works:

  1. Add a payment using the Add Payment API.
  2. In the payment request, include the invoice details in the
    allocations
    object.
  3. The accounting system will then automatically update the invoice status based on the payment allocation.

This approach ensures that the payment is properly recorded and the invoice status is updated in accordance with the accounting system's rules. Here's an example of how to structure your payment request:

{
  "currency": "USD",
  "currency_rate": 0.69,
  "total_amount": 49.99,
  "allocations": [
    {
      "id": "123456",
      "type": "invoice",
      "amount": 49.99
    }
  ],
  "reference": "123456",
  "payment_method": "Credit Card",
  "payment_method_reference": "123456",
  "payment_method_id": "123456",
  "accounts_receivable_account_type": "Account",
  "accounts_receivable_account_id": "123456",
  "account": {
    "id": "123456",
    "nominal_code": "N091",
    "code": "453"
  },
  "transaction_date": "2021-05-01T12:00:00.000Z",
  "customer": {
    "id": "12345",
    "display_name": "Windsurf Shop",
    "name": "Windsurf Shop"
  },
  "supplier": {
    "id": "12345",
    "display_name": "Windsurf Shop"
  },
  "reconciled": true,
  "status": "authorised",
  "type": "accounts_receivable",
  "note": "Some notes about this payment",
  "row_version": "1-12345",
  "display_id": "123456"
}

Bill Payments

Apideck provides a solution to update the status of a bill by allocating a payment to it. This process effectively marks the bill as paid. Here's how it works:

  1. Add a payment using the Add Bill Payment API.
  2. In the payment request, include the bill details in the
    allocations
    object.
  3. The accounting system will then automatically update the bill status based on the payment allocation.

This approach ensures that the payment is properly recorded and the bill status is updated in accordance with the accounting system's rules. Here's an example of how to structure your bill payment request:

{
  "currency": "USD",
  "currency_rate": 0.69,
  "total_amount": 1000,
  "reference": "123456",
  "payment_method": "cash",
  "payment_method_reference": "123456",
  "payment_method_id": "12345",
  "account": {
    "id": "123456",
    "nominal_code": "N091",
    "code": "453"
  },
  "transaction_date": "2021-05-01T12:00:00.000Z",
  "supplier": {
    "id": "12345",
    "display_name": "Windsurf Shop"
  },
  "company_id": "12345",
  "reconciled": true,
  "status": "authorised",
  "type": "accounts_payable",
  "allocations": [
    {
      "id": "123456",
      "type": "bill",
      "amount": 49.99,
      "allocation_id": "123456"
    }
  ],
  "note": "Some notes about this transaction",
  "number": "123456",
  "tracking_categories": [
    {
      "id": "123456",
      "name": "New York"
    }
  ],
  "custom_fields": [
    {
      "id": "2389328923893298",
      "name": "employee_level",
      "description": "Employee Level",
      "value": "Uses Salesforce and Marketo"
    }
  ],
  "row_version": "1-12345",
  "display_id": "123456",
  "pass_through": [
    {
      "service_id": "string",
      "operation_id": "string",
      "extend_object": {},
      "extend_paths": [
        {
          "path": "$.nested.property",
          "value": {
            "TaxClassificationRef": {
              "value": "EUC-99990201-V1-00020000"
            }
          }
        }
      ]
    }
  ]
}