Account
Create Deposit
Create Deposit Attributes: * required * conditionally required
Parameter | Data Type | Description |
---|---|---|
* transactionDate | string | Date of the deposit |
* accountId | number | Bank account id // The Bank Account Reference Id SELECT * FROM ACCOUNT Where Name = 'Checking |
*lineItems | array | Line Items defined below |
Create Deposit - Line Items Attributes: * required * conditionally required
Parameter | Data Type | Description |
---|---|---|
* amount | number | amount of the linked payment |
* paymentId | number | Payment id // LOOKUP |
* accountRef | number | Account id // LOOKUP |
* description | string | Line item descriptions |
To build out a deposit, query the payments that have been applied to invoices. Example.
Find out how many payments need to get put into the deposit.
SELECT COUNT(*) FROM Payment WHERE Metadata.CreateTime >= '2020-02-04' AND TotalAmt !='0'`
Implement paging in your query and loop through the number you of payments found.
SELECT * FROM Payment WHERE Metadata.CreateTime >= '2020-02-04' AND TotalAmt !='0' STARTPOSITION 1 MAXRESULTS 100
You may need to continue out the paging to get all the payments:
SELECT * FROM Payment WHERE Metadata.CreateTime >= '2020-02-04' AND TotalAmt !='0' STARTPOSITION 101 MAXRESULTS 100
Request
curl -X "POST" "https://snapbooksapi.com/api/v1/deposit" \
-H 'X-Api-Key: xxx' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"transactionDate": "03/04/2019",
"lineItems": [
{
"amount": 10,
"paymentId": 203,
"accountRef": 1,
"description": "Test Deposit"
}
],
"accountId": 36
}'
Response
{
"success": true,
"type": "Operation",
"message": "",
"details": [],
"id": "151"
}