InvoicePackage
Categories:
The InvoicePackage Object
ViewAdd a Package to an Invoice
Note
Currently, only pre-defined packages can be added via the API. This means the package must exist in the Package table in System Maintenance.POST /invoicing/invoice/package/add
This endpoint adds a package to an existing invoice. Packages can’t be added to EPASS without an existing invoice to add them to.
Invoice Conditions
The following Invoice conditions must be satisfied to add an InvoicePackage record.
Condition | Value |
---|---|
Invoice Status | Invoice Status must be Open or Committed . |
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 package to an invoice.
Field | Type | Description |
---|---|---|
InvoiceCode |
string | Must be a valid Invoice Code. |
Qty |
integer | If not provide, default to 1. |
PackageCode |
string | Must be a valid Package Code. |
UserCreated |
string | Must be a valid User Code that is not Obsolete. If not provided it will use the Login User. |
PackageCode
If a valid PackageCode is provided then the following values will be defaulted from the Package. You can override any of the values that would come from the simply by providing your own value.
Key | Value |
---|---|
PackageDes |
Package -> Description |
Tax1Included |
Package -> Tax1Included |
Tax2Included |
Package -> Tax2Included |
Tax3Included |
Package -> Tax3Included |
Tax1 |
Package -> Tax1 |
Tax2 |
Package -> Tax2 |
Tax3 |
Package -> Tax3 |
Potentially Required Fields
These fields may be required depending on your EPASS configuration, or there is unique behavior that needs to be mentioned.
Fields | Type | Description |
---|---|---|
Amount |
integer | Must be greater than zero. If the Package has a valid sale price, then the Selling Price cannot be less than the sale price. |
Sample: Adding a Package to an Invoice
POST /invoicing/invoice/package/add
{
"tripNo": 1,
"qty": 2,
"amount": 75,
"invoiceCode":"5689",
"packageCode": "KITCHENSPECIAL",
"packageDesc": "KITCHENSPECIAL",
"status": "Open",
"tax1": null,
"tax1Included": null,
"tax2": null,
"tax2Included": null,
"tax3": null,
"tax3Included": null,
"userCreated": "CAPI",
"userModified": null,
"locationcode": "RYAN"
}
{
"success": true,
"warning": false,
"httpStatusCode": 201,
"generalMessage": null,
"exceptionMessage": null,
"keys": [
{
"table": "InvoicePackage",
"keys": [
{
"key": "ID",
"fields": [
{
"fieldName": "ID",
"fieldValue": 12345
}
]
}
]
},
{
"table": "InvoiceAddress",
"keys": [
{
"key": "ID",
"fields": [
{
"fieldName": "ID",
"fieldValue": 456789
}
]
}
]
},
{
"table": "InvoiceAudit",
"keys": [
{
"key": "ID",
"fields": [
{
"fieldName": "ID",
"fieldValue": 78964
}
]
}
]
},
{
"table": "InvoiceModel",
"keys": [
{
"key": "ID",
"fields": [
{
"fieldName": "ID",
"fieldValue": 123456
}
]
}
]
},
{
"table": "InvoiceAddress",
"keys": [
{
"key": "ID",
"fields": [
{
"fieldName": "ID",
"fieldValue": 55545
}
]
}
]
},
{
"table": "InvoiceAudit",
"keys": [
{
"key": "ID",
"fields": [
{
"fieldName": "ID",
"fieldValue": 987456
}
]
}
]
},
{
"table": "InvoiceModel",
"keys": [
{
"key": "ID",
"fields": [
{
"fieldName": "ID",
"fieldValue": 123456
}
]
}
]
},
{
"table": "InvoiceAddress",
"keys": [
{
"key": "ID",
"fields": [
{
"fieldName": "ID",
"fieldValue": 456789
}
]
}
]
},
{
"table": "InvoiceAudit",
"keys": [
{
"key": "ID",
"fields": [
{
"fieldName": "ID",
"fieldValue": 123456
}
]
}
]
}
],
"messages": [],
"warnings": []
}
{
"success": false,
"warning": false,
"httpStatusCode": 422,
"generalMessage": "One or more of the fields has an invalid or missing value.",
"exceptionMessage": null,
"keys": [],
"messages": [
{
"code": "INV-010008",
"message": "Packages are not allowed on Finished Invoices."
}
],
"warnings": []
}
Feedback
Was this page helpful?
Thank you! Have additional feedback? We would love to hear from you!
Sorry to hear that. Please tell us how we can improve.