Integration Flow

  1. Send Invoice Request
  • Functionality: Allows a business to create and send invoices to their customers, detailing the goods or services provided.

  • Flow: After a business is onboarded and operational, it can generate invoices directly through this API, streamlining the billing process.

  • Use the below endpoint to Send Invoice Request.

    POST: https://api.zwitch.io/v1/bharat-connect/invoice
    

Below is a sample request and response for the Check Business API.

{
    "supplier_invoice_number": "INV0012312",
    "supplier_details": {
        "b2b_id": "zwch_1731304320a8b539acf65f1337854926",
        "gst_in": "22AAAAA0000A3Z9",
        "legal_name": "Open Financial",
        "trade_name": "Open Financial",
        "email": "[email protected]",
        "state_code": "KA",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 123",
            "city": "Bangalore",
            "postal_code": "560035",
            "state": "KARNATAKA"
        },
        "mobile_number":""
    },
    "buyer_details": {
        "b2b_id": "zwch_1731046715a8b539acf65f6707494305",
        "gst_in": "22AAAAA0000A1H2",
        "legal_name": "Surjava Test",
        "trade_name": "Surjava Test",
        "email": "[email protected]",
        "state_code": "KA",
        "place_of_supply_code": "KA",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 456",
            "city": "Bangalore",
            "postal_code": "560035",
            "state": "KARNATAKA"
        }
    },
    "transaction_details": {
        "supply_type": "B2B",
        "reverse_charge_tax": "",
        "e_commerce_gstin": "",
        "igst_chargable": ""
    },
    "e_invoice_details": {
        "irn": "",
        "irn_ts": ""
    },
    "items_details": [
        {
            "serial_no": "1",
            "is_service": "NO",
            "hsn_code": "19059040",
            "quantity": 1.0,
            "unit_price": 2.0,
            "total_amount": 2.0,
            "assessment_amount": 2.0,
            "gst_rate": 18.0,
            "total_item_value": 4.0,
            "product_description": "xyz description test"
        }
    ],
    "supplier_bank_details": {
        "vpa": "test@vpa",
        "bank_account_number": "3307",
        "name_of_account_holder": "John Doe",
        "bank_ifsc_code": "SBIN0070305",
        "bank_name": "SBI"
    },
    "metadata": {}
}

{
    "id": "bcinv_k3pbaALyh1CmzTPTOToHywYey",
    "object": "bharat_connect.invoice",
    "type": "OUTGOING",
    "supplier_invoice_number": "INV0012312",
    "supplier_details": {
        "b2b_id": "zwch_1731304320a8b539acf65f1337854926",
        "gst_in": "22AAAAA0000A3Z9",
        "legal_name": "Open Financial",
        "trade_name": "Open Financial",
        "email": "[email protected]",
        "state_code": "32",
        "place_of_supply_code": "",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 123",
            "city": "Bangalore",
            "postal_code": "560035",
            "state_code": "",
            "state": "KARNATAKA"
        }
    },
    "buyer_details": {
        "b2b_id": "zwch_1731046715a8b539acf65f6707494305",
        "gst_in": "22AAAAA0000A1H2",
        "legal_name": "Surjava Test",
        "trade_name": "Surjava Test",
        "email": "[email protected]",
        "state_code": "06",
        "place_of_supply_code": "32",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 456",
            "city": "Bangalore",
            "postal_code": "560035",
            "state_code": "",
            "state": "KARNATAKA"
        }
    },
    "transaction_detais": {
        "supply_type": "B2B",
        "reverse_charge_tax": "",
        "e_commerce_gstin": "",
        "igst_chargable": ""
    },
    "e_invoice_details": {
        "irn": "",
        "irn_ts": ""
    },
    "items_details": [
        {
            "serial_no": "1",
            "is_service": "NO",
            "hsn_code": "19059040",
            "quantity": 1,
            "unit_price": 2,
            "total_amount": 2,
            "assessment_amount": 2,
            "gst_rate": 18,
            "total_item_value": 4,
            "product_description": "xyz description test"
        }
    ],
    "value_details": {
        "assessment_value": 4,
        "total_invoice_value": 4
    },
    "supplier_bank_details": {
        "vpa": "test@vpa",
        "account_type": "",
        "bank_account_number": "3307",
        "name_of_account_holder": "John Doe",
        "bank_ifsc_code": "SBIN0070305",
        "bank_name": "SBI"
    },
    "metadata": {},
    "status": "SENT TO BUYER",
    "response":{
	    "status":"SUCCESS",
	    "message":""
    }

}

  1. Confirm Invoice Request
  • Functionality: Enables the recipient of an invoice to confirm, reject, or return the invoice, which is essential for maintaining accurate financial records.
  • Flow: Upon receiving an invoice, a business can use this API to manage the invoice status, which directly affects the subsequent billing and payment processes.
  • Use the below endpoint to Confirm Invoice Request.
POST: https://api.zwitch.io/v1/bharat-connect/invoice/confirm

