InvoicePayment

The InvoicePayment object represents a payment made on an invoice. Examples of payment methods are cash, check, and credit cards.

Add a Payment to an Invoice


POST /invoicing/invoice/payment/add


This endpoint adds a payment to an open invoice.

Invoice Conditions

The following Invoice conditions must be satisfied to add a payment to an invoice.

Condition Value
Invoice Status Invoice Status must be Open or Committed.
Estimate Not allowed.
BranchCode Must be a valid Branch Code.
If not provided it will use the branch supplied during the login process, and if that is empty it uses the constant value DEFAULT.
If a valid PaymentType is provided and the PaymentType option Write All Payments as Branch is True and filled in then the Branch from the Write All Payments as Branch will be used.
TerminalCode Must be a valid Terminal Code. If not provided it will use the terminal supplied during the login process, and if that is empty it uses the constant value DEFAULT.
Invoice JobStatus Any Job Status cascading that is configured in EPASS will be enforced through the API.
Bill To Customer BillToCustomer must be allowed to charge if the invoice is not estimate and the payment type is AR.
Credit Limits will be enforced in the following situation:
- The invoice is not an estimate
- Credit Limit is enabled for the Customer
- The Invoice Payment Type is AR
- Require Credit Approval is disabled
- Either the Job Status is dispatchable or Dispatching is disabled completely

Payload

Required Fields

The following fields are the absolute minimum fields that should be required to add a payment to an invoice.

Fields Type Description
InvoiceCode string Must be a valid Invoice Code.
PaymentTypeCode string Must be a valid Payment Code that is not Obsolete and Payment Type option Show In Invoice Detail is True. Payment Processing Type is None (We only allow non integrated payment type).
UserCreated string Must be a valid User Code that is not Obsolete. If not provided it will use the Login User.

PaymentTypeCode

If a valid PaymentTypeCode is provided then the following values will be defaulted from the Payment. You can override any of the values that would come from the Payment simply by providing your own value.

Key Value
Description Payment -> Description

Potentially Required Fields

These fields may be required depending on your EPASS configuration, or there is unique behavior that needs to be mentioned.

Fields Description
BillTo Info Invoice -> BillTo Info BillTo Info for the payment line are default from Invoice BillTo Info.

Sample: Adding a Payment to an Invoice

POST /invoicing/Invoice/Payment/Add 

{
    "InvoiceCode": "1234567",
    "PaymentTypeCode": "VISA",
    "Description": "Auth # 123456",
    "Amount": 1000,
    "BranchCode": "Default",
    "TerminalCode": "Default"
}
 {
    "success": true,
    "warning": false,
    "httpStatusCode": 201,
    "generalMessage": null,
    "exceptionMessage": null,
    "keys": [
        {
            "table": "InvoicePayment",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 1123456
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceAddress",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 645987
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceAudit",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 987654
                        }
                    ]
                }
            ]
        }
    ],
    "messages": [],
    "warnings": []
}
 {
    "success": false,
    "message": "One or more of the fields has an invalid or missing value.",
    "lastException": null,
    "recordId": 0,
    "code": null,
    "httpStatusCode": 422,
    "messageDetails": [
        "InvoiceCode does not exist."
    ]
}