Link

Response

This method allows users to retrieve the data of a Xero Contact/Invoice/Bill/PurchaseOrder.

ResponseObject - Class

When we call “BreadwinnerAPI.call()” method, User would get the response in the form of BreadwinnerAPI.ResponseObject. It consists of the following variables.

Status:

It is of type String, which represents the Response/Status code of the request returned by Xero.
E.g: ‘200’ - OK (Successful API call)
Click here for more Status codes, and it’s descriptions.

xeroContacts

It is of type List, which contains the created Xero Contact(s) data along with Xero unique record Id.

List<bw_xero_api02.AccountWrapper> xeroContactsList = Response.xeroContacts

xeroInvoices

It is of type List, which contains the created Xero Invoice(s) data along with Xero unique record Id.

List<bw_xero_api02.Invoice> xeroInvoices = Response.XeroInvoices

Errors

It is of type “BreadwinnerAPI.Error” class. All the Errors that are reported by Xero or by Salesforce.

Error class contains the following variables:

  • type: The type of error returned. One of api_connection_error, api_error, authentication_error, idempotency_error, invalid_request_error, rate_limit_error, validation_exception. e.t.c.,
  • message: Represents the Error.
  • code: For some errors that could be handled programmatically, a short string indicating the error code reported.
  • description: Represents the extra info regarding the error or exception.
message=REQUIRED_FIELD_MISSING: name, message=Enter the Xero customer name. param=xeroContact.name