Generate B2C Payment QR Code
Last updated
Last updated
You can generate a B2C QR code by sending a POST
request to B2C QR code API with the following request headers.
Request URL
POST: {{HOST}}/einv/v1/b2c/generate-qr-code
x-cleartax-auth-token: {{USER_AUTH_TOKEN}}
Content-Type: application/json
gstin:{{gstin_number}}
{
"transaction": {
"Version": "1.1",
"TranDtls": {
"TaxSch": "GST",
"SupTyp": "B2C",
"RegRev": "Y",
"EcmGstin": null,
"IgstOnIntra": "N"
},
"DocDtls": {
"Typ": "INV",
"No": "TESTB2C5",
"Dt": "09/05/2023"
},
"SellerDtls": {
"Gstin": "29AAFCD5862R000",
"LglNm": "NIC company pvt ltd",
"TrdNm": "NIC Industries",
"Addr1": "5th block, kuvempu layout",
"Addr2": "kuvempu layout",
"Loc": "GANDHINAGAR",
"Pin": 560037,
"Stcd": "29",
"Ph": "9000000000",
"Em": "abc@gmail.com"
},
"BuyerDtls": {
"Gstin": "",
"LglNm": "XYZ company pvt ltd",
"TrdNm": "XYZ Industries",
"Pos": "12",
"Addr1": "7th block, kuvempu layout",
"Addr2": "kuvempu layout",
"Loc": "GANDHINAGAR",
"Pin": 562160,
"Stcd": "29",
"Ph": "91111111111",
"Em": "xyz@yahoo.com"
},
"DispDtls": {
"Nm": "ABC company pvt ltd",
"Addr1": "7th block, kuvempu layout",
"Addr2": "kuvempu layout",
"Loc": "Banagalore",
"Pin": 562160,
"Stcd": "29"
},
"ShipDtls": {
"Gstin": "",
"LglNm": "CBE company pvt ltd",
"TrdNm": "kuvempu layout",
"Addr1": "7th block, kuvempu layout",
"Addr2": "kuvempu layout",
"Loc": "Banagalore",
"Pin": 562160,
"Stcd": "29"
},
"ItemList": [
{
"SlNo": "1",
"PrdDesc": "Rice",
"IsServc": "N",
"HsnCd": "10019920",
"Barcde": "123456",
"Qty": 100.345,
"FreeQty": 10,
"Unit": "BAG",
"UnitPrice": 99.545,
"TotAmt": 9988.84,
"Discount": 10,
"PreTaxVal": 1,
"AssAmt": 9978.84,
"GstRt": 12.0,
"IgstAmt": 1197.46,
"CgstAmt": 0,
"SgstAmt": 0,
"CesRt": 5,
"CesAmt": 498.94,
"CesNonAdvlAmt": 10,
"StateCesRt": 12,
"StateCesAmt": 1197.46,
"StateCesNonAdvlAmt": 5,
"OthChrg": 10,
"TotItemVal": 12897.7,
"OrdLineRef": "3256",
"OrgCntry": "AG",
"PrdSlNo": "12345",
"BchDtls": {
"Nm": "123456",
"ExpDt": "05/05/2023",
"WrDt": "05/05/2023"
},
"AttribDtls": [
{
"Nm": "Rice",
"Val": "10000"
}
]
}
],
"ValDtls": {
"AssVal": 9978.84,
"CgstVal": 0,
"SgstVal": 0,
"IgstVal": 1197.46,
"CesVal": 508.94,
"StCesVal": 1202.46,
"Discount": 10,
"OthChrg": 20,
"RndOffAmt": 0.3,
"TotInvVal": 12908,
"TotInvValFc": 12897.7
},
"PayDtls": {
"Nm": "ABCDE",
"AccDet": null,
"Mode": "Cash",
"FinInsBr": null,
"PayTerm": null,
"PayInstr": null,
"CrTrn": null,
"DirDr": null,
"CrDay": null,
"PaidAmt": null,
"PaymtDue": null,
"PayeeUPI": "mehrotra@prakhar"
},
"RefDtls": {
"InvRm": "TEST",
"DocPerdDtls": {
"InvStDt": "01/05/2023",
"InvEndDt": "05/05/2023"
},
"PrecDocDtls": [
{
"InvNo": "DOC/002",
"InvDt": "01/05/2023",
"OthRefNo": "123456"
}
],
"ContrDtls": [
{
"RecAdvRefr": "Doc/003",
"RecAdvDt": "01/05/2023",
"Tendrefr": "Abc001",
"Contrrefr": "Co123",
"Extrefr": "Yo456",
"Projrefr": "Doc-456",
"Porefr": "Doc-789",
"PoRefDt": "01/05/2023"
}
]
},
"ExpDtls": {
"ShipBNo": "A-248",
"ShipBDt": "01/05/2023",
"Port": "INABG1",
"RefClm": "N",
"ForCur": "AED",
"CntCode": "AE"
},
"custom_fields": {
"customfieldLable1": "CustomFieldValue1",
"customfieldLable2": "CustomFieldValue2",
"customfieldLable3": "CustomFieldValue3"
}
}
}
{
"transaction_id":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i3KHoM1XpvHz/xsgay/CcE4mkdl6s2dJRsIXwSgYEx8vwPoghSZgdc0d/4L66Rh8bphGzgKa4I4bIck5Tj2qpVUwUg7cqntmOWMRPfrsR/SdwCE1gluoXrGHfC/GyF4SlcuC/NtkapNbCQfenENKroh/SUIDKdZDvb9hds2SO5jdxZ1TLdd552NaBd4N2/eFKkfr5JGjWj81aL+cCuumtuuV+6/+IQeSBLS4iUTQFknuMxlEH1LuqJvzt7fTocGyD8YG3JtbMi1sSHXxoZcGxtybWzItbEh18aGXBv/C/IvesN+XciFDysAAAAASUVORK5CYII=",
"raw_qrCode": null,
"error": null
}
{
"transaction_id": "29AAFCD5862R000_WARB2C6_INV_2023",
"qr_code": null,
"raw_qrCode": null,
"error": {
"errors": [
{
"error_code": "107",
"error_message": "null : UPI Id can not be left blank",
"error_source": "CLEARTAX"
}
]
}
}
You can get a B2C QR code transaction by sending a GET
request to B2C QR code API with the following request headers.
Request URL
GET: {{HOST}}/einv/v1/b2c
Sample URL
https://api-sandbox.clear.in/einv/v1/b2c?transaction_ids=29AAFCD5862R000_TESTB2C5_INV_2023
x-cleartax-auth-token: {{USER_AUTH_TOKEN}}
Content-Type: application/json
Gstin:{{gstin_number}}
If there are no records in the applied filter, you will get an empty array with HTTP status code 200
[
{
"deleted": false,
"owner_id": null,
"tag_identifier": null,
"gstin": "29AAFCD5862R000",
"group_id": null,
"transaction_id": "29AAFCD5862R000_TESTB2C5_INV_2023",
"custom_fields": null,
"is_deleted": false,
"transaction": {
"Version": "1.1",
"DocDtls": {
"Dt": "09/05/2023",
"No": "TESTB2C5",
"Typ": "INV"
},
"TranDtls": {
"TaxSch": "GST",
"RegRev": "Y",
"SupTyp": "B2C",
"IgstOnIntra": "N"
},
"SellerDtls": {
"Gstin": "29AAFCD5862R000",
"LglNm": "NIC company pvt ltd",
"TrdNm": "NIC Industries",
"Addr1": "5th block, kuvempu layout",
"Addr2": "kuvempu layout",
"Loc": "GANDHINAGAR",
"Pin": 560037,
"Stcd": "29",
"Ph": "9000000000",
"Em": "abc@gmail.com"
},
"BuyerDtls": {
"LglNm": "XYZ company pvt ltd",
"TrdNm": "XYZ Industries",
"Pos": "12",
"Addr1": "7th block, kuvempu layout",
"Addr2": "kuvempu layout",
"Loc": "GANDHINAGAR",
"Pin": 562160,
"Stcd": "29",
"Ph": "91111111111",
"Em": "xyz@yahoo.com"
},
"DispDtls": {
"Nm": "ABC company pvt ltd",
"Loc": "Banagalore",
"Pin": "562160",
"Stcd": "29"
},
"ShipDtls": {
"LglNm": "CBE company pvt ltd",
"TrdNm": "kuvempu layout",
"Addr1": "7th block, kuvempu layout",
"Addr2": "kuvempu layout",
"Loc": "Banagalore",
"Pin": "562160",
"Stcd": "29"
},
"ItemList": [
{
"SlNo": "1",
"PrdDesc": "Rice",
"IsServc": "N",
"HsnCd": "10019920",
"Barcde": "123456",
"Qty": 100.345,
"FreeQty": 10.000,
"Unit": "BAG",
"UnitPrice": 99.545,
"TotAmt": 9988.84,
"Discount": 10.00,
"PreTaxVal": 1.00,
"AssAmt": 9978.84,
"GstRt": 12.00,
"IgstAmt": 1197.46,
"CgstAmt": 0.00,
"SgstAmt": 0.00,
"CesRt": 5.00,
"CesAmt": 498.94,
"CesNonAdvlAmt": 10.00,
"StateCesRt": 12.00,
"StateCesAmt": 1197.46,
"StateCesNonAdvlAmt": 5.00,
"OthChrg": 10.00,
"TotItemVal": 12897.70,
"OrdLineRef": "3256",
"OrgCntry": "AG",
"PrdSlNo": "12345",
"BchDtls": {
"Nm": "123456",
"ExpDt": "05/05/2023",
"WrDt": "05/05/2023"
},
"AttribDtls": [
{
"Nm": "Rice",
"Val": "10000"
}
]
}
],
"ValDtls": {
"AssVal": 9978.84,
"CgstVal": 0.00,
"SgstVal": 0.00,
"IgstVal": 1197.46,
"CesVal": 508.94,
"StCesVal": 1202.46,
"Discount": 10.00,
"OthChrg": 20.00,
"RndOffAmt": 0.30,
"TotInvVal": 12908.00,
"TotInvValFc": 12897.70
},
"PayDtls": {
"Nm": "ABCDE",
"Mode": "Cash",
"PayeeUPI": "mehrotra@prakhar"
},
"RefDtls": {
"InvRm": "TEST",
"DocPerdDtls": {
"InvStDt": "01/05/2023",
"InvEndDt": "05/05/2023"
},
"PrecDocDtls": [
{
"InvNo": "DOC/002",
"InvDt": "01/05/2023",
"OthRefNo": "123456"
}
],
"ContrDtls": [
{
"RecAdvRefr": "Doc/003",
"RecAdvDt": "01/05/2023",
"TendRefr": null,
"ContrRefr": null,
"ExtRefr": null,
"ProjRefr": null,
"PORefr": null,
"PORefDt": null
}
]
},
"ExpDtls": {
"ShipBNo": "A-248",
"ShipBDt": "01/05/2023",
"Port": "INABG1",
"RefClm": "N",
"ForCur": "AED",
"CntCode": "AE"
}
},
"qrcode_status": "GENERATED",
"qrcode": "iVBORw0KGgoAAAANSUhEUgAAAcIAAAHCAQAAAABUY/ToAAAG70lEQVR4Xu2bQY7qSBBEE7FgyRF8E7gYkpF8MbgJR+ilF4iceJFmZppuyaO/mUW6pKbbropaxM+MisziR/7huMXnm/86NuTa2JBrY0OujQ25Njbk2tiQa2NDro0NuTYW5C0iDq/j9IhdPofMr/Ghx2vkKy7DIXNiid7dv7Rw1xF5149ej4/U+uFwO055yK/LECfB9TEJxBJtWYv7Ib9iEJnPIeKYDyGvMUPhvBN8PrPHOa+DSL+E9+iJvGvBOw6fw3xS4CURKeT+4TiMc29k5jUqtATn0fBYEhIkVHdFJvkppHgcExkLQMpUCCZd57Pe/ZafTZAiMxx9qx9vqrshPchKlJ05/QXVsVNYittnQLAy9Z/VzZDidtD6K3oulnnEJ1TOegB/C1pHJKskT2POwQIcgxXMWyohZRv4a464RE/kMnexuQwtGB/BHgdPvABxABKMZSDaIVFxh5ZZhlttJE8V8K0PideNYHwdvbwh0jaTVZxzeE1vJJ9wTiXkTh+in/yE9HNLpN7IGMhSLkKVVHR2UvvEg5dX1+P4qWBdkEdzu08TVxmIZEnGVAfLl4cnyNSP/OyCvInW+URCwp7I5ChUugalirNyxjFoyeT1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zUMJ2PNMvGmvyHSpYojTVk52VPRRrHrnJi9LK6zJZLXysB9HYC2lAeMOPUKLe1puUIC9MODtUA6P/GVs9sAfBBzqJXfWdoUfeTnMpohJVSOuX9lZRV4pKu1TBJvi8VsR2RyLeIMtIwpKwm3JyEoS36neUKV90t+dkHSVEpMwEzD1h0A75GWNix5UPiaVkjviAzyc+KFgowit2zmOfEJFnqkjbCMb9HXBXlzP+ltJOE2nalJfrpP6YqOzX9kdg+kM1C0PuoAhGBiTpNfJfSVn4Sg+e6IdPWGZNlTWdB4dwe5M1K7ZYlXRyTRJ1FHz30HgHjZZgL3VwGQd9crvGuIlImSfwqas9y5nclPdCvwnx7OSvkE79sQeafFdsc6oVF6GySk3i3KHoM1XpvHz/xsgay/CcE4mkdl6s2dJRsIXwSgYEx8vwPoghSZgdc0d/4L66Rh8bphGzgKa4I4bIck5Tj2qpVUwUg7cqntmOWMRPfrsR/SdwCE1gluoXrGHfC/GyF4SlcuC/NtkapNbCQfenENKroh/SUIDKdZDvb9hds2SO5jdxZ1TLdd552NaBd4N2/eFKkfr5JGjWj81aL+cCuumtuuV+6/+IQeSBLS4iUTQFknuMxlEH1LuqJvzt7fTocGyD8YG3JtbMi1sSHXxoZcGxtybWzItbEh18aGXBv/C/IvesN+XciFDysAAAAASUVORK5CYII=",
"raw_qrcode": null,
"error_response": null,
"upi_id": null,
"b2c_response": {
"Success": "Y"
},
"updated_at": null,
"generated_on": null
}
]
You can delete a B2C QR transaction by sending a POST
request to B2C QR code API with the following request headers.
Request URL
POST: {{HOST}}/einv/v1/b2c/delete
Sample URL
https://api-sandbox.clear.in/einv/v1/b2c/delete
x-cleartax-auth-token: {{USER_AUTH_TOKEN}}
Content-Type: application/json
gstin:{{gstin_number}}
["29AAFCD5862R000_TESTB2C5_INV_2023"]
On successful deletion, you will receive HTTP status code as 204 No Content.
You can print a B2C invoice by sending a POST
request to B2C QR code API with the following request headers.
Request URL
POST: {{HOST}}/einv/v1/b2c/download-pdf
Sample URL
https://api-sandbox.clear.in/einv/v1/b2c/download-pdf
x-cleartax-auth-token: {{USER_AUTH_TOKEN}}
Content-Type: application/json
gstin:{{gstin_number}}
["29AAFCD5862R000_TESTB2C5_INV_2023"]