General

Finance

General Finance API documentation

Introduction

The finance API calls are used to get and create quotes, invoices, credit notes, sales, purchase orders and other financial data.

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|company}/list/{record_id|public_id}

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|quote|sales-order|purchase-order|credit-note}/create

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."
}

List Payment Methods

List the payment methods available. All lookup values can be found under: Lookups API

Path
GET /finance/payment/methods

Success Response:

{
    "status": true,
    "records": [{
        "id": "{unique record_id}",
        "is_active": true,
        "pre_process_days": 10,
        "item_limit": "20000.00",
        "warning_limit": "10000.00",
        "abbreviated_name": "TST FUND",
        "is_test": false,
        "process_lookups_id": "ed8560ec-4ee2-422e-89b6-2e768ad09839",
        "is_default": true,
        "bank_reference": "TSTF",
        "is_enable_invoice_payment": true,
        "subscriptions_document_type_lookups_id": "02347884-d1c9-4726-a30a-0d30e6564ece",
        "companies_subscriptions_email_messages_templates_id": "{messages_templates record_id}",
        "companies_subscriptions_sms_messages_templates_id": "{messages_templates record_id}",
        "companies_subscriptions_email_paid_messages_templates_id": "{messages_templates record_id}",
        "companies_subscriptions_sms_paid_messages_templates_id": "{messages_templates record_id}",
        "people_subscriptions_email_messages_templates_id": "{messages_templates record_id}",
        "people_subscriptions_sms_messages_templates_id": "{messages_templates record_id}",
        "people_subscriptions_email_paid_messages_templates_id": "{messages_templates record_id}",
        "people_subscriptions_sms_paid_messages_templates_id": "{messages_templates record_id}",
        "is_send_finance_documents": true,
        "is_generate_subscription_document_on_failure": false
    }, ...]
}
FieldType
Description
OptionsExample
idstringUnique ID associated with the payment method and used in other API callsUUID"{unique record_id}"
is_activebooleanIf this payment method is considered to be activetrue, falsetrue
pre_process_daysintegerAmount of days batch accounts are generated in advance10
item_limitdecimalMaximum amount a subscription product may cost using this payment method20000.00
warning_limitdecimalSubscription product amounts above this amount is considered to be a warning10000.00
abbreviated_namestringShort name for this payment method"TST FUND"
is_testbooleanIf this payment method is in the testing phase or nottrue, falsefalse
process_lookups_idstringLookups ID of the process type for this payment methodUUID"ed8560ec-4ee2-422e-89b6-2e768ad09839"
is_defaultbooleanIf this payment method is considered to be the defaulttrue, falsetrue
bank_referencestringBank reference used on statements by this payment method (if applicable, used by automatic payments)"TSTF"
is_enable_invoice_paymentbooleanAllows payments of invoices from the web pagetrue, falsetrue
subscriptions_document_type_lookups_idstringDefault document type used on automatically created subscriptionsUUID"02347884-d1c9-4726-a30a-0d30e6564ece"
companies_subscriptions_email_messages_templates_idstringDefault email template ID populated on automatically created subscriptions for companiesUUID"{messages_templates record_id}"
companies_subscriptions_sms_messages_templates_idstringDefault SMS template ID populated on automatically created subscriptions for companiesUUID"{messages_templates record_id}"
companies_subscriptions_email_paid_messages_templates_idstringDefault email template ID populated on automatically created subscriptions for companies with (paid transactions)UUID"{messages_templates record_id}"
companies_subscriptions_sms_paid_messages_templates_idstringDefault SMS template ID populated on automatically created subscriptions for companies (with paid transactions)UUID"{messages_templates record_id}"
people_subscriptions_email_messages_templates_idstringDefault email template ID populated on automatically created subscriptions for peopleUUID"{messages_templates record_id}"
people_subscriptions_sms_messages_templates_idstringDefault SMS template ID populated on automatically created subscriptions for peopleUUID"{messages_templates record_id}"
people_subscriptions_email_paid_messages_templates_idstringDefault email template ID populated on automatically created subscriptions for people (with paid transactions)UUID"{messages_templates record_id}"
people_subscriptions_sms_paid_messages_templates_idstringDefault SMS template ID populated on automatically created subscriptions for people (with paid transactions)UUID"{messages_templates record_id}"
is_send_finance_documentsbooleanWhen a subscription is automatically created if the finance documents send setting should be checkedtrue, falsetrue
is_generate_subscription_document_on_failurebooleanWhen a subscription is automatically created if the finance documents generate on unpaid setting should be checkedtrue, falsefalse

List Cards

List the cards loaded by a person/company All lookup values can be found under: Lookups API

Path
GET /finance/cards/{people record_id|companies record_id}

Success Response:

{
    "status": true,
    "records": [{
        "id": "{unique record_id}",
        "people_id": "{people record_id}",
        "companies_id": "{companies record_id}",
        "card_name": "J DOE",
        "card_nickname": "My Visa card",
        "card_number_obfuscated": "**** **** **** 1234",
        "is_default": true,
        "is_active": true,
        "card_expire_date": "YYYY-MM-DD",
        "payment_methods_id": "{payment_methods record_id}",
        "status_lookups_id": "0fb2eadd-2963-4a04-b3ac-35d0168127d9"
    }, ...]
}
FieldType
Description
OptionsExample
idstringUnique ID of the cards record and used in other API callsUUID"{unique record_id}"
people_idstringPeople ID associated with the cardUUID"{people record_id}"
companies_idstringCompany ID associated with the cardUUID"{companies record_id}"
card_namestringCard name"J DOE"
card_nicknamestringNickname given to the card (display purposes only)"My Visa card"
card_number_obfuscatedstringObfuscated card number"**** **** **** 1234"
is_defaultbooleanIf this card is considered to be the defaulttrue, falsetrue
is_activebooleanIf this card is considered to be activetrue, falsetrue
card_expire_datedateDate when the card expires"YYYY-MM-DD"2025-09-01
payment_methods_idstringPayment method ID associated with the cardUUID"{payment_methods record_id}"
status_lookups_idstringStatus lookups ID of the cardUUID"0fb2eadd-2963-4a04-b3ac-35d0168127d9"

