Create a customer
Creates a customer resource.
Endpoint
POST /customers
Sample code
- curl
- Node
- PHP
- Python
- Ruby
curl --request POST --location 'https://api.payrexhq.com/customers' \
-u replace_with_secret_api_key: \
--data-urlencode 'currency=PHP' \
--data-urlencode 'name=Juan Dela Cruz' \
--data-urlencode 'email=juan@gmail.com'
const client = require('payrex-node')('insert your PayRex Secret API key.');
const customer = await client.customers.create({
currency: 'PHP',
name: 'Juan Dela Cruz',
email: 'juan@gmail.com'
});
$client = new \Payrex\PayrexClient('insert your PayRex Secret API key.');
$customer = $client->customers->create([
'currency' => 'PHP',
'name' => 'Juan Dela Cruz',
'email' => 'juan@gmail.com'
]);
from payrex import Client as PayrexClient
client = PayrexClient('insert your PayRex Secret API key.')
customer = client.customers.create(
{
'currency': 'PHP',
'name': 'Juan Dela Cruz',
'email': 'juan@gmail.com'
}
)
client = Payrex::Client.new("insert your PayRex Secret API key.")
customer = client.customers.create(
currency: 'PHP',
name: 'Juan Dela Cruz',
email: 'juan@gmail.com'
)
Parameters
currency REQUIRED
A three-letter ISO currency code in uppercase. As of the moment, we only support PHP.
name REQUIRED
The customer's name.
email REQUIRED
The customer's e-mail address.
billing_statement_prefix optional
The customer's prefix used to generate unique billing statement numbers. Allows 3-15 uppercase letters or numbers.
next_billing_statement_sequence_number optional
The sequence number used as a suffix when creating the customer's next billing statement number. Defaults to 1.
metadata optional
A set of key-value pairs you can attach to the resource. This can be useful for storing additional information about the Customer in a hash format.
Returns
Returns a Customer resource.