Invoices
Issue an Invoice
Issue an invoice using this endpoint.
POST
Available in🇮🇳 India🇸🇬 Singapore🇺🇸 United States
Use this endpoint to issue invoices to your customers. Only an invoice in the draft state can be issued.
Path Parameters
string
required
The unique identifier of the invoice.
Response Parameters
string
The unique identifier of the invoice.
string
Indicates the type of entity. Here, it is
invoice.string
Here, it should be
invoice.string
Unique number you added for internal reference. The minimum character length is 1 and maximum is 40.
string
The unique identifier of the customer. You can create
customer_id using the Customers API. Alternatively, you can pass the customer object described in the below fields.object
Details of the customer.
string
Unique identifier of the customer. For example,
cust_1Aa00000000004.string
Customer’s name. Alphanumeric, with period (.), apostrophe (’) and parentheses allowed. The name must be between 3-50 characters in length. For example,
Gaurav Kumar.string
The customer’s email address. A maximum length of 64 characters. For example,
gaurav.kumar@example.com.string
The customer’s phone number. A maximum length of 15 characters including country code. For example,
+919876543210.object
Details of the customer’s billing address.
string
The unique identifier generated for the customer’s billing address.
string
The customer address type. Here it is
billing_address.boolean
Defines if this is the primary address.
true: It is the customer’s primary address.false: It is not the customer’s primary address.
string
The first line of the customer’s address.
string
The second line of the customer’s address.
string
The city.
string
The zipcode.
string
The state.
string
The country.
object
Details of the customer’s shipping address.
string
The unique identifier generated for the customer’s shipping address.
string
The customer address type. Here it is
shipping_address.boolean
Defines if this is the primary address.
true: It is the customer’s primary address.false: It is not the customer’s primary address.
string
The first line of the customer’s address.
string
The second line of the customer’s address.
string
The city.
string
The zipcode.
string
The state.
string
The country.
string
The unique identifier of the order associated with the invoice.
object
Details of the line item that is billed in the invoice. Maximum of 50 line items.
string
Unique identifier that is generated if a new item has been created while creating the invoice.
string
Unique identifier of the item generated using Items API that has been billed in the invoice.
string
The item’s name.
string
A brief description of the item.
integer
The price of the item.
string
The currency associated with the item. Default is
INR. Know about the list of supported international currencies.string
Here, it is
invoice.integer
The quantity of the item billed in the invoice. Defaults to
1.string
Unique identifier of a payment made against this invoice.
string
The status of the invoice. Know more about Invoice States. Possible values:
draftissuedpartially_paidpaidcancelledexpireddeleted
integer
Timestamp, in Unix format, at which the invoice will expire.
integer
Timestamp, in Unix format, at which the invoice was issued to the customer.
integer
Timestamp, in Unix format, at which the payment was made.
integer
Timestamp, in Unix format, at which the invoice was cancelled.
integer
Timestamp, in Unix format, at which the invoice expired.
string
The delivery status of the SMS notification for the invoice sent to the customer. Possible values:
pendingsent
string
The delivery status of the email notification for the invoice sent to the customer. Possible values:
pendingsent
boolean
Indicates whether the customer can make a partial payment on the invoice. Possible values:
true: The customer can make partial payments.false(default): The customer cannot make partial payments.
integer
Amount to be paid using the invoice. Must be in the smallest unit of the currency. For example, if the amount to be received from the customer is , pass the value as
30000.integer
Amount paid by the customer against the invoice.
integer
The remaining amount to be paid by the customer for the issued invoice.
string
The currency associated with the invoice. You must mandatorily pass this parameter if accepting international payments. If you have passed
currency as a sub-parameter in the line_item object, you must ensure that the same currency is passed in both places. Know about the list of supported international currencies.string
A brief description of the invoice. The maximum character length is 2048.
object
Any custom notes added to the invoice. Maximum of 2048 characters.
string
The short URL that is generated. Share this link with customers to accept payments.
integer
Timestamp, in Unix format, that indicates the issue date of the invoice.
string
Any terms to be included in the invoice. Maximum of 2048 characters.
string
Any comments to be added in the invoice. Maximum of 2048 characters.
Errors
The API `<key/secret>
` provided is invalid.
The API `<key/secret> ` provided is invalid.
Code:
400There is a mismatch between the API credentials passed in the API call and those generated on the Dashboard.Solution:- Ensure that the API Keys are active and entered correctly.
- There should be no whitespaces before or after the keys.
line_items is required.
line_items is required.
Code:
400Items and customer details are missing.Solution: Add items and customer details.Operation not allowed for Invoice in issued status.
Operation not allowed for Invoice in issued status.
Code:
400You are trying to issue an invoice that is already issued.Solution: Issue an invoice in the draft state.The id provided does not exist.
The id provided does not exist.
Code:
400There is an error in the invoice id. It may be incorrect or invalid.Solution: Check that you have entered a valid invoice id.customer is required.
customer is required.
Code:
400The invoice does not have a customer attached. An invoice cannot be issued without customer details.Solution: Update the invoice first to add a customer_id or a customer object before issuing.expire_by should be at least 15 minutes after current time.
expire_by should be at least 15 minutes after current time.
Code:
400The invoice has an expire_by value that is in the past or less than 15 minutes from the current server time. An invoice cannot be issued with an immediate or past expiry.Solution: Update the invoice’s expire_by to a timestamp at least 15 minutes in the future before issuing.