List Products

List the products available. All lookup values can be found under: Lookups API

Path
GET /finance/products

Success Response:

{
    "status": true,
    "records": [{
        "id": "{unique record_id}",
        "name": "Gold member",
        "unique_id": "GM",
        "unit_name": "membership",
        "unit_label": "p/m",
        "accounting_code": "G1234",
        "price": "245.55",
        "is_fixed_price": false,
        "pricing_lookups_id": "1e694821-3e85-46b0-9da1-4d26980616f3",
        "interval_sequence": 1,
        "interval_time_lookups_id": "241be562-fc68-4769-8c2c-014e3da5a2c3",
        "default_accounts_tax_id": "{accounts_tax record_id}",
        "is_active": true,
        "is_fixed_quantity": false,
        "default_quantity": 1,
        "accounts_currencies_id": "{accounts_currencies record_id}",
        "is_membership_product": true,
        "description": "monthly gold membership",
        "entry_class_lookups_id": "a57e1fcc-aae7-4b0b-9256-7c8e2729109d"
    }, ...]
}
FieldType
Description
OptionsExample
idstringUnique ID of the product and used in other API callsUUID"{unique record_id}"
namestringName given to the product"Gold member"
unique_idstringUnique ID given to the product"GM"
unit_namestringUnit name of the product"membership"
unit_labelstringUnit label of the product"p/m"
accounting_codestringAccounting code of the product"G1234"
pricedecimalPrice of the product245.55
is_fixed_pricebooleantrue - price may not be changed in subscription productstrue, falsefalse
pricing_lookups_idstringPricing type lookups IDUUID"1e694821-3e85-46b0-9da1-4d26980616f3"
interval_sequenceintegerInterval of the product (how often it would run e.g. once a month, every second month etc)1
interval_time_lookups_idstringInterval time lookups ID of the product e.g. monthlyUUID"241be562-fc68-4769-8c2c-014e3da5a2c3"
default_accounts_tax_idstringAccounts tax ID associated with this productUUID"{accounts_tax record_id}"
is_activebooleanIf this product is considired to be activetrue, falsetrue
is_fixed_quantitybooleantrue - quantity may not be changed in subscription productstrue, falsefalse
default_quantityintegerDeault quantity of this product1
accounts_currencies_idstringAccount currency ID associated with this productUUID"{accounts_currencies record_id}"
is_membership_productbooleantrue - if this product counts towards membership paid up statustrue, falsetrue
descriptionstringDescription of the product"monthly gold membership"
entry_class_lookups_idstringBank entry class associated with this product e.g. account repayment, charitable payment etc.UUID"a57e1fcc-aae7-4b0b-9256-7c8e2729109d"

Banking Details

These API calls allow for manipulating banking details. All lookup values can be found under: Lookups API

Create

Path
POST /finance/banking/details/create

JSON Body:

{
    "account_name": "J Doe",
    "account_number": "10004291601",
    "branch_code": "051001",
    "bank_lookups_id": "b6db0d6f-e6fe-4671-8803-f3cb34f9b417",
    "account_type_lookups_id": "57e2ad24-7f2d-4f8e-853c-11a1e3a229ab",
    "is_active": true,
    "companies_id": "{companies record_id}",
    "people_id": "{people record_id}"
}

R/C/O Required/Conditional/Optional

FieldTypeR/C/O
Description
OptionsExample
account_namestringRBank account holder namemax 30 characters, alpha numeric with spacesJ Doe
account_numberintegerRBank account numbermax 17 digits10004291601
branch_codeintegerRUniversal branch code of the associated bankMax 6 digits051001
bank_lookups_idStringRLookups ID of the associated bankUUID, Lookups type 'Bank' and category 'BankAccounts'b6db0d6f-e6fe-4671-8803-f3cb34f9b417
account_type_lookups_idstringRLookups ID of the bank account typeUUID, Lookups type 'Type' and category 'BankAccounts'57e2ad24-7f2d-4f8e-853c-11a1e3a229ab
is_activebooleanOIf this bank account is currently activedefaults to falsetrue
companies_idStringC - either people id or companies id must be definedID of the associated companyUUID"{companies record_id}"
people_idStringC - either people id or companies id must be definedID of the associated personUUID"{people record_id}"

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        ...
    }
}

Error Response:

{
    "status": false,
    "error": "Error, account fields are not correct",
    "errors": {
        "account_name": {
            "message": "account name is required",
            "rule": "required"
        }
    }
}

View

