Create a billing statement line item
Creates a billing statement line item resource.
Endpoint
POST /billing_statement_line_items
Sample code
- curl
- Node
- PHP
- Python
- Ruby
curl --request POST --location 'https://api.payrexhq.com/billing_statement_line_items' \
-u replace_with_secret_api_key: \
--data-urlencode 'billing_statement_id=<ID of a billing statement resource>' \
--data-urlencode 'quantity=1' \
--data-urlencode 'unit_price=10000' \
--data-urlencode 'description=Product X'
const client = require('payrex-node')('insert your PayRex Secret API key.');
const billingStatementLineItem = await client.billingStatementLineItems.create({
billing_statement_id: '<ID of a billing statement resource>',
quantity: 1,
unit_price: 10000,
description: 'Product X'
});
$client = new \Payrex\PayrexClient('insert your PayRex Secret API key.');
$billingStatementLineItem = $client->billingStatementLineItems->create([
'billing_statement_id' => '<ID of a billing statement resource>',
'quantity' => 1,
'unit_price' => 10000,
'description' => 'Product X'
]);
from payrex import Client as PayrexClient
client = PayrexClient('insert your PayRex Secret API key.')
billing_statement_line_item = client.billing_statement_line_items.create(
{
'billing_statement_id': '<ID of a billing statement resource>',
'quantity': 1,
'unit_price': 10000,
'description': 'Product X'
}
)
client = Payrex::Client.new("insert your PayRex Secret API key.")
billing_statement_line_item = client.billing_statement_line_items.create(
billing_statement_id: '<ID of a billing statement resource>',
quantity: 1,
unit_price: 10000,
description: 'Product X'
)
Parameters
billing_statement_id REQUIRED
The ID of a billing statement resource. To learn more about the billing statement resource, refer here.
description REQUIRED
The description of the line item. It could be a product name or the service that you offer.
unit_price REQUIRED
The amount of the line item in a single unit.
This is a positive integer in the smallest currency unit, cents. If the line item should be ₱ 120.50, the amount should be 12050.
quantity REQUIRED
The quantity of the line item. The quantity will be multiplied by the line_item.amount to compute the final amount of the billing statement.
Returns
Returns a Billing Statement Line Item resource.