Customer Returns
Index
Retrieve a list of customer returns by making this request:
GET /api/v1/customer_returns
Customer returns are paginated and can be iterated through by passing along a page
parameter:
GET /api/v1/customer_returns?page=2
Parameters
- page:
The page number of customer return to display.
- per_page:
The number of customer returns to return per page
Response
Status:
200 OK
{"customer_returns": [{"id": 1,"number": "CR972477438","order_id": 1,"fully_reimbursed": false,"pre_tax_total": "100.0","created_at": "2020-05-12T05:52:46.268Z","updated_at": "2020-05-12T05:52:46.268Z"}],"count": 25,"current_page": 1,"pages": 5}
Search
To search for a particular customer return, make a request like this:
GET /api/v1/customer_returns?q[number_cont]=CR972477438
The searching API is provided through the Ransack gem which Boxid depends on. The number_cont
here is called a predicate, and you can learn more about them by reading about Predicates on the Ransack wiki.
The search results are paginated.
Response
Status:
200 OK
{"customer_returns": [{"id": 1,"number": "CR972477438","order_id": 1,"fully_reimbursed": false,"pre_tax_total": "100.0","created_at": "2020-05-12T05:52:46.268Z","updated_at": "2020-05-12T05:52:46.268Z"}],"count": 25,"current_page": 1,"pages": 5}
Sorting results
Results can be returned in a specific order by specifying which field to sort by when making a request.
GET /api/v1/customer_returns?q[s]=updated_at%20desc