Path
GET /finance/banking/details/{banking_details record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the banking details returned upon createUUID"{banking_details record_id}"

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        "account_name": "J Doe",
        "account_number": "10004291601",
        "branch_code": "051001",
        "bank_lookups_id": "b6db0d6f-e6fe-4671-8803-f3cb34f9b417",
        "account_type_lookups_id": "57e2ad24-7f2d-4f8e-853c-11a1e3a229ab",
        "accounts_currencies_id": "cddbc163-86b0-41f7-8539-d41ce9a9ef76",
        "is_active": true,
        "companies_id": "{companies record_id}",
        "people_id": "{people record_id}"
    }
}
FieldType
Description
OptionsExample
recordObjectDetails of the record in question
record .account_namestringBank account holder namemax 30 characters, alpha numeric with spacesJ Doe
record .account_numberintegerBank account numbermax 17 digits10004291601
record .branch_codeintegerUniversal branch code of the associated bankMax 6 digits051001
record .bank_lookups_idStringLookups ID of the associated bankUUIDb6db0d6f-e6fe-4671-8803-f3cb34f9b417
record .account_type_lookups_idstringLookups ID of the bank account typeUUID57e2ad24-7f2d-4f8e-853c-11a1e3a229ab
record .is_activebooleanIf this bank account is currently activedefaults to falsetrue
record .companies_idStringID of the associated companyUUID"{companies record_id}"
record .people_idStringID of the associated personUUID"{people record_id}"

Error Response:

{
    "status": false,
    "error": "Record ID could not be found"
}

Edit

Path
POST /finance/banking/details/edit/{banking_details record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the banking details returned upon createUUID"{banking_details record_id}"

JSON Body:

{
    "account_name": "J Doe",
    "account_number": "10004291601",
    "branch_code": "051001",
    "bank_lookups_id": "b6db0d6f-e6fe-4671-8803-f3cb34f9b417",
    "account_type_lookups_id": "57e2ad24-7f2d-4f8e-853c-11a1e3a229ab",
    "is_active": true,
    "companies_id": "{companies record_id}",
    "people_id": "{people record_id}",
}

R/C/O Required/Conditional/Optional

FieldTypeR/C/O
Description
OptionsExample
account_namestringRBank account holder namemax 30 characters, alpha numeric with spacesJ Doe
account_numberintegerRBank account numbermax 17 digits10004291601
branch_codeintegerRUniversal branch code of the associated bankMax 6 digits051001
bank_lookups_idStringRLookups ID of the associated bankUUID, Lookups type 'Bank' and category 'BankAccounts'b6db0d6f-e6fe-4671-8803-f3cb34f9b417
account_type_lookups_idstringRLookups ID of the bank account typeUUID, Lookups type 'Type' and category 'BankAccounts'57e2ad24-7f2d-4f8e-853c-11a1e3a229ab
is_activebooleanOIf this bank account is currently activedefaults to falsetrue
companies_idStringC - either people id or companies id must be definedID of the associated companyUUID"{companies record_id}"
people_idStringC - either people id or companies id must be definedID of the associated personUUID"{people record_id}"

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        ...
    }
}

Error Response:

{
    "status": false,
    "error": "Error, account fields are not correct",
    "errors": {
        "account_name": {
            "message": "account name is required",
            "rule": "required"
        }
    }
}

Delete

