Create an invoice item

Creates an invoice item.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

ID of the resource.

Request Body schema: application/json

InvoiceItem resource.

type
required
string

Type of invoice item.

Enum: "debit" "credit"
unitPrice
required
number <double>

Unit price of the invoice item.

description
string <= 1000 characters

Description of the invoice item.

quantity
integer

Quantity of the invoice item.

productId
string <= 50 characters

ID of the product.

periodStartTime
string <date-time>

Date and time when the billing period starts.

periodEndTime
string <date-time>

Date and time when the billing period ends.

periodNumber
integer

Number of subscription order billing periods in which the invoice item has been included.

Responses
201

Invoice item created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
type
required
string

Type of invoice item.

Enum: "debit" "credit"
unitPrice
required
number <double>

Unit price of the invoice item.

id
string <= 50 characters

ID of the website. A website is where an organization obtains a customer through a subscription. For more information, see Obtain an organization ID and website ID.

description
string <= 1000 characters

Description of the invoice item.

quantity
integer

Quantity of the invoice item.

price
number <double>

Total price of the invoice item.

productId
string <= 50 characters

ID of the product.

discountAmount
number <double>

Discount amount applied to the invoice item.

periodStartTime
string <date-time>

Date and time when the billing period starts.

periodEndTime
string <date-time>

Date and time when the billing period ends.

periodNumber
integer

Number of subscription order billing periods in which the invoice item has been included.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

object (InvoiceTaxItem)

Invoice item tax.

amount
required
number <double>

Amount of the tax.

description
required
string

Description of the tax.

rate
number or null <double>

Overall sales tax rate which includes state, county, city and district tax.

stateAmount
number or null <double>

Amount of sales tax to collect for the state.

countyAmount
number or null <double>

Amount of sales tax to collect for the county.

cityAmount
number or null <double>

Amount of sales tax to collect for the city.

specialDistrictAmount
number or null <double>

Amount of sales tax to collect for the special district.

stateRate
number or null <double>

State sales tax rate for given location.

countyRate
number or null <double>

County sales tax rate for given location.

cityRate
number or null <double>

City sales tax rate for given location.

specialDistrictRate
number or null <double>

Special district sales tax rate for given location.

object or null

Jurisdiction names for the invoice.

country
string or null

Two-letter ISO country code for the provided location.

state
string or null

Postal abbreviated state name for the provided location.

county
string or null

County name for the provided location.

city
string or null

City name for the provided location.

Array of objects

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Enum: "self" "product"
object

Embedded objects that are requested by the expand query parameter.

product
object
plan
object
401

Unauthorized access. Invalid credentials used.

422

Invalid data sent.

post/invoices/{id}/items
Request samples
application/json
{
  • "type": "debit",
  • "description": "string",
  • "unitPrice": 0,
  • "quantity": 0,
  • "productId": "prod_0YV7DES3WPC5J8JD8QTVNZBZNZ",
  • "periodStartTime": "2019-08-24T14:15:22Z",
  • "periodEndTime": "2019-08-24T14:15:22Z",
  • "periodNumber": 0
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "type": "debit",
  • "description": "string",
  • "unitPrice": 0,
  • "quantity": 0,
  • "price": 0,
  • "productId": "prod_0YV7DES3WPC5J8JD8QTVNZBZNZ",
  • "discountAmount": 0,
  • "periodStartTime": "2019-08-24T14:15:22Z",
  • "periodEndTime": "2019-08-24T14:15:22Z",
  • "periodNumber": 0,
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "tax": {
    },
  • "_links": [
    ],
  • "_embedded": {
    }
}