Addresses
Get a Country
GET https://api-b2b.bigcommerce.com/api/v3/io/countriesRequest
Retrieves country information based on the country name or two-letter code entered in the parameters. The response can be used to provide a valid country name or code in Company addresses.
Use the searchType
parameter to specify whether you are searching by a country's name or its two-letter ISO code, and then add the appropriate value for the country to the q
parameter. This endpoint only accepts country name values in English, but you can set the searchBy
paramteter to 1
to retrieve country information with the standard ISO code instead.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- searchType in query0 - integerrequiredDetermines whether you are searching by a country's name (
0
) or its two-letter ISO code (1
).Allowed: 0 | 1
- q in query - stringrequiredThe country's name or its two-letter ISO code, depending on the specified
searchType
.Example: US (the searchType should be 1); United States (the searchType should be 0)
example
Response
Body
codenumber
requiredDefault: 200
dataobject
required
example
Get a State
GET https://api-b2b.bigcommerce.com/api/v3/io/statesRequest
Retrieves state or province information based on the state name or two-letter code entered in the parameters. The response can be used to provide a valid state name or code in Company addresses.
Use the country
parameter to specify the country associated with the queried state. If left blank, the endpoint uses the United States by default.
Note that only the countries listed below will return state or province values. When creating or updating addresses in these countries, you must include state information.
- Argentina
- Australia
- Austria
- Brazil
- Canada
- Chile
- Germany
- India
- Indonesia
- Ireland
- Italy
- Japan
- Malaysia
- Mexico
- Myanmar
- New Zealand
- Philippines
- Qatar
- Romania
- South Africa
- Spain
- Switzerland
- United Arab Emirates
- United States (default)
Use the searchType
parameter to specify whether you are searching by a state's name or its two-letter ISO code, and then add the appropriate value for the state to the q
parameter.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- searchType in query0 - integerrequiredDetermines whether you are searching by a state or province's name (
0
) or its two-letter ISO code (1
). This parameter also defines the value type for thecountry
parameter.Allowed: 0 | 1
- q in query - stringrequired
The state's name or its two-letter ISO code, depending on the specified
searchType
.Note: The state information entered for the parameter must correspond to the country specified in the
country
value.Example: TX (the searchType should be 1); Texas (the searchType should be 0) - country in query with default of US / United States - stringThe country's name or its two-letter ISO code, depending on the specified
searchType
.Example: US(the searchType should be 1), United States(the searchType should be 0)
example
Response
Body
codenumber
requiredDefault: 200
dataobject
required
example
Get All Addresses
GET https://api-b2b.bigcommerce.com/api/v3/io/addressesRequest
Retrieves a list of addresses across all Company accounts. Use the parameters to filter results by different attributes like creation date, Company account, and country.
By default, the response does not include address extra fields and values. To include this information, use the isIncludeExtraFields
parameter and provide a value of 1
.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- limit in query with default of 10 - integerDetermines the number of records to return per page. If left blank, this defaults to
10
.Example: 15 - offset in query0 - integerThe number of results to skip before returning the first result. If left blank, this defaults to
0
.Example: 5 - minModified in query - integerEnter a Unix timestamp to retrieve all addresses updated after that time.Example: 1622619778
- maxModified in query - integerEnter a Unix timestamp to retrieve all addresses updated before that time.Example: 1622619778
- minCreated in query - integerEnter a Unix timestamp to retrieve all addresses created after that time.Example: 1622619778
- maxCreated in query - integerEnter a Unix timestamp to retrieve all addresses created before that time.Example: 1622619778
- companyId in query - integerEnter the unique numeric ID of the Company account to return its addresses.Example: 123456
- isBilling in query - booleanIndicate whether you want to filter for or against billing addresses in the response.Example: true
- isShipping in query - booleanIndicate whether you want to filter for or against shipping addresses in the response.Example: true
- isIncludeExtraFields in query0 - integerIndicate whether you want to include (
1
) or exclude (0
) address extra fields in the response.Allowed: 0 | 1
- firstName in query - stringFilter for addresses with a specific first name.
- lastName in query - stringFilter for addresses with a specific last name.
- address in query - stringEnter the first or second address line to return relevant addresses.
- city in query - stringFilter for addresses from a specific city.
- country in query - stringFilter for addresses from a specific country. Use the country's full name or its two-letter ISO code.
- state in query - stringFilter for addresses from a specific state or province. Use the state's full name or its two-letter ISO code.
- zipCode in query - stringFilter for addresses from a specific postal code.
- phoneNumber in query - stringFilter for addresses with a specific phone number.
- externalId[] in query - stringFilter by an external ID assigned to addresses in a third-party system, such as an ERP.
example
Response
Body
codeinteger
requiredHTTP Response CodeDefault: 200
dataobject
required
example
Create a Company Address
POST https://api-b2b.bigcommerce.com/api/v3/io/addressesRequest
Creates an address for a Company account. Use Bulk Create Addresses to create multiple addresses in a single request.
Considerations
In addition to the minimum-required fields presented in the request body example, you may need to supply a stateName
or a stateCode
if the address is in a designated country.
If you have set one or more address extra fields as mandatory, you must include the extraFields
object in the request body. If an extra field is configured to accept only unique values, each fieldValue
must be distinct for a successful request.
You can create Company addresses without assigning them as billing or shipping addresses. However, Company users cannot use addresses at checkout without a billing or shipping designation.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
Body
firstNamestring
requiredThe first name on the address.Example: MarielastNamestring
requiredThe last name on the address.Example: CuriephoneNumberstring
The phone number on the address.Example: 512-200-1234zipCodestring
The postal code on the address.Example: 78704addressLine1string
requiredThe first line of the address.Example: 512 Bluebonnet LaneaddressLine2string
The second line of the address.Example: Building 1citystring
requiredThe city on the address.Example: AustinstateNamestring
requiredThe full name of the state or province on the address. This must correspond tostateCode
in the request if the state or province is required for the country.Example: TexascountryNamestring
requiredThe full name of the country on the address. Use Get a Country to retrieve valid country names.Example: United StatesstateCodestring
The two-letter ISO code for the state or province on the address. Omit this field when adding state or province information for an unsupported country.Example: TXcountryCodestring
The two-letter ISO code for the country on the address. Use Get a Country to retrieve valid country codes.Example: UScompanyIdinteger
requiredThe unique numeric ID of the Company account.Example: 123456isBillingboolean
Indicates whether the address is a billing address.Example: trueisShippingboolean
Indicates whether the address is a shipping address.Example: trueisDefaultBillingboolean
Indicates whether the address is the default billing address.Example: trueisDefaultShippingboolean
Indicates whether the address is the default shipping address.Example: truelabelstring
The label used on the storefront to identify the address.Example: Austin WarehouseexternalIdstring
An external ID assigned to the address in a third-party system, such as an ERP.Example: 123456extraFieldsarray[object]
Enter extra field information for the address.
Minimum-required fields
All fields
Response
Body
codeinteger
requiredDefault: 200
dataobject
required
example
Get an Address
GET https://api-b2b.bigcommerce.com/api/v3/io/addresses/{addressId}Request
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- addressId in path - stringrequiredThe unique numeric identifier of the Company address.
example
Response
Body
codeinteger
requiredDefault: 200
dataobject
required
example
Update an Address
PUT https://api-b2b.bigcommerce.com/api/v3/io/addresses/{addressId}Request
Edits details of an existing Company address.
There are no required fields for this endpoint, but you must include isBilling
or isShipping
to change the value of isDefaultBilling
or isDefaultShipping
respectively.
When changing the countryName
, you must also update the countryCode
. Updating the countryCode
by itself will automatically adjust the countryName
. If you are changing the countryCode
to a country that supports states, you must also include the stateCode
with a valid two-letter code value for the state.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- addressId in path - stringrequiredThe unique numeric identifier of the Company address.
Body
firstNamestring
The first name on the address.Example: MarielastNamestring
The last name on the address.Example: CuriephoneNumberstring
The phone number on the address.Example: 512-200-1234zipCodestring
The postal code on the address.Example: 78704addressLine1string
The first line of the address.Example: 512 Bluebonnet LaneaddressLine2string
The second line of the address.Example: Building 1citystring
The city on the address.Example: AustinstateNamestring
The full name of the state or province on the address. This must correspond tostateCode
in the request if the state or province is required for the country.Example: TexascountryNamestring
The full name of the country on the address. Use Get a Country to retrieve valid country names.Example: United StatesstateCodestring
The two-letter ISO code for the state or province on the address. Omit this field when adding state or province information for an unsupported country.Example: TXcountryCodestring
The two-letter ISO code for the country on the address. Use Get a Country to retrieve valid country codes.Example: UScompanyIdinteger
The unique numeric ID of the Company account.Example: 123456isBillingboolean
Indicates whether the address is a billing address.Example: trueisShippingboolean
Indicates whether the address is a shipping address.Example: trueisDefaultBillingboolean
Indicates whether the address is the default billing address.Example: trueisDefaultShippingboolean
Indicates whether the address is the default shipping address.Example: truelabelstring
The label used on the storefront to identify the address.Example: Austin WarehouseexternalIdstring
An external ID assigned to the address in a third-party system, such as an ERP.Example: 123456extraFieldsarray[object]
Enter extra field information for the address.
example
Response
Body
codeinteger
requiredDefault: 200
dataobject
required
example
Delete an Address
DELETE https://api-b2b.bigcommerce.com/api/v3/io/addresses/{addressId}Request
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- addressId in path - stringrequiredThe unique numeric identifier of the Company address.
example
Response
Body
codeinteger
requiredDefault: 200
dataobject
required
example
Bulk Create Addresses
POST https://api-b2b.bigcommerce.com/api/v3/io/addresses/bulkRequest
Creates multiple addresses for up to 10 addresses at a time. You can create addresses for different Company accounts in a single request by entering a different companyid
value for each address object.
See Create a Company Address for considerations related to creating one or more addresses.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
Body
firstNamestring
requiredThe first name on the address.Example: MarielastNamestring
requiredThe last name on the address.Example: CuriephoneNumberstring
The phone number on the address.Example: 512-200-1234zipCodestring
The postal code on the address.Example: 78704addressLine1string
requiredThe first line of the address.Example: 512 Bluebonnet LaneaddressLine2string
The second line of the address.Example: Building 1citystring
requiredThe city on the address.Example: AustinstateNamestring
requiredThe full name of the state or province on the address. This must correspond tostateCode
in the request if the state or province is required for the country.Example: TexascountryNamestring
requiredThe full name of the country on the address. Use Get a Country to retrieve valid country names.Example: United StatesstateCodestring
The two-letter ISO code for the state or province on the address. Omit this field when adding state or province information for an unsupported country.Example: TXcountryCodestring
The two-letter ISO code for the country on the address. Use Get a Country to retrieve valid country codes.Example: UScompanyIdinteger
requiredThe unique numeric ID of the Company account.Example: 123456isBillingboolean
Indicates whether the address is a billing address.Example: trueisShippingboolean
Indicates whether the address is a shipping address.Example: trueisDefaultBillingboolean
Indicates whether the address is the default billing address.Example: trueisDefaultShippingboolean
Indicates whether the address is the default shipping address.Example: truelabelstring
The label used on the storefront to identify the address.Example: Austin WarehouseexternalIdstring
An external ID assigned to the address in a third-party system, such as an ERP.Example: 123456extraFieldsarray[object]
Enter extra field information for the address.
Two addresses
Response
Body
codeinteger
requiredHTTP Response CodeDefault: 200
dataobject
required
Two addresses
Get Address Extra Field Configs
GET https://api-b2b.bigcommerce.com/api/v3/io/addresses/extra-fieldsRequest
Returns a list of available extra fields configurations for Company addresses.
We recommend caching the response results to avoid frequent API requests.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- offset in query0 - integerThe number of results to skip before returning the first result. If left blank, this defaults to
0
.Example: 5 - limit in query with default of 10 - integerDetermines the number of records to return per page. If left blank, this defaults to
10
.Example: 15
example
Response
Body
codeinteger
requiredDefault: 200
dataarray[object]
required