Path
DELETE /finance/banking/details/delete/{banking_details record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the banking details returned upon createUUID"{banking_details record_id}"

Success Response:

{
    "status": true,
    "message": "Record has been removed"
}

Error Response:

{
    "status": false,
    "error": "Record ID could not be found"
}

Subscriptions

These API calls allow for manipulating subscription details. All lookup values can be found under: Lookups API

Create

Path
POST /finance/subscriptions/create

JSON Body:

{
    "companies_id": "{companies record_id}",
    "people_id": "{people record_id}",
    "date_start": "YYYY-MM-DD",
    "date_end": null,
    "billing_day": 31,
    "is_send_finance_documents": true,
    "default_payment_methods_id": "{payment_methods record_id}",
    "document_type_lookups_id": "02347884-d1c9-4726-a30a-0d30e6564ece",
    "document_email_template_lookups_id": "{messages_templates record_id}",
    "document_paid_email_template_lookups_id": "{messages_templates record_id}",
    "document_sms_template_lookups_id": "{messages_templates record_id}",
    "document_paid_sms_template_lookups_id": "{messages_templates record_id}",
    "bank_accounts_id": "{bank_accounts record_id}",
    "cards_id": "{cards record_id}",
    "status_lookups_id": "735702fe-623b-49ea-89ff-90faf5dc4a22",
    "memo": "some memo about the subscription",
    "is_generate_document_on_failure": true,

    "debicheck_client_reference": "CL000001",
    "debicheck_contract_reference": "CT000001",
    "debicheck_debtor_full_name": "J DOE",
    "debicheck_debtor_ultimate_name": null,
    "debicheck_maximum_collection_amount": 150,
    "debicheck_authentication_instrument_lookups_id": "e278a5ba-25e6-40ce-a06d-a1c80c28fbc0",
    "debicheck_debit_value_type_lookups_id": "b2d59897-cd97-4a35-b38e-b6072f94f16d",
    "debicheck_adjustment_category_lookups_id": "3b712f6b-841a-4ba9-b638-1c8e46943061",
    "debicheck_adjustment_rate": 5.00000,
    "debicheck_adjustment_amount": null,
    "debicheck_is_tracking_enabled": true,
    "debicheck_tracking_period": 5,
    "debicheck_is_allow_date_adjustment": true,
}

R/C/O Required/Conditional/Optional

FieldTypeR/C/O
Description
OptionsExample
companies_idstringC - either people id or companies id must be providedCompany ID linked to the subscriptionUUID"{companies record_id}"
people_idstringC - either people id or companies id must be providedPeople ID linked to the subscriptionUUID"{people record_id}"
date_startdateRStarting date of the subscription"YYYY-MM-DD"2024-09-01
date_enddateOWhen the subscription is to stop running"YYYY-MM-DD"2025-09-01
billing_dayintegerRCalendar day on which subscription is to run1 to 3124
default_payment_methods_idstringRPayment method ID associated with this subscriptionUUID"{payment_methods record_id}"
bank_accounts_idstringC - required with bank related payment methodsID of bank accounts record to be usedUUID"{bank_accounts record_id}"
cards_idstringC - required with card related payment methodsID of cards record to be usedUUID"{cards record_id}"
status_lookups_idstringRCurrent status lookups ID of the subscriptionUUID, lookups type 'Status' and category 'Subscriptions'"735702fe-623b-49ea-89ff-90faf5dc4a22"
memostringOMemo to be attached to the subscriptionmax 2048 characters"some memo about the subscription"
is_generate_document_on_failurebooleanOGenerate unpaid finance documents if a transaction is logged as unpaidture, falsetrue
document_type_lookups_idstringOType of document to generate upon paymentDefaults to none, only 'invoices' are allowed for automatic payment methods, manual payment methods allow both 'invoices' and 'sales orders'"02347884-d1c9-4726-a30a-0d30e6564ece"
is_send_finance_documentsbooleanOtrue - send out the finance document, false - only gnerate the finance documenttrue, falsetrue
document_email_template_lookups_idstringC - either email or sms template ID must be provided if send finance documents is trueEmail message template ID to be used upon paymentUUID"{messages_templates record_id}"
document_paid_email_template_lookups_idstringOEmail message template ID to be used when the payment reflects as 'paid'UUID"{messages_templates record_id}"
document_sms_template_lookups_idstringC - either email or sms template ID must be provided if send finance documents is trueSMS message template ID to be used upon paymentUUID"{messages_templates record_id}"
document_paid_sms_template_lookups_idstringOSMS message template ID to be used when the payment reflects as 'paid'UUID"{messages_templates record_id}"
debicheck_client_referencestringC - Required if DebiCheck payment providerDebicheck client reference numberMay only contain letters and numbers"CL000001"
debicheck_contract_referencestringC - Required if DebiCheck payment providerDebicheck contract reference numberMust be unique per submission and contain only letters and numbers, with a maximum of 14 characters""CT000001""
debicheck_debtor_full_namestringC - Required if DebiCheck payment providerName of the Debtor as indicated at the bank"J DOE"
debicheck_debtor_ultimate_namestringOUltimate name of the debtor (if applicable)"Doe Associates"
debicheck_maximum_collection_amountdecimalC - Required if DebiCheck payment providerMaximum collection amount (per instalment) allowed for the mandate in ZAR.This value may not exceed 1.5 times the instalment amount.150.25
debicheck_authentication_instrument_lookups_idstringC - Required if DebiCheck payment providerHost to Host: takes up to 2 hours to send out but has maximum approval window. Realtime: sent out immediately, 3 minute acceptance window. Authentication will be sent to bank registered cell number. Realtime Delayed: sent out immediately, approval window until 20:30. Realtime Exact: sent out immediately, 3 minute acceptance window. Rejected if debtor cell number does not match the bank registered cell number.UUID"e278a5ba-25e6-40ce-a06d-a1c80c28fbc0"
debicheck_debit_value_type_lookups_idstringC - Required if DebiCheck payment providerFixed: collection amount may not change. Variable: collection amount may increase.UUID"b2d59897-cd97-4a35-b38e-b6072f94f16d"
debicheck_adjustment_category_lookups_idstringC - Required if debit value type is not fixedThe interval/category at which adjustments are performedUUID - If the Adjustment category is set, either an adjustment rate or amount must be specified. Both may not be specified at the same time"3b712f6b-841a-4ba9-b638-1c8e46943061"
debicheck_adjustment_ratedecimalC - Required if adjustment category is usedInstallment % increase per adjustment intervalUp to 5 decimal places is allowed5.00000
debicheck_adjustment_amountdecimalC - Required if adjustment category is usedInstalment amount increase in ZAR value per adjustment intervalAmount in ZAR15.45
debicheck_is_tracking_enabledbooleanOIf debtor has given authority to track the account in the event of a collection failuretrue/falsetrue
debicheck_tracking_period"integerC - Required if tracking is enabledBank can monitor the account for up to 10 days and as soon as money comes in the collection can be re-submitted. Transaction becomes disputable if successfully collected on another day due to tracking.1 to 105
debicheck_is_allow_date_adjustmentbooleanOSet to true to allow all transactions to be processed irrespective of the collection datetrue/falsetrue

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        ...
    }
}

Error Response:

{
    "status": false,
    "error": "Please complete the fields below",
    "errors": {
        "billing_day": {
            "message": "billing day is required",
            "rule": "required"
        }
    }
}

View

