Skip to main content

Create a billing statement

Creates a billing statement resource.

To learn more about billing statements, refer to this guide.


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', 'qrph']
}
});

Parameters

customer_id REQUIRED

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


currency REQUIRED

A three-letter ISO currency code, in uppercase. As of the moment, we only support PHP.


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>"


billing_details_collection optional

Defines if the billing information fields will always show or managed by PayRex. Default value is always.


payment_settings optional

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, gcash, maya, and qrph.

If this attribute is not passed, the default payment methods of your merchant account will be used.


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.