Below is a sample request and response for the Confirm Invoice Request API.

{
    "id": "bcinv_k3pbaALyh1CmzTPTOToHywYey",
    "buyer_action": "ACCEPT",
    "remarks": "testing confirm"
}

{
    "id": "bcinv_k3pbaALyh1CmzTPTOToHywYey",
    "object": "bharat_connect.invoice.",
    "type": "INCOMING"
    "supplier_invoice_number": "INV0012312",
    "supplier_details": {
        "b2b_id": "zwch_1731304320a8b539acf65f1337854926",
        "gst_in": "22AAAAA0000A3Z9",
        "legal_name": "Open Financial",
        "trade_name": "Open Financial",
        "email": "[email protected]",
        "state_code": "32",
        "place_of_supply_code": "",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 123",
            "city": "Bangalore",
            "postal_code": "560035",
            "state_code": "",
            "state": "KARNATAKA"
        }
    },
    "buyer_details": {
        "b2b_id": "zwch_1731046715a8b539acf65f6707494305",
        "gst_in": "22AAAAA0000A1H2",
        "legal_name": "Surjava Test",
        "trade_name": "Surjava Test",
        "email": "[email protected]",
        "state_code": "06",
        "place_of_supply_code": "32",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 456",
            "city": "Bangalore",
            "postal_code": "560035",
            "state_code": "",
            "state": "KARNATAKA"
        }
    },
    "transaction_detais": {
        "supply_type": "B2B",
        "reverse_charge_tax": "",
        "e_commerce_gstin": "",
        "igst_chargable": ""
    },
    "e_invoice_details": {
        "irn": "",
        "irn_ts": ""
    },
    "items_details": [
        {
            "serial_no": "1",
            "is_service": "NO",
            "hsn_code": "19059040",
            "quantity": 1,
            "unit_price": 2,
            "total_amount": 2,
            "assessment_amount": 2,
            "gst_rate": 18,
            "total_item_value": 4,
            "product_description": "xyz description test"
        }
    ],
    "value_details": {
        "assessment_value": 4,
        "total_invoice_value": 4
    },
    "supplier_bank_details": {
        "vpa": "test@vpa",
        "account_type": "",
        "bank_account_number": "3307",
        "name_of_account_holder": "John Doe",
        "bank_ifsc_code": "SBIN0070305",
        "bank_name": "SBI"
    },
    "metadata": {},
    "status": "ACCEPTED",
    "response":{
	    "status":"SUCCESS",
	    "message":""
    }
}

  1. Change Invoice Status Request
  • Functionality:Allows the supplier to update the status of an invoice, such as closing or cancelling it based on the transaction completion or agreement terms.

  • Flow: This API helps manage the lifecycle of an invoice post-issuance, ensuring that the invoice reflects the correct and current state of the transaction.

  • Use the below endpoint to Change Invoice Status Request.

    POST: https://api.zwitch.io/v1/bharat-connect/invoice/change-status
    
    

Below is a sample request and response for the Change Invoice Status Request API.

{
    "id": "bcinv_k3pbaALyh1CmzTPTOToHywYey",
    "supplier_action": "CLOSE",
    "remarks": "testing status change"
}

{
    "id": "bcinv_k3pbaALyh1CmzTPTOToHywYey",
    "object": "bharat_connect.invoice",
    "type": "OUTGOING"
    "supplier_invoice_number": "INV0012312",
    "supplier_details": {
        "b2b_id": "zwch_1731304320a8b539acf65f1337854926",
        "gst_in": "22AAAAA0000A3Z9",
        "legal_name": "Open Financial",
        "trade_name": "Open Financial",
        "email": "[email protected]",
        "state_code": "32",
        "place_of_supply_code": "",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 123",
            "city": "Bangalore",
            "postal_code": "560035",
            "state_code": "",
            "state": "KARNATAKA"
        }
    },
    "buyer_details": {
        "b2b_id": "zwch_1731046715a8b539acf65f6707494305",
        "gst_in": "22AAAAA0000A1H2",
        "legal_name": "Surjava Test",
        "trade_name": "Surjava Test",
        "email": "[email protected]",
        "state_code": "06",
        "place_of_supply_code": "32",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 456",
            "city": "Bangalore",
            "postal_code": "560035",
            "state_code": "",
            "state": "KARNATAKA"
        }
    },
    "transaction_detais": {
        "supply_type": "B2B",
        "reverse_charge_tax": "",
        "e_commerce_gstin": "",
        "igst_chargable": ""
    },
    "e_invoice_details": {
        "irn": "",
        "irn_ts": ""
    },
    "items_details": [
        {
            "serial_no": "1",
            "is_service": "NO",
            "hsn_code": "19059040",
            "quantity": 1,
            "unit_price": 2,
            "total_amount": 2,
            "assessment_amount": 2,
            "gst_rate": 18,
            "total_item_value": 4,
            "product_description": "xyz description test"
        }
    ],
    "value_details": {
        "assessment_value": 4,
        "total_invoice_value": 4
    },
    "supplier_bank_details": {
        "vpa": "test@vpa",
        "account_type": "",
        "bank_account_number": "3307",
        "name_of_account_holder": "John Doe",
        "bank_ifsc_code": "SBIN0070305",
        "bank_name": "SBI"
    },
    "metadata": {},
    "status": "CLOSED",
    "response":{
	    "status":"SUCCESS",
	    "message":""
    }
}

  1. Edit Invoice Request
  • Functionality:Permits modifications to an existing invoice, accommodating changes in transaction details or corrections.

  • Flow: If there are any errors or adjustments needed in an issued invoice, this API facilitates the necessary updates without needing to void the original document entirely.

  • Use the below endpoint to Edit Invoice Request.

    POST: https://api.zwitch.io/v1/bharat-connect/invoice/edit
    
    