Path
GET /finance/subscriptions/{record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the subscription returned upon createUUID"{subscriptions record_id}"

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        "companies_id": "{companies record_id}",
        "people_id": "{people record_id}",
        "date_start": "YYYY-MM-DD",
        "date_end": null,
        "billing_day": 31,
        "is_send_finance_documents": true,
        "default_payment_methods_id": "{payment_methods record_id}",
        "document_type_lookups_id": "02347884-d1c9-4726-a30a-0d30e6564ece",
        "document_email_template_lookups_id": "{messages_templates record_id}",
        "document_paid_email_template_lookups_id": "{messages_templates record_id}",
        "document_sms_template_lookups_id": "{messages_templates record_id}",
        "document_paid_sms_template_lookups_id": "{messages_templates record_id}",
        "bank_accounts_id": "{bank_accounts record_id}",
        "cards_id": "{cards record_id}",
        "status_lookups_id": "735702fe-623b-49ea-89ff-90faf5dc4a22",
        "memo": "some memo about the subscription",
        "is_generate_document_on_failure": true,

        "debicheck_client_reference": "CL000001",
        "debicheck_contract_reference": "CT000001",
        "debicheck_debtor_full_name": "J DOE",
        "debicheck_debtor_ultimate_name": null,
        "debicheck_maximum_collection_amount": 150,
        "debicheck_authentication_instrument_lookups_id": "e278a5ba-25e6-40ce-a06d-a1c80c28fbc0",
        "debicheck_debit_value_type_lookups_id": "b2d59897-cd97-4a35-b38e-b6072f94f16d",
        "debicheck_adjustment_category_lookups_id": "3b712f6b-841a-4ba9-b638-1c8e46943061",
        "debicheck_adjustment_rate": 5.00000,
        "debicheck_adjustment_amount": null,
        "debicheck_is_tracking_enabled": true,
        "debicheck_tracking_period": 5,
        "debicheck_is_allow_date_adjustment": true,
        "debicheck_mandate" : { ... },
    }
}

R/C/O Required/Conditional/Optional

FieldType
Description
OptionsExample
companies_idstringCompany ID linked to the subscriptionUUID"{companies record_id}"
people_idstringPeople ID linked to the subscriptionUUID"{people record_id}"
date_startdateStarting date of the subscription"YYYY-MM-DD"2024-09-01
date_enddateWhen the subscription is to stop running"YYYY-MM-DD"2025-09-01
billing_dayintegerCalendar day on which subscription is to run1 to 3124
default_payment_methods_idstringPayment method ID associated with this subscriptionUUID"{payment_methods record_id}"
bank_accounts_idstringID of bank accounts record to be usedUUID"{bank_accounts record_id}"
cards_idstringID of cards record to be usedUUID"{cards record_id}"
status_lookups_idstringCurrent status lookups ID of the subscriptionUUID, lookups type 'Status' and category 'Subscriptions'"735702fe-623b-49ea-89ff-90faf5dc4a22"
memostringMemo to be attached to the subscriptionmax 2048 characters"some memo about the subscription"
is_generate_document_on_failurebooleanGenerate unpaid finance documents if a transaction is logged as unpaidture, falsetrue
document_type_lookups_idstringType of document to generate upon paymentDefaults to none, only 'invoices' are allowed for automatic payment methods, manual payment methods allow both 'invoices' and 'sales orders'"02347884-d1c9-4726-a30a-0d30e6564ece"
is_send_finance_documentsbooleantrue - send out the finance document, false - only gnerate the finance documenttrue, falsetrue
document_email_template_lookups_idstringEmail message template ID to be used upon paymentUUID"{messages_templates record_id}"
document_paid_email_template_lookups_idstringEmail message template ID to be used when the payment reflects as 'paid'UUID"{messages_templates record_id}"
document_sms_template_lookups_idstringSMS message template ID to be used upon paymentUUID"{messages_templates record_id}"
document_paid_sms_template_lookups_idstringSMS message template ID to be used when the payment reflects as 'paid'UUID"{messages_templates record_id}"
debicheck_client_referencestringDebicheck client reference numberMay only contain letters and numbers"CL000001"
debicheck_contract_referencestringDebicheck contract reference numberMust be unique per submission and contain only letters and numbers, with a maximum of 14 characters""CT000001""
debicheck_debtor_full_namestringName of the Debtor as indicated at the bank"J DOE"
debicheck_debtor_ultimate_namestringUltimate name of the debtor (if applicable)"Doe Associates"
debicheck_maximum_collection_amountdecimalMaximum collection amount (per instalment) allowed for the mandate in ZAR.This value may not exceed 1.5 times the instalment amount.150.25
debicheck_authentication_instrument_lookups_idstringHost to Host: takes up to 2 hours to send out but has maximum approval window. Realtime: sent out immediately, 3 minute acceptance window. Authentication will be sent to bank registered cell number. Realtime Delayed: sent out immediately, approval window until 20:30. Realtime Exact: sent out immediately, 3 minute acceptance window. Rejected if debtor cell number does not match the bank registered cell number.UUID"e278a5ba-25e6-40ce-a06d-a1c80c28fbc0"
debicheck_debit_value_type_lookups_idstringFixed: collection amount may not change. Variable: collection amount may increase.UUID"b2d59897-cd97-4a35-b38e-b6072f94f16d"
debicheck_adjustment_category_lookups_idstringThe interval/category at which adjustments are performedUUID - If the Adjustment category is set, either an adjustment rate or amount must be specified. Both may not be specified at the same time"3b712f6b-841a-4ba9-b638-1c8e46943061"
debicheck_adjustment_ratedecimalInstallment % increase per adjustment intervalUp to 5 decimal places is allowed5.00000
debicheck_adjustment_amountdecimalInstalment amount increase in ZAR value per adjustment intervalAmount in ZAR15.45
debicheck_is_tracking_enabledbooleanIf debtor has given authority to track the account in the event of a collection failuretrue/falsetrue
debicheck_tracking_periodintegerBank can monitor the account for up to 10 days and as soon as money comes in the collection can be re-submitted. Transaction becomes disputable if successfully collected on another day due to tracking.1 to 105
debicheck_is_allow_date_adjustmentbooleanSet to true to allow all transactions to be processed irrespective of the collection datetrue/falsetrue
debicheck_mandatejsonAll DebiCheck details as submitted to the bankMostly contains the same details as submit details as well as some running logs of debicheck events

