Update a customer
Updates a customer resource.
Endpoint
PUT /customers/:id
Sample code
- curl
- Node
- PHP
- Python
- Ruby
curl --location 'https://api.payrexhq.com/customers/<ID of a customer resource>' \
--request PUT \
-u replace_with_secret_api_key: \
--data-urlencode 'name=John Smith' \
--data-urlencode 'email=john@gmail.com'
const client = require('payrex-node')('insert your PayRex Secret API key.');
const customer = await client.customers.update(
'<ID of a customer resource>',
{
name: 'John Smith',
email: 'john@gmail.com'
}
);
$client = new \Payrex\PayrexClient('insert your PayRex Secret API key.');
$customer = $client->customers->update(
'<ID of a customer resource>',
[
'name' => 'John Smith',
'email' => 'john@gmail.com'
]
);
from payrex import Client as PayrexClient
client = PayrexClient('insert your PayRex Secret API key.')
customer = client.customers.update(
'<ID of a customer resource>',
{
'name': 'John Smith',
'email': 'john@gmail.com'
}
)
client = Payrex::Client.new("insert your PayRex Secret API key.")
customer = client.customers.update(
'<ID of a customer resource>',
{
name: 'John Smith',
email: 'john@gmail.com'
}
)
Parameters
currency optional
A three-letter ISO currency code in uppercase. As of the moment, we only support PHP.
name optional
The customer's name.
email optional
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.