Payments
This service is used to submit batches of payments from external payment systems as well as checking status of extisting batches.
Base URL
https://{{realm}}.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=customscript_prac_api_payments&deploy=customdeploy_prac_api_payments_v1
Required URL Parameters
| Name | Value | Notes |
|---|---|---|
| script | customscript_prac_api_payments | |
| deploy | customdeploy_prac_api_payments_v1 |
HTTP: PUT
Submits a batch of payments that should be recorded and applied in PracticeERP.
Payload
The payload passed in the PUT request should be JSON format.
Properties
| Name | Value | Notes |
|---|---|---|
| source | {{string}} | The name/identifier of the external payment system. |
| sourcebatchid | {{string}} | The unique identifier for the batch used by the external system. |
| payments.sourceref | {{string}} | The identifier/reference number of the payment. |
| payments.client | {{integer}} | The NetSuite internal id of the client making the payment. |
| payments.date | {{date}} | Date of the payment. |
| payments.method | {{string}} | The payment method used for the payment. Must match a payment method configured in NetSuite. |
| payments.invoice | {{integer}} | The NetSuite internal id of the Invoice to which the payment should be applied. (Optional) |
| payments.amount | {{currency}} | The amount of the payment. |
Example Payload:
{
"source": "EZ Payment System",
"sourcebatchid": "17",
"payments": [
{
"sourceref": "qwer4321",
"client": 427,
"date": "2024-10-14",
"method": "ACH",
"invoice": 139664,
"amount": 1500.00
},
{
"sourceref": "asdf1234",
"client": 427,
"date": "2024-10-14",
"method": "CC",
"invoice": 138163,
"amount": 2500.00
}
]
}
Errors
BatchStatus: "Invalid" When submitting the payment data, the system will validate the information. If for some reason, the data fails validation, the batch will be flagged as "Invalid". In NetSuite, the batch will also indicate that it was invalid and the payments will be individually flagged as invalid and contain information about why payment submission was invalid.
The web service reponse will also give you information about the validation error. This example reponse is from a submission where client was not assigned to the invoice (and therefore the invoice was available in the list).
{
"success": false,
"requestId": "T60328257",
"totalCount": 1,
"isPaged": false,
"result": [
{
"batchid": 1401,
"batchname": "QuickFee : OCT28-c",
"batchstatus": "Invalid",
"lineErrors": [
{
"error_name": "INVALID_FLD_VALUE",
"error_message": "You have entered an Invalid Field Value 9503 for the following field: custrecord_prac_api_extpay_invoice",
"payment": {
"sourceref": "HFGJ876",
"client": 4,
"date": "2024-10-23T11:00:00.000Z",
"method": "ACH",
"invoice": 9503,
"amount": 50
}
}
]
}
]
}
HTTP: GET
Get the status of a batch of payments that was submitted for processing.
URL Parameters
| Name | Value | Notes |
|---|---|---|
| custparam_batchid | {{integer}} | The batch id to check. The batch id returned from the PUT call that submitted the batch. |