Error Response:

{
    "status": false,
    "error": "Record ID could not be found"
}

Edit

Path
POST /finance/subscriptions/edit/{record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the subscription returned upon createUUID"{subscriptions record_id}"

JSON Body:

{
    "companies_id": "{companies record_id}",
    "people_id": "{people record_id}",
    "date_start": "YYYY-MM-DD",
    "date_end": null,
    "billing_day": 31,
    "is_send_finance_documents": true,
    "default_payment_methods_id": "{payment_methods record_id}",
    "document_type_lookups_id": "02347884-d1c9-4726-a30a-0d30e6564ece",
    "document_email_template_lookups_id": "{messages_templates record_id}",
    "document_paid_email_template_lookups_id": "{messages_templates record_id}",
    "document_sms_template_lookups_id": "{messages_templates record_id}",
    "document_paid_sms_template_lookups_id": "{messages_templates record_id}",
    "bank_accounts_id": "{bank_accounts record_id}",
    "cards_id": "{cards record_id}",
    "status_lookups_id": "735702fe-623b-49ea-89ff-90faf5dc4a22",
    "memo": "some memo about the subscription",
    "is_generate_document_on_failure": true,

    "debicheck_client_reference": "CL000001",
    "debicheck_contract_reference": "CT000001",
    "debicheck_debtor_full_name": "J DOE",
    "debicheck_debtor_ultimate_name": null,
    "debicheck_maximum_collection_amount": 150,
    "debicheck_authentication_instrument_lookups_id": "e278a5ba-25e6-40ce-a06d-a1c80c28fbc0",
    "debicheck_debit_value_type_lookups_id": "b2d59897-cd97-4a35-b38e-b6072f94f16d",
    "debicheck_adjustment_category_lookups_id": "3b712f6b-841a-4ba9-b638-1c8e46943061",
    "debicheck_adjustment_rate": 5.00000,
    "debicheck_adjustment_amount": null,
    "debicheck_is_tracking_enabled": true,
    "debicheck_tracking_period": 5,
    "debicheck_is_allow_date_adjustment": true,
}

R/C/O Required/Conditional/Optional

FieldTypeR/C/O
Description
OptionsExample
companies_idstringC - either people id or companies id must be providedCompany ID linked to the subscriptionUUID"{companies record_id}"
people_idstringC - either people id or companies id must be providedPeople ID linked to the subscriptionUUID"{people record_id}"
date_startdateRStarting date of the subscription"YYYY-MM-DD"2024-09-01
date_enddateOWhen the subscription is to stop running"YYYY-MM-DD"2025-09-01
billing_dayintegerRCalendar day on which subscription is to run1 to 3124
default_payment_methods_idstringRPayment method ID associated with this subscriptionUUID"{payment_methods record_id}"
bank_accounts_idstringC - required with bank related payment methodsID of bank accounts record to be usedUUID"{bank_accounts record_id}"
cards_idstringC - required with card related payment methodsID of cards record to be usedUUID"{cards record_id}"
status_lookups_idstringRCurrent status lookups ID of the subscriptionUUID, lookups type 'Status' and category 'Subscriptions'"735702fe-623b-49ea-89ff-90faf5dc4a22"
memostringOMemo to be attached to the subscriptionmax 2048 characters"some memo about the subscription"
is_generate_document_on_failurebooleanOGenerate unpaid finance documents if a transaction is logged as unpaidture, falsetrue
document_type_lookups_idstringOType of document to generate upon paymentDefaults to none, only 'invoices' are allowed for automatic payment methods, manual payment methods allow both 'invoices' and 'sales orders'"02347884-d1c9-4726-a30a-0d30e6564ece"
is_send_finance_documentsbooleanOtrue - send out the finance document, false - only gnerate the finance documenttrue, falsetrue
document_email_template_lookups_idstringC - either email or sms template ID must be provided if send finance documents is trueEmail message template ID to be used upon paymentUUID"{messages_templates record_id}"
document_paid_email_template_lookups_idstringOEmail message template ID to be used when the payment reflects as 'paid'UUID"{messages_templates record_id}"
document_sms_template_lookups_idstringC - either email or sms template ID must be provided if send finance documents is trueSMS message template ID to be used upon paymentUUID"{messages_templates record_id}"
document_paid_sms_template_lookups_idstringOSMS message template ID to be used when the payment reflects as 'paid'UUID"{messages_templates record_id}"
debicheck_client_referencestringC - Required if DebiCheck payment providerDebicheck client reference numberMay only contain letters and numbers"CL000001"
debicheck_contract_referencestringC - Required if DebiCheck payment providerDebicheck contract reference numberMust be unique per submission and contain only letters and numbers, with a maximum of 14 characters""CT000001""
debicheck_debtor_full_namestringC - Required if DebiCheck payment providerName of the Debtor as indicated at the bank"J DOE"
debicheck_debtor_ultimate_namestringOUltimate name of the debtor (if applicable)"Doe Associates"
debicheck_maximum_collection_amountdecimalC - Required if DebiCheck payment providerMaximum collection amount (per instalment) allowed for the mandate in ZAR.This value may not exceed 1.5 times the instalment amount.150.25
debicheck_authentication_instrument_lookups_idstringC - Required if DebiCheck payment providerHost to Host: takes up to 2 hours to send out but has maximum approval window. Realtime: sent out immediately, 3 minute acceptance window. Authentication will be sent to bank registered cell number. Realtime Delayed: sent out immediately, approval window until 20:30. Realtime Exact: sent out immediately, 3 minute acceptance window. Rejected if debtor cell number does not match the bank registered cell number.UUID"e278a5ba-25e6-40ce-a06d-a1c80c28fbc0"
debicheck_debit_value_type_lookups_idstringC - Required if DebiCheck payment providerFixed: collection amount may not change. Variable: collection amount may increase.UUID"b2d59897-cd97-4a35-b38e-b6072f94f16d"
debicheck_adjustment_category_lookups_idstringC - Required if debit value type is not fixedThe interval/category at which adjustments are performedUUID - If the Adjustment category is set, either an adjustment rate or amount must be specified. Both may not be specified at the same time"3b712f6b-841a-4ba9-b638-1c8e46943061"
debicheck_adjustment_ratedecimalC - Required if adjustment category is usedInstallment % increase per adjustment intervalUp to 5 decimal places is allowed5.00000
debicheck_adjustment_amountdecimalC - Required if adjustment category is usedInstalment amount increase in ZAR value per adjustment intervalAmount in ZAR15.45
debicheck_is_tracking_enabledbooleanOIf debtor has given authority to track the account in the event of a collection failuretrue/falsetrue
debicheck_tracking_period"integerC - Required if tracking is enabledBank can monitor the account for up to 10 days and as soon as money comes in the collection can be re-submitted. Transaction becomes disputable if successfully collected on another day due to tracking.1 to 105
debicheck_is_allow_date_adjustmentbooleanOSet to true to allow all transactions to be processed irrespective of the collection datetrue/falsetrue

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        ...
    }
}

