Skip to main content
POST
/
v2
/
invoices
/
lineItems
Create Manual Line Item
curl --request POST \
  --url https://api.paygentic.io/v2/invoices/lineItems \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "displayName": "<string>",
  "currency": "<string>",
  "quantity": 123,
  "unitPrice": 123,
  "subscriptionId": "<string>",
  "invoiceId": "<string>",
  "description": "<string>",
  "invoiceAt": "2023-11-07T05:31:56Z",
  "periodStart": "2023-11-07T05:31:56Z",
  "periodEnd": "2023-11-07T05:31:56Z",
  "idempotencyKey": "<string>"
}
'
{
  "id": "<string>",
  "subscriptionId": "<string>",
  "type": "fee",
  "status": "pending",
  "displayName": "<string>",
  "currency": "<string>",
  "periodStart": "2023-11-07T05:31:56Z",
  "periodEnd": "2023-11-07T05:31:56Z",
  "invoiceAt": "2023-11-07T05:31:56Z",
  "unitPrice": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "priceId": "<string>",
  "invoiceId": "<string>",
  "description": "<string>",
  "calculatedAt": "2023-11-07T05:31:56Z",
  "quantity": "<string>",
  "meteredQuantity": "<string>",
  "paymentTerm": "in_advance",
  "subtotal": "<string>",
  "taxesTotal": "<string>",
  "total": "<string>",
  "estimatedMeteredQuantity": "<string>",
  "estimatedSubtotal": "<string>"
}

Authorizations

Authorization
string
header
required

API key authentication

Headers

Idempotency-Key
string

Optional idempotency key. If provided, duplicate requests with the same key return the previously created item.

Maximum string length: 255

Body

application/json
displayName
string
required

Human-readable label shown on the invoice.

Required string length: 1 - 255
currency
string
required

ISO 4217 currency code (e.g., USD). Must match the subscription or invoice currency.

Required string length: 3
quantity
number
required

Number of units.

unitPrice
number
required

Price per unit as a decimal amount (e.g., 29.99 for $29.99). Can be negative for credits or adjustments.

subscriptionId
string

The subscription ID. Exactly one of subscriptionId or invoiceId must be provided.

invoiceId
string

The invoice ID to attach this item directly to. Exactly one of subscriptionId or invoiceId must be provided. The invoice must be in ACTIVE or CLOSING state.

Pattern: ^inv_[a-zA-Z0-9]+$
description
string | null

Optional longer description shown on the invoice.

Maximum string length: 1000
invoiceAt
string<date-time> | null

When to collect this item into an invoice. Defaults to now. Ignored when invoiceId is provided.

periodStart
string<date-time> | null

Start of the billing period for display purposes. Defaults to now.

periodEnd
string<date-time> | null

End of the billing period for display purposes. Defaults to now.

idempotencyKey
string | null

Optional caller-provided idempotency key. Auto-generated if not provided.

Required string length: 1 - 255

Response

Idempotent retry — returns previously created item

id
string
required

The line item ID

subscriptionId
string
required

The subscription this line item belongs to

type
enum<string>
required

The type of line item

Available options:
fee,
metered,
manual
status
enum<string>
required

Whether this item is pending or already on an invoice

Available options:
pending,
invoiced
displayName
string
required

Human-readable label shown on the invoice

currency
string
required

ISO 4217 currency code (e.g., USD)

periodStart
string<date-time>
required

Start of the billing period (inclusive)

periodEnd
string<date-time>
required

End of the billing period (exclusive)

invoiceAt
string<date-time>
required

When this line item should be collected into an invoice

unitPrice
string
required

Price per unit in invoice currency

createdAt
string<date-time>
required

When the line item was created

updatedAt
string<date-time>
required

When the line item was last updated

priceId
string | null

The price ID associated with this line item

invoiceId
string | null

The invoice ID if this item has been invoiced

description
string | null

Optional longer description

calculatedAt
string<date-time> | null

When metered quantity was last computed

quantity
string | null

Units sold. Null for metered lines until invoice close

meteredQuantity
string | null

Raw metered usage. Null for fee/manual lines

paymentTerm
enum<string> | null

Payment term for fee items. Null for metered/manual lines

Available options:
in_advance,
in_arrears
subtotal
string

quantity x unitPrice, before discounts and taxes. Defaults to '0.00' when not yet calculated

taxesTotal
string | null

Total tax amount for this line item in decimal format. Null until invoice calculation is complete

total
string

Final total after discounts and taxes. Defaults to '0.00' when not yet calculated

estimatedMeteredQuantity
string | null

Real-time estimated metered usage quantity. Only present for type=metered items during an active billing period. Null for fee/manual items or when estimation is unavailable.

estimatedSubtotal
string | null

Real-time estimated subtotal based on current metered usage. Only present for type=metered items during an active billing period. Null for fee/manual items or when estimation is unavailable.