Skip to main content
POST
/
v1
/
invoice_items
Create a invoice item
curl --request POST \
  --url https://api.yorlet.com/v1/invoice_items \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 123,
  "currency": "<string>",
  "customer": "<string>",
  "description": "<string>",
  "tax_percent": 50,
  "transfer_behavior": "automatic",
  "type": "charge",
  "apply_after": 123,
  "invoice": "<string>",
  "metadata": {},
  "period_end": 123,
  "period_start": 123,
  "price": "<string>",
  "tax_rate": "<string>",
  "transfer_destination": "<string>",
  "unit": "<string>"
}
'
{
  "id": "<string>",
  "created": 123,
  "object": "invoice_item",
  "amount": 123,
  "apply_after": 123,
  "credit_amount": 123,
  "currency": "<string>",
  "customer": "<string>",
  "description": "<string>",
  "discount_amount": 123,
  "invoice": "<string>",
  "price_data": {
    "amount": 123,
    "currency": "<string>",
    "recurring": {
      "interval": "<string>",
      "interval_count": 123
    },
    "tax_percent": 50,
    "type": "recurring"
  },
  "price": "<string>",
  "proration_amount": 123,
  "tax_percent": 50,
  "total_credit_grant_amount": 123,
  "transfer_destination": "<string>",
  "type": "charge",
  "unit": "<string>",
  "account": "<string>",
  "deleted": false,
  "metadata": {},
  "transfer_behavior": "automatic"
}

Authorizations

Authorization
string
header
required

API Key authentication. Use "Bearer YOUR_API_KEY".

Body

application/json
amount
integer
required

The amount to be charged, represented as a whole integer if possible.

currency
string
required

Three-letter ISO currency code, in lowercase. Must be a supported currency.

customer
string
required

The ID of the customer the invoice item is for.

description
string
required

The description for the invoice item, to be displayed to the customer.

tax_percent
number
required

The tax percentage to use when calculating the tax amount.

Required range: 0 <= x <= 100
transfer_behavior
enum<string>
required

The invoice item transfer behavior. The default is automatic.

Available options:
automatic,
owner,
none
type
enum<string>
required

The type of the invoice item.

Available options:
charge,
rent,
product
apply_after
integer

The date after which the invoice item will be applied.

invoice
string

The ID of the invoice the invoice item is for.

metadata
object

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

period_end
integer

The end date of the invoice item.

period_start
integer

The start date of the invoice item.

price
string

The ID of the price object.

tax_rate
string

The ID of the tax rate object.

transfer_destination
string

ID of the owner that will be the transfer destination. Only allowed when the invoice item transfer behavior is owner.

unit
string | null

The ID of the unit the invoice item is for.

Response

200 - application/json

Create a invoice item

id
string
required

Unique identifier for the object.

created
number
required

Time at which the object was created. Measured in seconds since the Unix epoch.

object
enum<string>
required
Available options:
invoice_item
amount
integer
required

The amount to be charged, represented as a whole integer if possible.

apply_after
integer | null
required

The date after which the invoice item will be applied.

credit_amount
integer
required

The amount of the credit to be applied to the invoice item.

currency
string
required

Three-letter ISO currency code, in lowercase. Must be a supported currency.

customer
string
required

The ID of the customer the invoice item is for.

description
string | null
required

The description for the invoice item, to be displayed to the customer.

discount_amount
integer
required

The amount of the discount to be applied to the invoice item.

invoice
string | null
required

The ID of the invoice the invoice item is for.

Pattern: ^[a-zA-Z0-9_]+$
price_data
object
required
price
string | null
required

The ID of the price object.

Pattern: ^[a-zA-Z0-9_]+$
proration_amount
integer
required

The amount of the proration to be applied to the invoice item.

tax_percent
number
required

The tax percentage to use when calculating the tax amount.

Required range: 0 <= x <= 100
total_credit_grant_amount
integer
required

The total credit grant amount for the invoice item.

transfer_destination
string | null
required

ID of the owner that will be the transfer destination. Only allowed when the invoice item transfer behavior is owner.

type
enum<string>
required

The type of the invoice item.

Available options:
charge,
rent,
product
unit
string | null
required

The ID of the unit the invoice item is for.

Pattern: ^[a-zA-Z0-9_]+$
account
string

The account that the object belongs to. Only returned if the request is made with a valid Yorlet-Context header.

deleted
boolean
default:false

Only returned if the object has been deleted.

metadata
object

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

transfer_behavior
enum<string>
default:automatic

The invoice item transfer behavior. The default is automatic.

Available options:
automatic,
owner,
none