Error Response:

{
    "status": false,
    "error": "Please complete the fields below",
    "errors": {
        "billing_day": {
            "message": "billing day is required",
            "rule": "required"
        }
    }
}

Delete

Path
DELETE /finance/subscriptions/delete/{record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the subscription returned upon createUUID"{subscriptions record_id}"

Success Response:

{
    "status": true,
    "message": "Record has been removed"
}

Error Response:

{
    "status": false,
    "error": "Record ID could not be found"
}

Subscriptions Products

These API calls allow for manipulating subscription product details. All lookup values can be found under: Lookups API

Create

Path
POST /finance/subscriptions/products/create

JSON Body:

{
    "people_id": "{paying for people record_id|null}",
    "subscriptions_id": "{subscriptions record_id}",
    "products_id": "{products record_id}",
    "amount": "100.25",
    "quantity": 1,
    "agents_id": "{agents records_id}",
    "projects_id": "{projects records_id}",
    "branches_id": "{branches records_id}",
    "is_active": true,
    "once_off_start": "{Once off product start date YYYY-MM-DD}"
}

R/C/O Required/Conditional/Optional

FieldTypeR/C/O
Description
OptionsExample
people_idstringOPerson being paid for on behalf of someone else. Leave null if paying for selfUUID"{people record_id}"
subscriptions_idstringRSubscription ID to link this subscription product toUUID"{subscriptions record_id}"
products_idstringRProduct ID being paid forUUID"{products record_id}"
amountdecimalRAmount being paid, in base currency e.g. 100.25 ZARgreater than 0"100.25"
quantityintegerRAmount of products being paid for, amount will be multiplied by the quantity for the total amount to be paid on the subscriptionGreater than 01
agents_idstringOAgent ID related to the saleUUID"{agents records_id}"
projects_idstringOProject ID related to the saleUUID"{projects records_id}"
branches_idstringOBranches ID related to the saleUUID"{branches records_id}
is_activebooleanOIf this subscription product is considered to be activedefaults to falsetrue
once_off_startdateC - required if the products ID belongs to a once off productWhen the once off product is to be billed"YYYY-MM-DD""2024-09-01"

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        ...
    }
}

Error Response:

{
    "status": false,
    "error": "Please complete the fields below",
    "errors": {
        "subscriptions_id": {
            "message": "subscriptions id is required",
            "rule": "required"
        }
    }
}

View

Path
GET /finance/subscriptions/products/{record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the subscription product returned upon createUUID"{subscriptions_products record_id}"

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        "people_id": "{paying for people record_id|null}",
        "subscriptions_id": "{subscriptions record_id}",
        "products_id": "{products record_id}",
        "amount": "100.25",
        "quantity": 1,
        "agents_id": "{agents records_id}",
        "projects_id": "{projects records_id}",
        "branches_id": "{branches records_id}",
        "is_active": true,
        "once_off_start": "{Once off product start date YYYY-MM-DD}"
    }
}
FieldType
Description
OptionsExample
people_idstringPerson being paid for on behalf of someone else. Leave null if paying for selfUUID"{people record_id}"
subscriptions_idstringSubscription ID to link this subscription product toUUID"{subscriptions record_id}"
products_idstringProduct ID being paid forUUID"{products record_id}"
amountdecimalAmount being paid, in base currency e.g. 100.25 ZARgreater than 0"100.25"
quantityintegerAmount of products being paid for, amount will be multiplied by the quantity for the total amount to be paid on the subscriptionGreater than 01
agents_idstringAgent ID related to the saleUUID"{agents records_id}"
projects_idstringProject ID related to the saleUUID"{projects records_id}"
branches_idstringBranches ID related to the saleUUID"{branches records_id}
is_activebooleanIf this subscription product is considered to be activedefaults to falsetrue
once_off_startdateWhen the once off product is to be billed"YYYY-MM-DD""2024-09-01"

