Get a list of Sales
1 min
GET
/api/v1/sales
Query Parameters
- filter[id]integerDescription
- filter[customer_id]integerExampleDescription
- filter[pet_id]integerDescription
- filter[status]stringDescription
- filter[include_consolidated]booleanDescription
- includestringDescription
- filter[has_monetization]booleanDescription
- filter[created_at]string[]Description
- filter[updated_at]string[]Description
Responses
200
- object
- dataSale[]
- idintegerExample
- clinic_idstringExample
- customer_idstringExample
- customerSaleCustomer
- idintegerExample
- namestringExample
- last_namestringExample
- emailstringExample
- phonestringExampleDescription
- addressstringExample
- citystringExample
- streetstringExample
- street_numberstringExample
- countryCountry
- idintegerExample
- namestringExample
- iso_codestringExample
- codestringExample
- zipstringExample
- regionstringExample
- timezonestringExample
- has_appbooleanExample
- chatUidstringExample
- fileRecord
- idintegerExample
- numberstringExample
- statusintegerExampleDescription
- vet_idintegerExample
- clinic_idintegerExample
- pet_idintegerExample
- sale_idintegerExample
- datestringExample
- reasonstringExample
- template_idinteger
- commentsstring
- recommendationsstring
- rabic_tag_numberstring
- presumptive_diagnosisstring
- diagnosisstring
- treatmentstring
- counter_saleintegerDescription
- amount_paidstringExample
- amount_duestringExample
- edit_state_detailsobject
- stateintegerDescription
- labelstringDescription
- can_transit_toobject[]
- labelstringExample
- actionstringExample
- stateintegerExample
- statusintegerDescription
- totalstringExample
- global_discount_netstringExample
- global_discount_taxstringExample
- global_discount_grossstringExample
- consolidatedboolean
- created_atstring<date-time>Example
- updated_atstring<date-time>Example
- linkslinks
- metameta
curl
curl --request GET \
--url /api/v1/sales \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("/api/v1/sales", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("/api/v1/sales")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "/api/v1/sales"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// successful operation
{
"data": [
{
"id": 1,
"clinic_id": "1",
"customer_id": "1",
"customer": {
"id": 1,
"name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone": "+16175551212.",
"address": "Flowers St. 300, Palo Alto, 123456, USA",
"city": "Palo Alto",
"street": "Flowers St.",
"street_number": "300",
"country": {
"id": 6,
"name": "United States",
"iso_code": "us",
"code": "usa"
},
"zip": "123456",
"region": "California",
"timezone": "America/Los_Angeles",
"has_app": true,
"chatUid": "e58ed763-928c-4155-bee9-fdbaaadc15f3"
},
"file": {
"id": 1,
"number": "175",
"status": 1,
"vet_id": 1,
"clinic_id": 1,
"pet_id": 1,
"sale_id": 1,
"date": "2021-11-19",
"reason": "Routine checkup",
"template_id": 0,
"comments": "",
"recommendations": "",
"rabic_tag_number": "",
"presumptive_diagnosis": "",
"diagnosis": "",
"treatment": ""
},
"counter_sale": 0,
"amount_paid": "0.000",
"amount_due": "250.000",
"edit_state_details": {
"state": 0,
"label": "",
"can_transit_to": [
{
"label": "labels.sale_edit_state.states.open",
"action": "labels.sale_edit_state.actions.open",
"state": 1
}
]
},
"status": 0,
"total": "250.000",
"global_discount_net": "0.000",
"global_discount_tax": "0.000",
"global_discount_gross": "0.000",
"consolidated": false,
"created_at": "2022-07-18T08:58:36.000000Z",
"updated_at": "2022-07-18T08:58:36.000000Z"
}
],
"links": {},
"meta": {}
}