public class AcumulusClient extends Object
| Constructor and Description |
|---|
AcumulusClient(Contract contract)
Constructor for the Acumulus API client, initialized with your API credentials.
|
| Modifier and Type | Method and Description |
|---|---|
AddExpenseResponse |
addExpense(Supplier supplier)
Adds a Supplier if no supplier was found using the provided supplierId or suppliers email address and adds an
invoice for this supplier.
|
InvoiceResponse |
addInvoice(Customer customer)
Adds a Customer if no customer was found using the provided customerId or customer's email address and adds an
invoice for this customer.
|
ListContactsResponse |
listContacts()
Overloaded listContacts method that will return the first 100 contacts.
|
ListContactsResponse |
listContacts(Integer count,
Integer offset,
String filter,
ContactStatus status,
ContactType contactType)
Full featured listContacts method that allows you to search for or paginate through the contacts using the API.
|
ListInvoicesResponse |
listIncomingInvoices(String contactId)
Lists the incoming invoices for the specified contactId.
|
ListInvoicesResponse |
listOutgoingInvoices(String contactId)
Lists the outgoing invoices for the specified contactId.
|
protected String |
serializeRequest(AcumulusRequest xmlRequest)
Serializes the provided request to XML.
|
void |
setApiUrl(String apiUrl)
Changes the API url prefix to use for all API calls
|
void |
setTestMode(boolean testMode)
Set the client to test mode, ensuring no actions will result in actual updates of the data.
|
public AcumulusClient(Contract contract)
contract - credentials to use when contacting the Acumulus APIpublic InvoiceResponse addInvoice(Customer customer)
throws JAXBException,
IOException
customer - customer with embedded invoice to add to the systemJAXBException - if the serialization failed for some reasonIOException - if there was an error contacting the Acumulus serverspublic AddExpenseResponse addExpense(Supplier supplier)
throws JAXBException,
IOException
supplier - supplier with embedded expense to add to the systemJAXBException - if the serialization failed for some reasonIOException - if there was an error contacting the Acumulus serverspublic ListInvoicesResponse listIncomingInvoices(String contactId) throws JAXBException, IOException
contactId - contact to list the invoices forJAXBException - if the serialization failed for some reasonIOException - if there was an error contacting the Acumulus serverspublic ListInvoicesResponse listOutgoingInvoices(String contactId) throws JAXBException, IOException
contactId - contact to list the invoices forJAXBException - if the serialization failed for some reasonIOException - if there was an error contacting the Acumulus serverspublic ListContactsResponse listContacts()
throws JAXBException,
IOException
JAXBException - if the serialization failed for some reasonIOException - if there was an error contacting the Acumulus serverspublic ListContactsResponse listContacts(Integer count, Integer offset, String filter, ContactStatus status, ContactType contactType) throws JAXBException, IOException
count - number of contacts to return, 0 for alloffset - number of contacts to skip from the beginning of the listfilter - optional string to search through contact names, addresses and postal codesstatus - contact status to returncontactType - type of contact to return, null for allJAXBException - if the serialization failed for some reasonIOException - if there was an error contacting the Acumulus serversprotected String serializeRequest(AcumulusRequest xmlRequest) throws JAXBException
xmlRequest - object to serializeJAXBException - if the serialization failed for any reasonpublic void setTestMode(boolean testMode)
testMode - set to true to enable test mode, false to disablepublic void setApiUrl(String apiUrl)
apiUrl - new url to set, including https:// and trailing slash.Copyright © 2017. All rights reserved.