Retrieve a Purchase Order
1 min
GET
https://developer.digitail.io/api/v1/purchase-orders/{id}
Responses
200
- object
- dataobject
- idintegerExample
- clinic_idintegerExample
- supplier_idintegerExample
- supplierobject
- idintegerExample
- cifstringExample
- register_nostringExample
- namestringExample
- addressstringExample
- subsidiary_addressstringExample
- administratorstringExample
- is_vat_payerbooleanExample
- bank_namestringExample
- bank_accountstringExample
- bank_addressstringExample
- bank_swiftstringExample
- external_sourcestring
- external_idstring
- statusstring<draft | pending | backorder | completed>ExampleAlloweddraftpendingbackordercompleted
- purchase_order_numberintegerExampleDescription
- datestring<date-time>ExampleFormatdate-time
- reception_committeestring[]Example
[ "Jane", "John" ]
- order_typestring<original | backorder>Allowedoriginalbackorder
- document_typestring< | 1 | 2 | 3 | 4 | 5 | 6>ExampleDescriptionAllowed123456
- document_datestring<date-time>ExampleFormatdate-time
- document_numberstringExample
- document_seriesstringExample
- document_due_datestring<date-time>ExampleFormatdate-time
- global_discountnumberExample
- updated_atstring<date-time>ExampleFormatdate-time
- cogs_subtotalnumberExampleDescription
- cogs_taxnumberExampleDescription
- cogs_totalnumberExampleDescription
- selling_price_subtotalnumberExampleDescription
- selling_price_taxnumberExampleDescription
- selling_price_totalnumberExampleDescription
- goods_subtotalnumberExampleDescription
- consumables_subtotalnumberExampleDescription
- itemsobject[]
- idintegerExample
- product_idintegerExample
- productobjectDescription
- namestringExample
- fixed_feenumber<float>Formatfloat
- unitstringExample
- last_cogsobjectDescription
- unitnumber<float>ExampleFormatfloat
- subunitnumber<float>ExampleFormatfloat
- last_pricestringExampleDescription
- last_price_includes_taxboolean
- pricenumber<float>ExampleDescriptionFormatfloat
- price_includes_taxbooleanExample
- is_newly_auto_createdbooleanExample
- is_disabledboolean
- is_deletedboolean
- external_sourcestringExampleDescription
- batchstringExample
- expiration_datestring<date-time>ExampleFormatdate-time
- quantitynumber<float>ExampleFormatfloat
- cogsstringExampleDescription
- cogs_discount_valuenumber<float>Formatfloat
- cogs_discount_is_fixedbooleanDescription
- supplier_taxnumber<float>ExampleFormatfloat
- pricestringExampleDescription
- selling_taxnumber<float>ExampleFormatfloat
- markupnumber<float>ExampleDescriptionFormatfloat
- consumedbooleanDescription
- unit_cogs_post_discount_netnumber<float>ExampleFormatfloat
- cogs_post_discount_grossnumber<float>ExampleFormatfloat
- unit_cogs_post_supplier_discount_netnumber<float>ExampleDescriptionFormatfloat
- cogs_post_supplier_discount_grossnumber<float>ExampleDescriptionFormatfloat
- consumableboolean
- sub_unit_cogsnumber<float>ExampleDescriptionFormatfloat
- is_receivedbooleanExampleDescription
- override_sale_priceboolean
- cogs_prefilled_from_vetcovebooleanDescription
- unreceived_disabled_itemsitems[]
- related_orderobjectDescription
- items_countnumberExampleDescription
- has_consumed_itemsbooleanExampleDescription
curl
curl --request GET \
--url https://developer.digitail.io/api/v1/purchase-orders/{id} \
--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("https://developer.digitail.io/api/v1/purchase-orders/{id}", 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/purchase-orders/{id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.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/purchase-orders/{id}"
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,
"supplier_id": 1,
"supplier": {
"id": 1,
"cif": "RO123456",
"register_no": "J22/12345/2025",
"name": "Supplier A",
"address": "123 Main Street, Anytown, USA, 12345",
"subsidiary_address": "123 Supply Chain Way, Logistics City, CA 90210",
"administrator": "John Doe",
"is_vat_payer": true,
"bank_name": "ING BANK",
"bank_account": "RO66BACX0000001234567890",
"bank_address": "123 Main Street, Anytown, USA, 12345",
"bank_swift": "INGBROBUXXX",
"external_source": "",
"external_id": ""
},
"status": "completed",
"purchase_order_number": 1,
"date": "2021-08-01T00:00:00.000Z",
"reception_committee": [
""
],
"order_type": "",
"document_type": 1,
"document_date": "2021-08-01T00:00:00.000Z",
"document_number": "123",
"document_series": "DGT",
"document_due_date": "2021-08-01T00:00:00.000Z",
"global_discount": 10,
"updated_at": "2021-08-01T00:00:00.000Z",
"cogs_subtotal": 10,
"cogs_tax": 1,
"cogs_total": 11,
"selling_price_subtotal": 10,
"selling_price_tax": 1,
"selling_price_total": 11,
"goods_subtotal": 7,
"consumables_subtotal": 3,
"items": [
{
"id": 1,
"product_id": 1,
"product": {
"name": "Product Name",
"fixed_fee": "",
"unit": "Box",
"last_cogs": {
"unit": 10,
"subunit": 2.5
},
"last_price": "10.00",
"last_price_includes_tax": false,
"price": 25,
"price_includes_tax": true,
"is_newly_auto_created": true,
"is_disabled": false,
"is_deleted": false,
"external_source": "external"
},
"batch": "123",
"expiration_date": "2027-01-01T00:00:00.000000Z",
"quantity": 1,
"cogs": "658.73",
"cogs_discount_value": "",
"cogs_discount_is_fixed": false,
"supplier_tax": 1,
"price": "295.20",
"selling_tax": 1,
"markup": 50.473,
"consumed": false,
"unit_cogs_post_discount_net": 10,
"cogs_post_discount_gross": 10,
"unit_cogs_post_supplier_discount_net": 10,
"cogs_post_supplier_discount_gross": 10,
"consumable": false,
"sub_unit_cogs": 329.36,
"is_received": true,
"override_sale_price": false,
"cogs_prefilled_from_vetcove": false
}
],
"unreceived_disabled_items": [
""
],
"related_order": {},
"items_count": 3,
"has_consumed_items": true
}
}