API Test Keys

Update a Bill

PATCH
/v1/bills/:bill_id

Click to copy

Use this endpoint to update a Bill.

Is this page helpful?

Curl

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
2
-X PATCH https://api.razorpay.com/v1/bills/bill_4a5e9ulyzk1mk2
3
-d '{
4
"store_code": "",
5
"customer": {
6
"contact": "9000090001",
7
"email": "saurav.kumar@example.com"
8
},
9
"receipt_type": "tax_invoice",
10
"receipt_timestamp": 1907416999,
11
"receipt_delivery": "digital",
12
"line_items": [
13
{
14
"name": "T-Shirt",
15
"quantity": 1,
16
"total_amount": 100000
17
}
18
],
19
"receipt_summary": {
20
"total_quantity": 1,
21
"sub_total_amount": 100000,
22
"currency": "INR",
23
"net_payable_amount": 124000,
24
"payment_status": "paid"
25
},
26
"taxes": [
27
{
28
"name": "cgst",
29
"percentage": 1200,
30
"amount": 12000
31
},
32
{
33
"name": "sgst",
34
"percentage": 1200,
35
"amount": 12000
36
}
37
],
38
"payments": [
39
{
40
"method": "Bank Transfer",
41
"amount": 124000,
42
"currency": "INR"
43
}
44
]
45
}'

Success

1
{
2
"id": "bill_PYy4RWJWiNcPyE",
3
"business_type": "retail",
4
"business_category": "events",
5
"customer": {
6
"contact": "9000090001",
7
"name": "d",
8
"email": "saurav.kumar@example.com",
9
"customer_id": "",
10
"age": 2,
11
"date_of_birth": "",
12
"profession": "",
13
"company_name": "",
14
"marital_status": "",
15
"spouse_name": "",
16
"anniversary_date": "",
17
"gender": "",
18
"gstin": "",
19
"billing_address": {
20
"address_line_1": "",
21
"address_line_2": "",
22
"landmark": "",
23
"city": "",
24
"province": "",
25
"pin_code": "",
26
"country": ""
27
},
28
"shipping_address": {
29
"address_line_1": "",
30
"address_line_2": "",
31
"landmark": "",
32
"city": "",
33
"province": "",
34
"pin_code": "",
35
"country": ""
36
}
37
},
38
"loyalty": {
39
"type": "",
40
"card_num": "",
41
"card_holder_name": "",
42
"points_redeemed": 1
43
},
44
"store_code": "JK-001",
45
"receipt_timestamp": 1907416999,
46
"receipt_number": "INV00124992",
47
"receipt_type": "tax_invoice",
48
"receipt_delivery": "digital",
49
"bar_code_number": "",
50
"qr_code_number": "T2322 00000009291",
51
"billing_pos_number": "bn",
52
"pos_category": "traditional_pos",
53
"order_number": "",
54
"order_service_type": "",
55
"delivery_status_url": "",
56
"line_items": [
57
{
58
"name": "T-Shirt",
59
"quantity": 1,
60
"unit": "",
61
"description": "",
62
"hsn_code": "",
63
"product_code": "",
64
"product_uid": "",
65
"image_url": "",
66
"total_amount": 100000,
67
"brand": "",
68
"style": "",
69
"colour": "",
70
"size": "",
71
"financier_data": null,
72
"taxes": [],
73
"tags": [],
74
"sub_items": []
75
}
76
],
77
"receipt_summary": {
78
"total_quantity": 1,
79
"sub_total_amount": 100000,
80
"currency": "INR",
81
"net_payable_amount": 124000,
82
"payment_status": "paid",
83
"discounts": []
84
},
85
"taxes": [
86
{
87
"name": "cgst",
88
"percentage": 1200,
89
"amount": 120
90
},
91
{
92
"name": "sgst",
93
"percentage": 1200,
94
"amount": 120
95
}
96
],
97
"payments": [
98
{
99
"method": "Bank Transfer",
100
"currency": "INR",
101
"amount": 124000,
102
"payment_reference_id": "",
103
"financier_data": null
104
}
105
],
106
"event": {
107
"name": "My Party",
108
"start_timestamp": 1722911400,
109
"end_timestamp": 1722924000,
110
"location": "B-wing",
111
"room": "Auditorium 1",
112
"seats": [
113
"gold b1",
114
"gold b2",
115
"gold b3"
116
]
117
},
118
"receipt_url": "yourbill.me/PYy4RWJWiNcPyE",
119
"created_at": 1907416999,
120
"tags": [
121
"party1",
122
"graduation"
123
]
124
}
Path Parameters
id

