palbaseDocs

Palbase Payments · API

PUT/payments/customers/{customer_id}

Update a payer's billing profile

Keeps a payer's billing profile whole, as given (the payer is made if it is not there). A provider that keeps a customer record of its own (Stripe) is handed the name, email, phone, billing address and — when tax_id_type names its kind — the tax number, which its invoices then carry. A tax number or an address the provider refuses is answered tax_id_invalid or billing_address_invalid, and the profile is not kept. A payer no provider has a record of yet is asked of none: its profile is handed over when its record is first made, and what the provider refuses then is told by the call that makes it (AddCustomerMethod). A provider that cannot be reached fails the change with 503 provider_unavailable; a record that is gone at its provider, or a channel whose keys its provider refuses, does not: the profile is kept here. With validate_tax_location the provider places the billing address for tax as it is written: one it cannot place answers billing_address_invalid. The profile is answered as GetCustomer reads it. Its ip, the buyer's address as the project's server names it — one address (400 invalid_buyer_ip) —, is what iyzico is told of the payer's payments that name none of their own.

Called by your server, with the project's secret key.

Path

customer_idstring · requiredThe payer's id: a user id, or any name of 1 to 128 characters the project's server gives a company or a team. Escape it as a path segment.

Request body

billing_addressobject · optionalBilling or shipping postal address.
emailstring · optionalEmail address.
idstring · optionalCustomer identifier.
ipstring · optionalBuyer IP address: one IPv4 or IPv6 address, as written — not a forwarded chain (`400 invalid_buyer_ip`). Named by the project's server (secret key) — creating a payment, confirming it, sending its Masterpass code, or keeping a payer's profile — for a buyer there with it, a payment's failures are counted against it — an IPv6 address by its /64, the network a buyer rotates through —, not against the server's own address, and iyzico is told it. A buyer's own client does not name it: what it sends is not used, and the address its request came from is. An address a payment or a profile kept before the server's own were told apart is not used: there is no telling whose it was; a profile kept again names it.
namestring · optionalGiven name.
phonestring · optionalNormalized E.164 phone number.
shipping_addressobject · optionalBilling or shipping postal address.
surnamestring · optionalFamily name.
tax_idstring · optionalNational identity or tax number.
tax_id_typestring · optionalThe kind of tax number `tax_id` is, as Stripe names them (`eu_vat`, `tr_tin`, `us_ein`…). With it the number is kept on the provider's customer and printed on its invoices; without it the number stays in the profile.
tax_id_statusstring · optionalRead only: the provider's verification of `tax_id` (Stripe: pending, verified, unverified, unavailable), asked of the provider that keeps a record of the payer as the profile is read or written. Left out with no tax number of a kind, when no provider keeps a record yet, or when the provider could not be asked in time.
validate_tax_locationboolean · optionalWrite only (UpdateCustomer): have the providers that keep a record of the payer place the billing address for tax as the profile is written (Stripe Tax's validate_location immediately). One the provider cannot place answers `billing_address_invalid` and the profile is not kept — rather than the first invoice after it being refused. Not kept with the profile; a payer no provider has a record of yet is placed when its record is made.
curl
curl -X PUT "https://<your-ref>.palbase.studio/payments/customers/<customer_id>" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"billing_address":{"city":"string","contact_name":"string","country":"string","line1":"string","line2":"string","postal_code":"string","state":"string"},"email":"string","id":"string","ip":"string","name":"string","phone":"string","shipping_address":{"city":"string","contact_name":"string","country":"string","line1":"string","line2":"string","postal_code":"string","state":"string"},"surname":"string","tax_id":"string","tax_id_type":"string","tax_id_status":"string","validate_tax_location":false}'

Responses

200OK

defaultStandard Palbase JSON error envelope (`error` and `error_description`).

Operation UpdateCustomer of payments's contract.