General

Finance

General Finance API documentation

Introduction

The finance API call is used to get and create quotes, invoices, credit notes, sales and purchase orders.

Get Finance Document List

This API will retrieve a list of all the financial documents like quotes, invoices, credit notes, sales and purchase orders.

Path
POST `/finance/documents/{people

Response:

{
    "records": [
        {
            "id": "950f3632-436d-4c5e-9e11-b1eeca3af651",
            "document_number": "INV00000004303",
            "date_issue": "2024-02-28T00:00:00.000Z",
            "date_due": "2024-03-28T00:00:00.000Z",
            "amount_excl": "600.00",
            "amount_incl": "600.00",
            "amount_tax": "0.00",
            "total_discount": "0.00",
            "unique_id": "012328f5faab2e238a321435f6ad5a4527eeeda322920758f9fd5fb5a563c95a",
            "created_at": "2024-02-28T08:30:22.642Z",
            "type_lookups_id": "02347884-d1c9-4726-a30a-0d30e6564ece",
            "payment_status_lookups_id": "bea388ba-508e-4ef4-9c9d-a052b3bf505e",
            "cancelled_at": null,
            "status_lookups_id": "fac17da9-f873-4afc-8ee0-c9c807cf9fda",
            "type_title": "Invoice",
            "status_title": "Sent",
            "status_class": "success",
            "payment_status_title": "Outstanding",
            "payment_status_class": "warning",
            "currency": "ZAR",
            "transaction_reference": null,
            "transactions_id": null,
            "name": "Invoice",
            "path": "invoices"
        },
        ...
    ]
}

All lookup values can be found under: Lookups API

Error Response:

{
    "status": false,
    "error": "Not authorized to make this API call. Requesting Read on General."
}

When you get this API response ensure that under the API keys section your API Key has the correct permissions: API Keys

Create a document

This API will create a finance document record on SwitchTransact.

Path
POST `/finance/documents/{invoice

JSON Body:

{
    "accounts_currencies_id": "cddbc163-86b0-41f7-8539-d41ce9a9ef76",
    "amount_types_lookups_id": "512e1290-3df5-4782-b5ac-9b0ffbeb8afa",
    "amount_discount": "0.00",
    "companies_id": "{companies record_id}",
    "people_id": "{people record_id}",
    "items": [
        {
            "discount": 0.00,
            "product_id": null,
            "product_text": "Test description for product",
            "price": "31.00",
            "unit": "p/a",
            "qty": 1,
            "account_id": "{ optional: people record id if it is linked to a line item }"
        },
        ...
    ]
}

All lookup values can be found under: Lookups API

Success Response:

{
    "recordId": "{GUID record id}",
    "uniqueId": "{Public ID string}"
    "record": {
      ...
    }
}

Error Response:

{
    "error": "Not authorized to make this API call. Requesting Read on General."
}

Copyright © 2024 SwitchTransact