Create an invoice item

Creates an invoice item.

SecurityAPI Key: SecretApiKey or HTTP: 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"
description
string <= 1000 characters

Description of the invoice item.

unitPrice
required
number <double>

Unit price of the invoice item.

quantity
integer

Quantity of the invoice item.

productId
string or null <= 50 characters

ID of the product.

periodStartTime
string or null <date-time>

Date and time when the billing period starts.

periodEndTime
string or null <date-time>

Date and time when the billing period ends.

periodNumber
integer or null

Billing period number that is associated with the invoice item. For example, an invoice item for a service is included in billing period number 3. The invoice item is only applied to billing period number 3.

post
/invoices/{id}/items
Request samples
application/json
{ "type": "debit", "description": "string", "unitPrice": 0.1, "quantity": 0, "productId": "prod_0YV7DES3WPC5J8JD8QTVNZBZNZ", "periodStartTime": "2019-08-24T14:15:22Z", "periodEndTime": "2019-08-24T14:15:22Z", "periodNumber": 0, "tax": { "amount": 0.1, "description": "string" } }
Responses

201

Invoice item created.

401

Unauthorized access. Invalid credentials used.

422

Invalid data sent.

Response samples
application/json
{ "id": "ii_0YVFDEQS2KCFTBN9HXWJFY55GV", "type": "debit", "description": "string", "unitPrice": 0.1, "quantity": 0, "price": 0.1, "productId": "prod_0YV7DES3WPC5J8JD8QTVNZBZNZ", "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "discountAmount": 0.1, "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": { "amount": 0.1, "description": "string", "rate": 0, "stateAmount": 0.94, "countyAmount": 0.04, "cityAmount": 0, "specialDistrictAmount": 0.38, "stateRate": 0, "countyRate": 0, "cityRate": 0, "specialDistrictRate": 0, }, "_links": [ ], "_embedded": { "product": { }, "plan": { } } }