Skip to content

Billing Statement Line Items

Manage individual line items on a billing statement. Line items can only be added, updated, or deleted while the billing statement is in draft status. Once finalized to open, line items are locked.

Amounts in Cents

All monetary amounts are in cents (the smallest currency unit). For example, 10000 = ₱100.00.

Create a Line Item

php
use LegionHQ\LaravelPayrex\Facades\Payrex;

$lineItem = Payrex::billingStatementLineItems()->create([
    'billing_statement_id' => 'bstm_xxxxx', // Required
    'description' => 'Web Development Services — March 2026', // Required
    'unit_price' => 2500000,            // Required. Amount in cents (₱25,000.00)
    'quantity' => 1,                    // Required
]);

Returns a Billing Statement Line Item resource.

Example Response:

json
{
    "id": "bstm_li_xxxxx",
    "resource": "billing_statement_line_item",
    "description": "Web Development Services — March 2026",
    "unit_price": 2500000,
    "quantity": 1,
    "billing_statement_id": "bstm_xxxxx",
    "livemode": false,
    "created_at": 1721726975,
    "updated_at": 1721726975
}

Parameters

ParameterTypeRequiredDescription
billing_statement_idstringYesParent billing statement ID (bstm_ prefix)
descriptionstringYesLine item description (e.g., product name or service)
unit_priceintegerYesPrice per unit in cents
quantityintegerYesNumber of units

Update a Line Item

php
use LegionHQ\LaravelPayrex\Facades\Payrex;

$lineItem = Payrex::billingStatementLineItems()->update('bstm_li_xxxxx', [
    'description' => 'Monthly Hosting (Pro Plan)',
    'unit_price' => 150000,
    'quantity' => 3,
]);

Returns a Billing Statement Line Item resource.

Example Response:

json
{
    "id": "bstm_li_xxxxx",
    "resource": "billing_statement_line_item",
    "description": "Monthly Hosting (Pro Plan)",
    "unit_price": 150000,
    "quantity": 3,
    "billing_statement_id": "bstm_xxxxx",
    "livemode": false,
    "created_at": 1721726975,
    "updated_at": 1721727100
}

Delete a Line Item

php
use LegionHQ\LaravelPayrex\Facades\Payrex;

Payrex::billingStatementLineItems()->delete('bstm_li_xxxxx');

Returns a Deleted Resource.

Example Response:

json
{
    "id": "bstm_li_xxxxx",
    "resource": "billing_statement_line_item",
    "deleted": true
}

Billing Statement Line Item Resource

FieldTypeDescription
idstringUnique identifier (bstm_li_ prefix)
resourcestringAlways billing_statement_line_item
descriptionstringLine item description
unit_priceintegerPrice per unit in cents
quantityintegerNumber of units
billing_statement_idstringParent billing statement ID
livemodebooleanLive or test mode
created_atintegerUnix timestamp
updated_atintegerUnix timestamp

Property Access

Response field names above are shown in snake_case (matching the raw API response). In PHP, access them as camelCase typed properties on the DTO — e.g., unit_price becomes $lineItem->unitPrice. See Response Data for details.

Further Reading

Released under the MIT License.