You are viewing the documentation for the older version of our API (V1). Click here for information on upgrading to the latest version (V2).

Subscriptions can have addresses like "Shipping Address" associated with them. This is apart from the billing address as part of credit card information.

Sample address [ JSON ]

{ "addr": "PO Box 9999", "city": "Walnut", "country": "US", "first_name": "John", "label": "shipping_address", "last_name": "Doe", "object": "address", "state": "California", "state_code": "CA", "subscription_id": "__test__5SK0bLNFRFuCI4QNU", "zip": "91789" }
label
Label to identify the address. This is unique for all the address for a subscription.
string, max chars=50
first_name
First name.
optional, string, max chars=150
last_name
Last name.
optional, string, max chars=150
email
Email.
optional, string, max chars=70
company
Company name.
optional, string, max chars=250
phone
Phone number.
optional, string, max chars=50
addr
Address line 1.
optional, string, max chars=150
extended_addr
Address line 2.
optional, string, max chars=150
extended_addr2
Address line 3.
optional, string, max chars=150
city
City.
optional, string, max chars=50
state_code
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
optional, string, max chars=50
state
State or Province.
optional, string, max chars=50
country
2-letter, ISO 3166 alpha-2 country code.
optional, string, max chars=50
zip
Zip or Postal code.
optional, string, max chars=20
subscription_id
A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
string, max chars=50
Retrieves an address resource for a subscription and the specified label.
Sample Request
curl  https://{site}.chargebee.com/api/v1/addresses \
     -G  \
     -u {site_api_key}:\
     -d subscription_id="__test__5SK0bLNFRFuCI4QNU" \
     -d label="shipping_address"
copy
curl  https://{site}.chargebee.com/api/v1/addresses \
     -G  \
     -u {site_api_key}:\
     -d subscription_id="__test__5SK0bLNFRFuCI4QNU" \
     -d label="shipping_address"

Sample Response [ JSON ]

Show more...
{"address": { "addr": "PO Box 9999", "city": "Walnut", "country": "US", "first_name": "John", "label": "shipping_address", "last_name": "Doe", "object": "address", "state": "California", "state_code": "CA", "subscription_id": "__test__5SK0bLNFRFuCI4QNU", "zip": "91789" }}

URL Format GET

https://{site}.chargebee.com/api/v1/addresses
subscription_id
A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
required, string, max chars=50
label
Label to identify the address. This is unique for all the address for a subscription.
required, string, max chars=50
Resource object representing address.
always returned
Adds or replaces the address for a subscription. If an address is already present for the specified label, it will be replaced otherwise new address is added with that label.
Sample Request
curl  https://{site}.chargebee.com/api/v1/addresses \
     -u {site_api_key}:\
     -d subscription_id="__test__5SK0bLNFRFuCI7XNb" \
     -d label="shipping_address" \
     -d first_name="Benjamin" \
     -d last_name="Ross" \
     -d addr="PO Box 9999" \
     -d city="Walnut" \
     -d state="California" \
     -d zip="91789" \
     -d country="US"
copy
curl  https://{site}.chargebee.com/api/v1/addresses \
     -u {site_api_key}:\
     -d subscription_id="__test__5SK0bLNFRFuCI7XNb" \
     -d label="shipping_address" \
     -d first_name="Benjamin" \
     -d last_name="Ross" \
     -d addr="PO Box 9999" \
     -d city="Walnut" \
     -d state="California" \
     -d zip="91789" \
     -d country="US"

Sample Response [ JSON ]

Show more...
{"address": { "addr": "PO Box 9999", "city": "Walnut", "country": "US", "first_name": "Benjamin", "label": "shipping_address", "last_name": "Ross", "object": "address", "state": "California", "state_code": "CA", "subscription_id": "__test__5SK0bLNFRFuCI7XNb", "zip": "91789" }}

URL Format POST

https://{site}.chargebee.com/api/v1/addresses
subscription_id
A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
required, string, max chars=50
label
Label to identify the address. This is unique for all the address for a subscription.
required, string, max chars=50
first_name
First name.
optional, string, max chars=150
last_name
Last name.
optional, string, max chars=150
email
Email.
optional, string, max chars=70
company
Company name.
optional, string, max chars=250
phone
Phone number.
optional, string, max chars=50
addr
Address line 1.
optional, string, max chars=150
extended_addr
Address line 2.
optional, string, max chars=150
extended_addr2
Address line 3.
optional, string, max chars=150
city
City.
optional, string, max chars=50
state_code
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
optional, string, max chars=50
state
The state/province name. Is set by Chargebee automatically for US, Canada and India If state_code is provided.
optional, string, max chars=50
zip
Zip or Postal code.
optional, string, max chars=20
country
2-letter, ISO 3166 alpha-2 country code.
optional, string, max chars=50
Resource object representing address.
always returned