*

string

The unique identifier of the Bill.

Request Parameters
store_code
string

Associated store code for the receipt. Required if you have a multi-store setup where you have a single integration and have multiple stores under you.

customer
object

Details of the customer. Required if receipt mode is digital or digital_and_print.

Show child parameters (16)

employee
object

This is an array of objects containing details of the employees associated with the receipt.

Show child parameters (3)

loyalty
object

Customer loyalty details.

Show child parameters (9)

receipt_type

*

string

The type of receipt. Possible values:

  • tax_invoice
  • sales_invoice
  • sales_return_invoice
  • proforma_invoice
  • credit_invoice
  • purchase_invoice
  • debit_invoice

receipt_timestamp

*

integer

UNIX timestamp of the date and time when the receipt was generated.

receipt_delivery

*

string

Indicates the delivery type of the receipt. Possible values:

  • digital
  • print
  • digital_and_print

tags
string

An array of strings representing relevant tags associated with the invoice.

pos_category
string

The type of POS machine. This is applicable if business_type is retail. Possible values:

  • traditional_pos
  • kiosk_pos

line_items
object

This is an array of objects containing the product data of the bill. Required if receipt_type is not credit_invoice or debit_invoice.

Show child parameters (21)

receipt_summary

*

object

Details of the receipt.

Show child parameters (15)

taxes
object

This is an array of objects containing the details of the taxes incurred.

Show child parameters (3)

payments

*

object

This is an array of objects containing the details of the payment.

Show child parameters (3)

irn
object

This object contains IRN ( Invoice Reference Number ) related details. If irn is present, qr_code and irn_number are required.

Show child parameters (4)

Response Parameters
id

*

string

Unique id of the bill generated.

business_type

*

string

The type of business. Possible values:

  • ecommerce
  • retail

business_category

*

string

The category the business falls under. Possible values:

  • events
  • food_and_beverages
  • retail_and_consumer_goods
  • other_services

customer
object

Details of the customer. Required if receipt mode is digital or digital_and_print.

Show child parameters (16)

loyalty
object

Customer loyalty details.

Show child parameters (9)

store_code
string

Associated store code for the receipt. Required if you have a multi-store setup where you have a single integration and have multiple stores under you.

receipt_timestamp

*

integer

UNIX timestamp of the date and time when the receipt was generated.

receipt_number

*

string

Unique receipt number generated for the bill.

receipt_type

*

string

The type of receipt. Possible values:

  • tax_invoice
  • sales_invoice
  • sales_return_invoice
  • proforma_invoice
  • credit_invoice
  • purchase_invoice
  • debit_invoice

receipt_delivery

*

string

Indicates the delivery type of the receipt. Possible values:

  • digital
  • print
  • digital_and_print

tags
string

An array of strings representing relevant tags associated with the invoice.

bar_code_number
integer

Bar code generated after the transaction. This will be displayed on the digital bill only.

qr_code_number
integer

QR code generated after the transaction. This will be displayed on the digital bill only.

billing_pos_number
string

POS number of the machine that generated the bill. This is applicable if business_type is retail.

pos_category
string

The type of POS machine. This is applicable if business_type is retail. Possible values:

  • traditional_pos
  • kiosk_pos

order_number
string

Incremental order number of the generated bill.

order_service_type
string

Order service type of the generated bill. This is applicable if business_category is food_and_beverages. Possible values:

  • dine_in
  • take_away

delivery_status_url
string

Order delivery status. This is applicable if business_type is ecommerce.

line_items
object

This is an array of objects containing the product data of the bill. Required if receipt_type is not credit_invoice or debit_invoice.

Show child parameters (17)

receipt_summary

*

object

Details of the receipt.

Show child parameters (15)

taxes
object

This is an array of objects containing the details of the taxes applied. Required if receipt_type is tax_inovice, purchase_invoice or sales_invoice.

Show child parameters (3)

payments

*

object

Details of the payment.

Show child parameters (5)

event
object

Details of the event booking. Required if business_category is events.

Show child parameters (6)

receipt_url
string

The link to the receipt.

created_at
integer

UNIX timestamp of the date when the bill was generated.

Errors

client not authorised to update

Error Status: 401

The client credentials are unauthorised to make changes to this bill.

Solution

The quantity must be an integer

Error Status: 400

The quantity of the product was not written in integer format.

Solution

Operation failed

Error Status: 400

There is an internal server error.

Solution

Bill not found for given receipt_number

Error Status: 400

The bill id is incorrect or deleted.

