Get a document
curl --request GET \
--url https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.getswipe.in/api/partner/v2/doc/{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/{doc_hash_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Details Fetched",
"error_code": "",
"errors": {},
"data": {
"invoice_details": {
"serial_number": "INV-12",
"document_type": "invoice",
"document_date": "11-06-2024",
"party": {
"id": "CUST123",
"type": "customer",
"name": "John Doe",
"country_code": "91",
"phone_number": "1234567890",
"company_name": "Company Name",
"email": "johndoe@example.com",
"gstin": "27AARCS7202C1ZD",
"shipping_address": {
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456",
"addr_id": -1,
"addr_id_v2": "addr1"
},
"billing_address": {
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456",
"addr_id": -1,
"addr_id_v2": "addr1"
}
},
"due_date": "11-06-2024",
"amount_paid": 28,
"amount_pending": 90,
"reference": "<string>",
"notes": "<string>",
"terms": "<string>",
"items": [
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"discount_amount": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"custom_columns": [
{
"label": "Custom Field 1",
"value": "Value 1"
}
]
}
],
"is_created_by_recurring": 0,
"net_amount": 100,
"hash_id": "<string>",
"payment_status": "paid",
"payments": [
{
"amount": 100,
"method": "upi",
"notes": "Payment notes",
"bank_details": {
"account_number": "1234567890",
"ifsc": "SBIN0000001",
"bank_name": "State Bank of India",
"branch": "Mumbai"
}
}
],
"tax_amount": 18,
"total_amount": 118,
"total_discount": 100,
"record_time": "1764141027"
}
}
}{
"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"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123"
}
}Document V2
Get a document
GET
/
v2
/
doc
/
{doc_hash_id}
Get a document
curl --request GET \
--url https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.getswipe.in/api/partner/v2/doc/{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/{doc_hash_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getswipe.in/api/partner/v2/doc/{doc_hash_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Details Fetched",
"error_code": "",
"errors": {},
"data": {
"invoice_details": {
"serial_number": "INV-12",
"document_type": "invoice",
"document_date": "11-06-2024",
"party": {
"id": "CUST123",
"type": "customer",
"name": "John Doe",
"country_code": "91",
"phone_number": "1234567890",
"company_name": "Company Name",
"email": "johndoe@example.com",
"gstin": "27AARCS7202C1ZD",
"shipping_address": {
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456",
"addr_id": -1,
"addr_id_v2": "addr1"
},
"billing_address": {
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456",
"addr_id": -1,
"addr_id_v2": "addr1"
}
},
"due_date": "11-06-2024",
"amount_paid": 28,
"amount_pending": 90,
"reference": "<string>",
"notes": "<string>",
"terms": "<string>",
"items": [
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118,
"item_type": "Product",
"tax_rate": 18,
"discount_percent": 10,
"discount_amount": 10,
"description": "Item Description",
"hsn_code": "1234",
"unit": "kg",
"category": "Electronics",
"custom_columns": [
{
"label": "Custom Field 1",
"value": "Value 1"
}
]
}
],
"is_created_by_recurring": 0,
"net_amount": 100,
"hash_id": "<string>",
"payment_status": "paid",
"payments": [
{
"amount": 100,
"method": "upi",
"notes": "Payment notes",
"bank_details": {
"account_number": "1234567890",
"ifsc": "SBIN0000001",
"bank_name": "State Bank of India",
"branch": "Mumbai"
}
}
],
"tax_amount": 18,
"total_amount": 118,
"total_discount": 100,
"record_time": "1764141027"
}
}
}{
"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"
}
}{
"success": true,
"message": "Message",
"error_code": "",
"errors": {},
"data": {
"hash_id": "SL123"
}
}Authorizations
Bearer authentication header of the form Bearer , where is your auth token.
Path Parameters
The hash id of the document to be fetched
⌘I

