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.
billing_details optional
Show child attributes
phone string
The billing phone of the customer
address hash
Show child attribute
line1 string
The billing address Line1 of the customer
line2 string
The billing address line2 of the customer
city string
The billing address city of the customer
state string
The billing address state of the customer
postal_code string
The billing address postal code of the customer
country string
The billing address country of the customer in two-letter ISO format.
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.
To learn more about billing statements, you can check this guide.
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.