Solution

Update a Bill

PATCH
/v1/bills/:bill_id

Click to copy

Use this endpoint to update a Bill.

Is this page helpful?

Path Parameters
id

*

string

The unique identifier of the Bill.

Request Parameters
store_code
string

Associated store code for the receipt. Required if you have a multi-store setup where you have a single integration and have multiple stores under you.

customer
object

Details of the customer. Required if receipt mode is digital or digital_and_print.

Show child parameters (16)

employee
object

This is an array of objects containing details of the employees associated with the receipt.

Show child parameters (3)

loyalty
object

Customer loyalty details.

Show child parameters (9)

receipt_type

*

string

The type of receipt. Possible values:

  • tax_invoice
  • sales_invoice
  • sales_return_invoice
  • proforma_invoice
  • credit_invoice
  • purchase_invoice
  • debit_invoice

receipt_timestamp

*

integer

UNIX timestamp of the date and time when the receipt was generated.

receipt_delivery

*

string

Indicates the delivery type of the receipt. Possible values:

  • digital
  • print
  • digital_and_print

tags
string

An array of strings representing relevant tags associated with the invoice.

pos_category
string

The type of POS machine. This is applicable if business_type is retail. Possible values:

  • traditional_pos
  • kiosk_pos

line_items
object

This is an array of objects containing the product data of the bill. Required if receipt_type is not credit_invoice or debit_invoice.

Show child parameters (21)

receipt_summary

*

object

Details of the receipt.

Show child parameters (15)

taxes
object

This is an array of objects containing the details of the taxes incurred.

Show child parameters (3)

payments

*

object

This is an array of objects containing the details of the payment.

Show child parameters (3)

irn
object

This object contains IRN ( Invoice Reference Number ) related details. If irn is present, qr_code and irn_number are required.

Show child parameters (4)

Response Parameters
id

*

string

Unique id of the bill generated.

business_type

*

string

The type of business. Possible values:

  • ecommerce
  • retail

business_category

*

string

The category the business falls under. Possible values:

  • events
  • food_and_beverages
  • retail_and_consumer_goods
  • other_services

customer
object

Details of the customer. Required if receipt mode is digital or digital_and_print.

Show child parameters (16)

loyalty
object

Customer loyalty details.

Show child parameters (9)

store_code
string

Associated store code for the receipt. Required if you have a multi-store setup where you have a single integration and have multiple stores under you.

receipt_timestamp

*

integer

UNIX timestamp of the date and time when the receipt was generated.

receipt_number

*

string

Unique receipt number generated for the bill.

receipt_type

*

string

The type of receipt. Possible values:

  • tax_invoice
  • sales_invoice
  • sales_return_invoice
  • proforma_invoice
  • credit_invoice
  • purchase_invoice
  • debit_invoice

receipt_delivery

*

string

Indicates the delivery type of the receipt. Possible values:

  • digital
  • print
  • digital_and_print

tags
string

An array of strings representing relevant tags associated with the invoice.

bar_code_number
integer

Bar code generated after the transaction. This will be displayed on the digital bill only.

qr_code_number
integer

QR code generated after the transaction. This will be displayed on the digital bill only.

billing_pos_number
string

POS number of the machine that generated the bill. This is applicable if business_type is retail.

pos_category
string

The type of POS machine. This is applicable if business_type is retail. Possible values:

  • traditional_pos
  • kiosk_pos

order_number
string

Incremental order number of the generated bill.

order_service_type
string

Order service type of the generated bill. This is applicable if business_category is food_and_beverages. Possible values:

  • dine_in
  • take_away

delivery_status_url
string

Order delivery status. This is applicable if business_type is ecommerce.

line_items
object

This is an array of objects containing the product data of the bill. Required if receipt_type is not credit_invoice or debit_invoice.

Show child parameters (17)

receipt_summary

*

object

Details of the receipt.

Show child parameters (15)

taxes
object

This is an array of objects containing the details of the taxes applied. Required if receipt_type is tax_inovice, purchase_invoice or sales_invoice.

Show child parameters (3)

payments

*

object

Details of the payment.

Show child parameters (5)

event
object

Details of the event booking. Required if business_category is events.

Show child parameters (6)

receipt_url
string

The link to the receipt.

created_at
integer

UNIX timestamp of the date when the bill was generated.

Errors

client not authorised to update

Error Status: 401

The client credentials are unauthorised to make changes to this bill.

Solution

The quantity must be an integer

Error Status: 400

The quantity of the product was not written in integer format.

Solution

Operation failed

Error Status: 400

