API version 2 Payments
1. List Payments (api2/payments)
This method will answer with a collection of iinsight's payments that has been modified/created since a provided date. The collection wil be in JSON format.
The results would be paginated, having a maximum of 100 records per page. An empty collection and a status code 200 response, means that there is no records in the specified page.
| Server | URL | HTTP type |
|---|---|---|
| UAT | https://api-aus-uat.iinsightonline.com/api2/payments | GET |
| PRODUCTION | https://api-aus.iinsightonline.com/api2/payments | GET |
Authorization
| Parameter | Value | Mandatory |
|---|---|---|
| Type | Bearer Token | Yes |
| Token | The token is generated using the /auth/login method | Yes |
Query Params
| Parameter | Value | Mandatory |
|---|---|---|
| modified_since |
Date since last update or insert. Format: YYYY-MM-DDThh:mm:ssZ (date and time in UTC ISO 8601) Example: 2024-02-29T12:28:01Z |
Yes |
| page | The page number of the paginated results. (i.e.: 1) | Yes |
| status | The status of the invoice. (i.e.: active / voided) | Yes |
Response
[
{
"payment_id": "1104",
"payment_number": "NSW2014425-P1",
"transaction_date": "2024-01-17T12:00:00Z", // YYYY-MM-DDThh:mm:ssZ (date and time in UTC ISO 8601)
"amount": "-562.30",
"paid_by": "xxx",
"reference_number": "xxx",
"card_type": "",
"bank": "",
"branch": "",
"invoice_id": "1567",
"invoice_number": "NSW2014425",
"bill_to_id": "5",
"type": "Cash",
"notes": "",
"last_update": "17-01-2024 07:44:58",
"last_update_utc": "2024-01-16T20:44:58Z // YYYY-MM-DDThh:mm:ssZ (date and time in UTC ISO 8601)
},
{
"payment_id": "1105",
"payment_number": "NSW2014454-P1",
"transaction_date": "2024-01-18T12:00:00Z", // YYYY-MM-DDThh:mm:ssZ (date and time in UTC ISO 8601)
"amount": "-158.00",
"paid_by": "xxx",
"reference_number": "xxx",
"card_type": "",
"bank": "",
"branch": "",
"invoice_id": "1686",
"invoice_number": "NSW2014454",
"bill_to_id": "5",
"type": "Cash",
"notes": "",
"last_update": "17-01-2024 07:44:58",
"last_update_utc": "2024-01-16T20:44:58Z // YYYY-MM-DDThh:mm:ssZ (date and time in UTC ISO 8601)
}
]
2. Create a Payment (api2/payments)
This method will allow to create a new payment in iinsight.
URL
| Server | URL | HTTP type |
|---|---|---|
| UAT | https://api-aus-uat.iinsightonline.com/api2/payments/create_payments | POST |
| PRODUCTION | https://api-aus.iinsightonline.com/api2/payments/create_payments | POST |
Authorization
| Parameter | Value | Mandatory |
|---|---|---|
| Type | Bearer Token | Yes |
| Token | The token generated using the /auth/login method | Yes |
Query Params
| Parameter | Value | Mandatory |
|---|---|---|
| invoice_id | Iinsight's internal ID number of the invoice. | Yes |
| transaction_date |
The date of the transaction. Format: YYYY-MM-DDThh:mm:ssZ (date and time in UTC ISO 8601) Example: 2024-02-29T12:28:01Z |
Yes |
| amount | The payment amount. Positive number. | Yes |
| paid_by | Person or company who made the payment | No |
| reference_number | A number to reference the payment. | No |
| card_type | Credit card type (i.e: American Expres / Bankcard / Diners / Mastercard / Visa / None) | Yes |
| branch | The branch of the Bank | No |
| notes | Note for the payment. | No |
| type | The type of payment (i.e.: Cheque /Cash / Credit Card / EFT / Drawdown / BACS) | Yes |
Response
{
"response": "Payment created",
"payment": 1132,
"payment_number": "NSW137-P3"
}