Skip to main content

Create a billing statement

Creates a billing statement resource.


Endpoint

POST /billing_statements

Sample code

const client = require('payrex-node')('insert your PayRex Secret API key.');

const billingStatement = await client.billingStatements.create({
customer_id: '<ID of a customer resource>',
payment_settings: {
payment_methods: ['gcash', 'card', 'maya']
}
});

Parameters

customer_id REQUIRED

The ID of a customer resource. To learn more about the customer resource, you can refer here.


description optional

An arbitrary string attached to the billing statement and copied over to its payment intent. This is a useful reference when viewing the payment resources associated with the billing statement from the PayRex Dashboard.

If the description is not modified, the default value is "Payment for Billing Statement <billing statement number>"


payment_settings REQUIRED

Set of key-value pairs that can modify the behavior of the payment processing for the billing statement.

Show child attributes

payment_methods array

The list of payment methods allowed to be processed by the payment intent of the billing statement. Possible values are card and gcash.


metadata optional

A set of key-value pairs you can attach to the resource. This can be useful for storing additional information about the billing statement in a hash format.

Once the billing statement is finalized, the latest value of its metadata will be copied to its payment intent.

Returns

Returns a Billing Statement resource.