There is an internal server error.

Solution

Bill not found for given receipt_number

Error Status: 400

The bill id is incorrect or deleted.

Solution

Curl

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
2
-X PATCH https://api.razorpay.com/v1/bills/bill_4a5e9ulyzk1mk2
3
-d '{
4
"store_code": "",
5
"customer": {
6
"contact": "9000090001",
7
"email": "saurav.kumar@example.com"
8
},
9
"receipt_type": "tax_invoice",
10
"receipt_timestamp": 1907416999,
11
"receipt_delivery": "digital",
12
"line_items": [
13
{
14
"name": "T-Shirt",
15
"quantity": 1,
16
"total_amount": 100000
17
}
18
],
19
"receipt_summary": {
20
"total_quantity": 1,
21
"sub_total_amount": 100000,
22
"currency": "INR",
23
"net_payable_amount": 124000,
24
"payment_status": "paid"
25
},
26
"taxes": [
27
{
28
"name": "cgst",
29
"percentage": 1200,
30
"amount": 12000
31
},
32
{
33
"name": "sgst",
34
"percentage": 1200,
35
"amount": 12000
36
}
37
],
38
"payments": [
39
{
40
"method": "Bank Transfer",
41
"amount": 124000,
42
"currency": "INR"
43
}
44
]
45
}'

Success

1
{
2
"id": "bill_PYy4RWJWiNcPyE",
3
"business_type": "retail",
4
"business_category": "events",
5
"customer": {
6
"contact": "9000090001",
7
"name": "d",
8
"email": "saurav.kumar@example.com",
9
"customer_id": "",
10
"age": 2,
11
"date_of_birth": "",
12
"profession": "",
13
"company_name": "",
14
"marital_status": "",
15
"spouse_name": "",
16
"anniversary_date": "",
17
"gender": "",
18
"gstin": "",
19
"billing_address": {
20
"address_line_1": "",
21
"address_line_2": "",
22
"landmark": "",
23
"city": "",
24
"province": "",
25
"pin_code": "",
26
"country": ""
27
},
28
"shipping_address": {
29
"address_line_1": "",
30
"address_line_2": "",
31
"landmark": "",
32
"city": "",
33
"province": "",
34
"pin_code": "",
35
"country": ""
36
}
37
},
38
"loyalty": {
39
"type": "",
40
"card_num": "",
41
"card_holder_name": "",
42
"points_redeemed": 1
43
},
44
"store_code": "JK-001",
45
"receipt_timestamp": 1907416999,
46
"receipt_number": "INV00124992",
47
"receipt_type": "tax_invoice",
48
"receipt_delivery": "digital",
49
"bar_code_number": "",
50
"qr_code_number": "T2322 00000009291",
51
"billing_pos_number": "bn",
52
"pos_category": "traditional_pos",
53
"order_number": "",
54
"order_service_type": "",
55
"delivery_status_url": "",
56
"line_items": [
57
{
58
"name": "T-Shirt",
59
"quantity": 1,
60
"unit": "",
61
"description": "",
62
"hsn_code": "",
63
"product_code": "",
64
"product_uid": "",
65
"image_url": "",
66
"total_amount": 100000,
67
"brand": "",
68
"style": "",
69
"colour": "",
70
"size": "",
71
"financier_data": null,
72
"taxes": [],
73
"tags": [],
74
"sub_items": []
75
}
76
],
77
"receipt_summary": {
78
"total_quantity": 1,
79
"sub_total_amount": 100000,
80
"currency": "INR",
81
"net_payable_amount": 124000,
82
"payment_status": "paid",
83
"discounts": []
84
},
85
"taxes": [
86
{
87
"name": "cgst",
88
"percentage": 1200,
89
"amount": 120
90
},
91
{
92
"name": "sgst",
93
"percentage": 1200,
94
"amount": 120
95
}
96
],
97
"payments": [
98
{
99
"method": "Bank Transfer",
100
"currency": "INR",
101
"amount": 124000,
102
"payment_reference_id": "",
103
"financier_data": null
104
}
105
],
106
"event": {
107
"name": "My Party",
108
"start_timestamp": 1722911400,
109
"end_timestamp": 1722924000,
110
"location": "B-wing",
111
"room": "Auditorium 1",
112
"seats": [
113
"gold b1",
114
"gold b2",
115
"gold b3"
116
]
117
},
118
"receipt_url": "yourbill.me/PYy4RWJWiNcPyE",
119
"created_at": 1907416999,
120
"tags": [
121
"party1",
122
"graduation"
123
]
124
}