Create a new Credit Note
1 min
POST
https://developer.digitail.io/api/v1/credit-notes
Body Parameters
- bodycreditnoterequired
- clinic_idintegerrequiredExample
- sale_idintegerExample
- customer_idintegerrequiredExample
- amountnumber<float>requiredExampleFormatfloat
- reasonstringrequiredExample
- datestring<date-time>requiredExampleDescriptionFormatdate-time
- descriptionstringExampleDescription
Responses
201
- object
- dataobject
- idintegerExample
- clinic_idintegerExample
- vet_idintegerExample
- sale_idintegerExample
- customer_idintegerExample
- statusstringExample
- typestringExample
- seriesstringExample
- numberstringExample
- tax_amountstringExample
- subtotalstringExample
- totalstringExample
- descriptionstringExample
- made_atstring<date-time>ExampleFormatdate-time
- voided_atstring<date-time>ExampleFormatdate-time
- created_atstringExample
- updated_atstringExample
curl
curl --request POST \
--url https://developer.digitail.io/api/v1/credit-notes \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"clinic_id": 1,
"customer_id": 1,
"amount": 100,
"reason": "Reason for CreditNote",
"date": "2021-01-30T08:30:00Z"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"clinic_id": 1,
"customer_id": 1,
"amount": 100,
"reason": "Reason for CreditNote",
"date": "2021-01-30T08:30:00Z"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://developer.digitail.io/api/v1/credit-notes", 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/credit-notes")
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"
request.body = JSON.dump({
"clinic_id": 1,
"customer_id": 1,
"amount": 100,
"reason": "Reason for CreditNote",
"date": "2021-01-30T08:30:00Z"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://developer.digitail.io/api/v1/credit-notes"
payload = json.dumps({
"clinic_id": 1,
"customer_id": 1,
"amount": 100,
"reason": "Reason for CreditNote",
"date": "2021-01-30T08:30:00Z"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// Successful operation
{
"data": {
"id": 1,
"clinic_id": 1,
"vet_id": 1,
"sale_id": 1,
"customer_id": 1,
"status": "opened",
"type": "product_return",
"series": "DGT",
"number": "1",
"tax_amount": "250.00",
"subtotal": "250.00",
"total": "250.00",
"description": "Short description",
"made_at": "2021-01-30T08:30:00Z",
"voided_at": "2021-01-30T08:30:00Z",
"created_at": "2022-07-18T08:58:36.000000Z",
"updated_at": "2022-07-18T08:58:36.000000Z"
}
}