Create a Sale
1 min
POST
https://developer.digitail.io/api/v1/sales
Query Parameters
- new_response
Body Parameters
- bodyobjectrequired
- discountnumber<float>Formatfloat
- discount_percentagenumber<float>Formatfloat
- discount_typestring<fixed | percentage>Allowedfixedpercentage
- discount_reasonobject
- reasonstring
- is_privatestring<public | private>Allowedpublicprivate
- predefined_discountsinteger[]
- sold_productsobject[]
- idinteger
- product_idinteger
- vet_idnumber<float>Formatfloat
- unit_idstring<unit | subunit>Allowedunitsubunit
- unitstring
- quantitynumber<float>Formatfloat
- sale_pricenumber<float>Formatfloat
- sale_price_with_vatnumber<float>Formatfloat
- vatnumber<float>DescriptionFormatfloat
- tax_rate_idsinteger[]Example
[ 57 ]
Description - pricenumber<float>Formatfloat
- sub_pricenumber<float>Formatfloat
- product_namestring
- labelstring
- recommendationsstring
- is_checkout_boughtboolean
- fixed_feenumber<float>Formatfloat
- include_fixed_feeboolean
- discount_reasonobject
- reasonstring
- is_privatestring<public | private>Allowedpublicprivate
- discountnumber<float>Formatfloat
- discount_percentagenumber<float>Formatfloat
- discount_typestring<fixed | percentage>Allowedfixedpercentage
- price_threshold_typestring<minimum | maximum>Allowedminimummaximum
- purchase_order_itemsobject[]
- idinteger
- quantitynumber<float>Formatfloat
- sold_servicesobject[]
- idinteger
- service_package_idinteger
- quantitynumber<float>Formatfloat
- pricenumber<float>Formatfloat
- unit_pricenumber<float>Formatfloat
- vatnumber<float>DescriptionFormatfloat
- tax_rate_idsinteger[]Example
[ 57 ]
Description - vet_idnumber<float>Formatfloat
- namestring
- original_pricenumber<float>Formatfloat
- is_checkout_boughtboolean
- discountnumber<float>Formatfloat
- discount_percentagenumber<float>Formatfloat
- discount_typestring<fixed | percentage>Allowedfixedpercentage
- discount_reasonobject
- reasonstring
- is_privatestring<public | private>Allowedpublicprivate
- aaha_codestring
- productsobject[]
- idinteger
- product_idinteger
- unitsobject[]
- formulanumber<float>Formatfloat
- unit_price_with_vatnumber<float>Formatfloat
- subunit_price_with_vatnumber<float>Formatfloat
- unit_idstring<unit | subunit>Allowedunitsubunit
- quantitynumber<float>Formatfloat
- labelstring
- recommendationsstring
- namestring
- displayedboolean
- purchase_order_itemsobject[]
- idinteger
- quantitynumber<float>Formatfloat
Responses
200
- object
- dataobject
- idintegerExample
- clinic_idstringExample
- customer_idstringExample
- typeintegerExample
- customerdata
- filedata
- counter_saleintegerDescription
- amount_paidstringExample
- amount_duestringExample
- edit_state_detailsedit_state_details
- statusintegerDescriptionAllowed01234
- totalstringExample
- global_discount_netstringExample
- global_discount_taxstringExample
- global_discount_grossstringExample
- consolidatedbooleanDescription
- created_atstring<date-time>ExampleFormatdate-time
- updated_atstring<date-time>ExampleFormatdate-time
curl
curl --request POST \
--url https://developer.digitail.io/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: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://developer.digitail.io/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("https://developer.digitail.io/api/v1/sales")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://developer.digitail.io/api/v1/sales"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
{
"data": {
"id": 1,
"clinic_id": "1",
"customer_id": "1",
"type": 1,
"customer": {},
"file": {},
"counter_sale": 0,
"amount_paid": "0.000",
"amount_due": "250.000",
"edit_state_details": {},
"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"
}
}