Document
Create a document
Changed onv1 is deprecated — use the v2 endpoint instead. Creates a document — an invoice, purchase, estimate, return, delivery challan, or subscription — based on document_type. Unknown party and items IDs are created automatically from the details you send; existing IDs are reused. Returns the document's hash_id, which addresses the document in every subsequent call, plus the IRN and QR code when einvoice is set. Send your own serial_number to make retries safe — a duplicate fails with DUPLICATE_DOC_SERIAL_NUMBER instead of creating a second document.
post/v1/doc
Request
- Base URLhttps://app.getswipe.in/api/partner
- URLhttps://app.getswipe.in/api/partner/v1/doc
- AuthHTTP bearer
Request body
Example request
{
"serial_number": "INV123",
"document_type": "invoice",
"document_date": "11-06-2024",
"customer": {
"id": "CUST123",
"name": "John Doe",
"country_code": "91",
"phone_number": "1234567890",
"company_name": "Company Name",
"email": "johndoe@example.com",
"gstin": "27AARCS7202C1ZD"
},
"party": {
"id": "CUST123",
"type": "customer",
"name": "John Doe",
"country_code": "91",
"phone_number": "1234567890",
"company_name": "Company Name",
"email": "johndoe@example.com",
"gstin": "27AARCS7202C1ZD"
},
"due_date": "11-06-2024",
"reference": "Reference Text",
"notes": "Notes for the document",
"terms": "Terms and Conditions",
"items": [
{
"id": "ITEM123",
"name": "Item Name",
"quantity": 1,
"unit_price": 100,
"tax_rate": 18,
"price_with_tax": 118,
"net_amount": 100,
"total_amount": 118,
"discount_percent": 10,
"discount_amount": 10,
"description": "Item Description",
"hsn_code": "1234",
"item_type": "Product",
"unit": "kg",
"category": "Electronics"
}
],
"extra_discount": 20,
"round_off": true,
"payments": [
{
"amount": 100,
"method": "upi",
"notes": "Payment notes"
}
],
"bank_details": {
"account_number": "1234567890",
"ifsc": "SBIN0000001",
"bank_name": "State Bank of India",
"branch": "Mumbai"
},
"company_shipping_address": {
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
},
"customer_shipping_address": {
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
},
"customer_billing_address": {
"address_line1": "123 Street",
"address_line2": "Apt 4B",
"city": "City Name",
"state": "State Name",
"country": "Country Name",
"pincode": "123456"
},
"subscription_details": {
"start_time": "14-02-2024",
"end_time": "14-02-2025",
"repeat": 1,
"repeat_type": "days"
},
"export_invoice_details": {
"export_type": "With Payment of Tax",
"country_id": "Afghanistan"
}
}Response
Success
Example response
{
"success": true,
"message": "Document created successfully",
"serialNumber": "SL123",
"hashId": "SL123"
}Changes
- info
endpoint added
- info