Below is a sample request and response for the Edit Invoice Request API.

{
    "id": "bcinv_k3pbaALyh1CmzTPTOToHywYey",
    "supplier_invoice_number": "INV0012312",
    "supplier_details": {
        "b2b_id": "zwch_1731304320a8b539acf65f1337854926",
        "gst_in": "22AAAAA0000A3Z9",
        "legal_name": "Open Financial",
        "trade_name": "Open Financial",
        "email": "[email protected]",
        "state_code": "32",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 123",
            "city": "Bangalore",
            "postal_code": "560035",
            "state": "KARNATAKA"
        },
        "mobile":""
    },
    "buyer_details": {
        "b2b_id": "zwch_1731046715a8b539acf65f6707494305",
        "gst_in": "22AAAAA0000A1H2",
        "legal_name": "Surjava Test",
        "trade_name": "Surjava Test",
        "email": "[email protected]",
        "state_code": "06",
        "place_of_supply_code": "32",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 456",
            "city": "Bangalore",
            "postal_code": "560035",
            "state": "KARNATAKA"
        }
    },
    "transaction_details": {
        "supply_type": "B2B",
        "reverse_charge_tax": "",
        "e_commerce_gstin": "",
        "igst_chargable": ""
    },
    "e_invoice_details": {
        "irn": "",
        "irn_ts": ""
    },
    "items_details": [
        {
            "serial_no": "1",
            "is_service": "NO",
            "hsn_code": "19059040",
            "quantity": 1.0,
            "unit_price": 2.0,
            "total_amount": 2.0,
            "assessment_amount": 2.0,
            "gst_rate": 18.0,
            "total_item_value": 4.0,
            "product_description": "xyz description test"
        }
    ],
    "supplier_bank_details": {
        "vpa": "test@vpa",
        "bank_account_number": "3307",
        "name_of_account_holder": "John Doe",
        "bank_ifsc_code": "SBIN0070305",
        "bank_name": "SBI"
    },
    "metadata": {}
}


{
    "id": "bcinv_k3pbaALyh1CmzTPTOToHywYey",
    "object": "bharat_connect.invoice",
    "supplier_invoice_number": "INV0012312",
    "supplier_details": {
        "b2b_id": "zwch_1731304320a8b539acf65f1337854926",
        "gst_in": "22AAAAA0000A3Z9",
        "legal_name": "Open Financial",
        "trade_name": "Open Financial",
        "email": "[email protected]",
        "state_code": "32",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 123",
            "city": "Bangalore",
            "postal_code": "560035",
            "state": "KARNATAKA"
        },
        "mobile_number":""
    },
    "buyer_details": {
        "b2b_id": "zwch_1731046715a8b539acf65f6707494305",
        "gst_in": "22AAAAA0000A1H2",
        "legal_name": "Surjava Test",
        "trade_name": "Surjava Test",
        "email": "[email protected]",
        "state_code": "06",
        "place_of_supply_code": "32",
        "address": {
            "type": "OTHER",
            "address": "RGA Tech park 456",
            "city": "Bangalore",
            "postal_code": "560035",
            "state": "KARNATAKA"
        }
    },
    "transaction_details": {
        "supply_type": "B2B",
        "reverse_charge_tax": "",
        "e_commerce_gstin": "",
        "igst_chargable": ""
    },
    "e_invoice_details": {
        "irn": "",
        "irn_ts": ""
    },
    "items_details": [
        {
            "serial_no": "1",
            "is_service": "NO",
            "hsn_code": "19059040",
            "quantity": 1.0,
            "unit_price": 2.0,
            "total_amount": 2.0,
            "assessment_amount": 2.0,
            "gst_rate": 18.0,
            "total_item_value": 4.0,
            "product_description": "xyz description test"
        }
    ],
    "supplier_bank_details": {
        "vpa": "test@vpa",
        "bank_account_number": "3307",
        "name_of_account_holder": "John Doe",
        "bank_ifsc_code": "SBIN0070305",
        "bank_name": "SBI"
    },
    "metadata": {},
    "response":{
	    "status":"SUCCESS",
	    "message":""
    }
}