The following resources are applicable:
Mount Point: /rest/v2/clients
The following operations are supported on this resource:
The clients REST service end point returns a set of clients
name | description | type | default |
---|---|---|---|
firstResult | Optional, defaults to 0, Used for pagination, the firstResult query parameter specifies the first record to be returned by the ‘List All Sales Invoices’ end point. The parameter is 0 index-based, and so if requesting the first sales invoice in the list of sales invoices, firstResult should be set to 0. The firstResult parameter is optional, and the default value for firstResult is 0. If specified, firstResult should be set to any non-negative integer. | query | 0 |
resultsPerPage | Optional, defaults to 0, Used for pagination, the resultsPerPage query parameter specifies the maximum number of results returned by the ‘List All Sales Invoices’ service. The resultsPerPage parameter is relative to the firstResult parameter - therefore if firstResult is set to 0 and resultsPerPage is set to 10, then only the first 10 sales invoices from the overall list of sales invoices will be returned. If firstResult is set to 10 and resultsPerPage is set to 10, then the service will return the next 10 records (i.e the sales invoices at positions 10 to 19 in the complete list of sales invoices). The resultsPerPage parameter is optional. If no value is provided the service will return the entire result set - i.e. all sales invoices in the account. Valid values for resultsPerPage are any positive integer value, so any integer greater than or equal to 1. | query |
element: | media types: |
---|---|
clients | application/xml, application/json |
Clients or Errors
HTTP Status Code | Description |
---|---|
200 OK | Clients found |
400 Bad Request | Invalid input, returns message body of Errors |
500 Internal Server Error | A database error has occurred |
The add client service allows a body of XML to be POSTed to the server. The service will validate the data contained within the XML payload and create a client within Crunch.
element: | media types: |
---|---|
client | application/xml, application/json |
A single client to add
element: | media types: |
---|---|
client | application/xml, application/json |
Client (with only the newly created clientId set) or Errors
HTTP Status Code | Description |
---|---|
200 OK | Client added |
400 Bad Request | Invalid input, returns message body of Errors |
500 Internal Server Error | A database error has occurred |
Options call to handle CORS requests (typically coming from javascript frameworks like jQuery) See here for further information.
element: | media types: |
---|---|
(custom) | /, application/xml |
(no documentation provided)
Mount Point: /rest/v2/clients/{clientId}
The following operations are supported on this resource:
The clients/{clientId} REST service end point returns a specific client based on the ID specified
name | description | type | default |
---|---|---|---|
clientId | Id of client required | path |
element: | media types: |
---|---|
client | application/xml, application/json |
Client or Errors
HTTP Status Code | Description |
---|---|
200 OK | Client found |
400 Bad Request | Invalid input, returns message body of Errors |
500 Internal Server Error | A database error has occurred |
The update client service allows a body of XML to be PUTted to the server. The service will validate the data contained within the XML payload and update a client within Crunch.
name | description | type | default |
---|---|---|---|
clientId | The client id to update | path |
element: | media types: |
---|---|
client | application/xml, text/xml, application/json |
A single client to update
element: | media types: |
---|---|
client | application/xml, application/json |
Client (with only the updated clientId set) or Errors
HTTP Status Code | Description |
---|---|
200 OK | Client updated |
400 Bad Request | Invalid input, returns message body of Errors |
500 Internal Server Error | A database error has occurred |
The clients/{clientId} DELETE REST service end point deletes a specific client based on the ID specified
name | description | type | default |
---|---|---|---|
clientId | The client id to delete | path |
element: | media types: |
---|---|
client | application/xml, application/json |
empty body or Errors
HTTP Status Code | Description |
---|---|
204 No Content | Client deleted |
400 Bad Request | Invalid input, returns message body of Errors |
500 Internal Server Error | A database error has occurred |