client_payments

The following resources are applicable:

/client_payments

Mount Point: /rest/v2/client_payments

The following operations are supported on this resource:

GET

The client payments REST service end point returns a set of ClientPayments

Parameters

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

Response Body

element: clientPayment
media types: application/xml
application/json

CustomerPayments or Errors

Status Codes

HTTP Status Code Description
200 OK ClientPayments found
400 Bad Request Invalid input, returns message body of Errors
500 Internal Server Error A database error has occurred

POST

The add client payment 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 payment within Crunch.

Request Body

element: clientPayment
media types: application/xml
application/json
application/*+xml

A single client payment to add

Response Body

element: clientPayment
media types: application/xml
application/json

CustomerPayment (with only the newly created CustomerPayment ID set) or Errors

Status Codes

HTTP Status Code Description
201 Created CustomerPayment added
400 Bad Request Invalid input, returns message body of Errors
500 Internal Server Error A database error has occurred

OPTIONS

Options call to handle CORS requests (typically coming from javascript frameworks like jQuery) See here for further information.

Response Body

element: (custom)
media types: */*
application/xml

(no documentation provided)

/client_payments/{clientPaymentId}

Mount Point: /rest/v2/client_payments/{clientPaymentId}

GET

The client payments REST service end point returns a specific client payment based on the ID specified

Parameters

name description type default
clientPaymentId Id of client payment required path

Response Body

element: clientPayment
media types: application/xml
application/json

CustomerPayment or Errors

Status Codes

HTTP Status Code Description
200 OK ClientPayment found
400 Bad Request Invalid input, returns message body of Errors
500 Internal Server Error A database error has occurred

PUT

The update client payment 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 payment within Crunch.

Parameters

name description type default
clientPaymentId The client payment id to update path

Request Body

element: clientPayment
media types: application/xml
application/json
application/*+xml

A single client payment to update

Response Body

element: clientPayment
media types: application/xml
application/json

ClientPayment (with only the updated CustomerPayment ID set) or Errors

Status Codes

HTTP Status Code Description
200 OK ClientPayment updated
400 Bad Request Invalid input, returns message body of Errors
500 Internal Server Error A database error has occurred