Error Response:

{
    "status": false,
    "error": "Record ID could not be found"
}

Edit

Path
POST /finance/subscriptions/products/edit/{record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the subscription product returned upon createUUID"{subscriptions_products record_id}"

JSON Body:

{
    "people_id": "{paying for people record_id|null}",
    "subscriptions_id": "{subscriptions record_id}",
    "products_id": "{products record_id}",
    "amount": "100.25",
    "quantity": 1,
    "agents_id": "{agents records_id}",
    "projects_id": "{projects records_id}",
    "branches_id": "{branches records_id}",
    "is_active": true,
    "once_off_start": "{Once off product start date YYYY-MM-DD}"
}

R/C/O Required/Conditional/Optional

FieldTypeR/C/O
Description
OptionsExample
people_idstringOPerson being paid for on behalf of someone else. Leave null if paying for selfUUID"{people record_id}"
subscriptions_idstringRSubscription ID to link this subscription product toUUID"{subscriptions record_id}"
products_idstringRProduct ID being paid forUUID"{products record_id}"
amountdecimalRAmount being paid, in base currency e.g. 100.25 ZARgreater than 0"100.25"
quantityintegerRAmount of products being paid for, amount will be multiplied by the quantity for the total amount to be paid on the subscriptionGreater than 01
agents_idstringOAgent ID related to the saleUUID"{agents records_id}"
projects_idstringOProject ID related to the saleUUID"{projects records_id}"
branches_idstringOBranches ID related to the saleUUID"{branches records_id}
is_activebooleanOIf this subscription product is considered to be activedefaults to falsetrue
once_off_startdateC - required if the products ID belongs to a once off productWhen the once off product is to be billed"YYYY-MM-DD""2024-09-01"

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        ...
    }
}

Error Response:

{
    "status": false,
    "error": "Please complete the fields below",
    "errors": {
        "subscriptions_id": {
            "message": "subscriptions id is required",
            "rule": "required"
        }
    }
}

Delete

Path
DELETE /finance/subscriptions/products/delete/{record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the subscription product returned upon createUUID"{subscriptions_products record_id}"

Success Response:

{
    "status": true,
    "message": "Record has been removed"
}

Error Response:

{
    "status": false,
    "error": "Record ID could not be found"
}

Batches

These API calls allow for manipulating batches details. All lookup values can be found under: Lookups API

Create

Path
POST /finance/batches/create

JSON Body:

{
    "accounts_reference": "TST230824",
    "date_start": "YYYY-MM-DD",
    "date_end": "YYYY-MM-DD",
    "payment_methods_id": "{payment_methods record_id}"
}

R/C/O Required/Conditional/Optional

FieldTypeR/C/O
Description
OptionsExample
accounts_referenceStringRReference to be used on statementsMax 8 characters"TST230824"
date_startdateRStarting date of the batch"YYYY-MM-DD", must be 1 day after the last batch end date"2024-09-01"
date_enddateREnd date of the batch"YYYY-MM-DD", must be within the same month of the starting date"2024-09-15"
payment_methods_idstringRPayment method to be used for generating this batchUUID"{payment_methods record_id}"

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        ...
    }
}

Error Response:

{
    "status": false,
    "error": "Please complete the fields below",
    "errors": {
        "date_start": {
            "message": "date start is required",
            "rule": "required"
        }
    }
}

View

Path
GET /finance/batches/{record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the batch returned upon createUUID"{batches record_id}"

Success Response:

{
    "status": true,
    "record": {
        "id": "{unique record_id}",
        "accounts_reference": "TST230824",
        "date_start": "YYYY-MM-DD",
        "date_end": "YYYY-MM-DD",
        "payment_methods_id": "{payment_methods record_id}",
        "status_lookups_id": "b024d7ae-b3cf-4edc-ad35-6bc455b1937a"
    }
}
FieldType
Description
OptionsExample
accounts_referenceStringReference to be used on statementsMax 8 characters"TST230824"
date_startdateStarting date of the batch"YYYY-MM-DD", must be 1 day after the last batch end date"2024-09-01"
date_enddateEnd date of the batch"YYYY-MM-DD", must be within the same month of the starting date"2024-09-15"
payment_methods_idstringPayment method to be used for generating this batchUUID"{payment_methods record_id}"
status_lookups_idstringStatus lookups ID for the batchUUID"b024d7ae-b3cf-4edc-ad35-6bc455b1937a"

Error Response:

{
    "status": false,
    "error": "Record ID could not be found"
}

Delete

Path
DELETE /finance/batches/delete/{record_id}

Query Parameter:

FieldType
Description
OptionsExample
record_idStringUnique ID of the batch returned upon createUUID"{batches record_id}"

Success Response:

{
    "status": true,
    "message": "Record scheduled for removal"
}

Error Response:

{
    "status": false,
    "error": "Only created, verified, verification failed or rejected batches may be deleted"
}

Copyright © 2024 SwitchTransact