Addresses
Address objects represent postal addresses associated with a Customer. Each Customer can own several addresses (shipping, billing), with one address marked as the default address.
Typical use cases: pre-filling the shipping form at checkout, displaying the billing address on PDF invoices, managing a multi-site address book.
When you create an address with is_default: true, the
previous default address is automatically demoted. A Customer can have only one
default address at a time.
Endpoints
| Méthode | Endpoint | Description |
|---|---|---|
| POST | /customers/{id}/addresses/ | Add an address to a Customer |
| GET | /customers/{id}/addresses/ | List a Customer's addresses |
| GET | /customers/{id}/addresses/{addr_id}/ | Retrieve an address by its ID |
| PATCH | /customers/{id}/addresses/{addr_id}/ | Update an address |
| DELETE | /customers/{id}/addresses/{addr_id}/ | Permanently delete an address |
Object schema
Add an address
Creates a new address and associates it with the Customer identified by {id} in the URL. The address is immediately available for use in a CheckoutSession or an Invoice.
line1RequisFirst address line — street number and name, PO box, etc. Visible to the buyer on receipts and PDF invoices.
line2OptionnelAdditional address details — building, floor, apartment, industrial zone, etc.
cityRequisCity name. Displayed on billing documents and shipping labels.
stateOptionnelProvince, region, or state. Optional for countries that do not use administrative subdivisions in postal addresses.
postal_codeOptionnelPostal code. Can be null for Central African countries
where the postal system does not require one.
countryRequisCountry code in ISO 3166-1 alpha-2 format. Must correspond to a country covered by your App.
Examples: GA (Gabon), CG (Republic of the Congo), CM (Cameroon), CI (Côte d’Ivoire). Two-letter
uppercase codes are required — plain-text country names are rejected.
is_defaultOptionnelMarks this address as the Customer’s default address. If a default address already exists, it is automatically demoted.
En savoir plus
The default address is pre-selected in payment forms hosted by Sangho. It is also used as the billing address on Invoices when no address is explicitly specified.
Add an address
List addresses
Returns all addresses associated with the Customer, sorted by creation date descending. The default address appears first.
Update an address
Updates one or more fields of an existing address. Only the fields provided are modified.
line1Optionnelline2OptionnelNew additional address details. Pass null to remove the field.
cityOptionnelstateOptionnelNew province/region. Pass null to remove it.
postal_codeOptionnelNew postal code. Pass null to remove it.
countryOptionnelis_defaultOptionnelPass true to promote this address to be the default
address. The previous default address is automatically demoted.
Delete an address
Permanently deletes the address. This action is irreversible.
Unlike Products, deleting an Address is a hard delete — it cannot be restored. If the deleted address was the default address, no other address is automatically promoted: you will need to designate a new one via PATCH.
List addresses
Update an address
Delete an address