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": "T102",
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

Failure

1
{
2
"id": "bill_4a5e9ulyzk1mk2",
3
"business_type": "retail",
4
"business_category": "retail_and_consumer_goods",
5
"customer": {
6
"contact": "9000090001",
7
"name": "Gaurav Kumar",
8
"email": "saurav.kumar@example.com",
9
"customer_id": "",
10
"age": 27,
11
"date_of_birth": "03/12/1889",
12
"profession": "",
13
"company_name": "",
14
"marital_status": "married",
15
"spouse_name": "",
16
"anniversary_date": "",
17
"gender": "male",
18
"gstin": "",
19
"billing_address": {
20
"address_line_1": "r",
21
"address_line_2": "",
22
"landmark": "",
23
"city": "",
24
"province": "",
25
"pin_code": "",
26
"country": ""
27
},
28
"shipping_address": {
29
"address_line_1": "r",
30
"address_line_2": "",
31
"landmark": "",
32
"city": "",
33
"province": "",
34
"pin_code": "",
35
"country": ""
36
}
37
},
38
"loyalty": {
39
"type": "cashback",
40
"card_num": "",
41
"card_holder_name": "",
42
"wallet_amount": 0,
43
"amount_saved": 0,
44
"points_earned": 5,
45
"points_redeemed": 0,
46
"points_available": 0,
47
"points_balance": 0
48
},
49
"store_code": "MM-001",
50
"receipt_timestamp": 1907416999,
51
"receipt_number": "INV101",
52
"receipt_type": "tax_invoice",
53
"receipt_delivery": "digital",
54
"bar_code_number": "",
55
"qr_code_number": "",
56
"billing_pos_number": "bn",
57
"pos_category": "traditional_pos",
58
"order_number": "",
59
"order_service_type": "",
60
"delivery_status_url": "google.com",
61
"cashier_name": "wt4rseg",
62
"cashier_code": "fsd",
63
"line_items": [
64
{
65
"name": "T-Shirt",
66
"quantity": 1,
67
"unit": "",
68
"description": "",
69
"hsn_code": "",
70
"product_code": "",
71
"product_uid": "",
72
"image_url": "",
73
"discount_description": "",
74
"total_amount": 100000,
75
"brand": "",
76
"style": "",
77
"colour": "",
78
"size": "",
79
"financier_data": null,
80
"taxes": []
81
}
82
],
83
"receipt_summary": {
84
"total_quantity": 1,
85
"sub_total_amount": 100000,
86
"currency": "INR",
87
"net_payable_amount": 124000,
88
"payment_status": "paid",
89
"discounts": []
90
},
91
"taxes": [],
92
"payments": [],
93
"event": null,
94
"receipt_url": "yourbill.me/4a5e9ulyzk1mk2",
95
"created_at": 1907416999
96
}
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 (14)

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

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 (3)

receipt_summary

*

object

Details of the receipt.

Show child parameters (5)

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)

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

*

integer

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

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.

cashier_name
string

Name of the cashier that billed the order. This is applicable if business_type is retail.

cashier_code
string

The unique id of the cashier that billed the order. This is applicable if business_type is retail.

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 (14)

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

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 (3)

receipt_summary

*

object

Details of the receipt.

Show child parameters (5)

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)

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

*

integer

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

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.

cashier_name
string

Name of the cashier that billed the order. This is applicable if business_type is retail.

cashier_code
string

The unique id of the cashier that billed the order. This is applicable if business_type is retail.

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": "T102",
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

Failure

1
{
2
"id": "bill_4a5e9ulyzk1mk2",
3
"business_type": "retail",
4
"business_category": "retail_and_consumer_goods",
5
"customer": {
6
"contact": "9000090001",
7
"name": "Gaurav Kumar",
8
"email": "saurav.kumar@example.com",
9
"customer_id": "",
10
"age": 27,
11
"date_of_birth": "03/12/1889",
12
"profession": "",
13
"company_name": "",
14
"marital_status": "married",
15
"spouse_name": "",
16
"anniversary_date": "",
17
"gender": "male",
18
"gstin": "",
19
"billing_address": {
20
"address_line_1": "r",
21
"address_line_2": "",
22
"landmark": "",
23
"city": "",
24
"province": "",
25
"pin_code": "",
26
"country": ""
27
},
28
"shipping_address": {
29
"address_line_1": "r",
30
"address_line_2": "",
31
"landmark": "",
32
"city": "",
33
"province": "",
34
"pin_code": "",
35
"country": ""
36
}
37
},
38
"loyalty": {
39
"type": "cashback",
40
"card_num": "",
41
"card_holder_name": "",
42
"wallet_amount": 0,
43
"amount_saved": 0,
44
"points_earned": 5,
45
"points_redeemed": 0,
46
"points_available": 0,
47
"points_balance": 0
48
},
49
"store_code": "MM-001",
50
"receipt_timestamp": 1907416999,
51
"receipt_number": "INV101",
52
"receipt_type": "tax_invoice",
53
"receipt_delivery": "digital",
54
"bar_code_number": "",
55
"qr_code_number": "",
56
"billing_pos_number": "bn",
57
"pos_category": "traditional_pos",
58
"order_number": "",
59
"order_service_type": "",
60
"delivery_status_url": "google.com",
61
"cashier_name": "wt4rseg",
62
"cashier_code": "fsd",
63
"line_items": [
64
{
65
"name": "T-Shirt",
66
"quantity": 1,
67
"unit": "",
68
"description": "",
69
"hsn_code": "",
70
"product_code": "",
71
"product_uid": "",
72
"image_url": "",
73
"discount_description": "",
74
"total_amount": 100000,
75
"brand": "",
76
"style": "",
77
"colour": "",
78
"size": "",
79
"financier_data": null,
80
"taxes": []
81
}
82
],
83
"receipt_summary": {
84
"total_quantity": 1,
85
"sub_total_amount": 100000,
86
"currency": "INR",
87
"net_payable_amount": 124000,
88
"payment_status": "paid",
89
"discounts": []
90
},
91
"taxes": [],
92
"payments": [],
93
"event": null,
94
"receipt_url": "yourbill.me/4a5e9ulyzk1mk2",
95
"created_at": 1907416999
96
}