Get document PDF
curl --request GET \
--url https://app.getswipe.in/api/partner/v2/doc/pdf/{doc_hash_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.getswipe.in/api/partner/v2/doc/pdf/{doc_hash_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.getswipe.in/api/partner/v2/doc/pdf/{doc_hash_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123"
}
}Documents
Get document PDF
Returns the rendered PDF file for a document. The PDF uses the invoice templates and document settings configured on your Swipe account. Pass delivery_challan=1 to get a delivery-challan copy instead.
GET
/
v2
/
doc
/
pdf
/
{doc_hash_id}
Get document PDF
curl --request GET \
--url https://app.getswipe.in/api/partner/v2/doc/pdf/{doc_hash_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.getswipe.in/api/partner/v2/doc/pdf/{doc_hash_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.getswipe.in/api/partner/v2/doc/pdf/{doc_hash_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is an API key from the API Integration section of your dashboard. Keys are scoped to the company they are generated in — for testing, add a separate test company and generate the key there, so requests never touch your real books.
Path Parameters
The hash id of the document to be fetched
Query Parameters
Set to 1 if you want to get a delivery challan copy of the document
Response
File will be downloaded

