Addresses
Get Countries List
GET https://api-b2b.bigcommerce.com/api/v2/companies/addresses/countriesRequest
Returns a list of all countries and, if applicable, their states. The response includes the name and code of each returned element and the id of each country.
NOTE: Due to the size of the list returned, the results should be cached for continued use, if possible.
Equivalent Storefront GraphQL API Query: countries
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- storeHash in query - stringrequiredThe unique alphanumeric store hash for the BigCommerce store.
example
Response
Body
codenumber
Default: 200
dataobject
example
Get Address Edit Permission
GET https://api-b2b.bigcommerce.com/api/v2/companies/addresses/permissionRequest
Checks whether or not the storefront allows Company users to modify addresses. This corresponds with the Address book management settings in the B2B Edition control panel. See B2B Edition Settings in the Help Center to learn more.
Equivalent Storefront GraphQL API Query: addressConfig
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
example
Response
Body
codenumber
Default: 200
dataobject
example
Get a Company Address List
GET https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/addressesRequest
Returns the billing and shipping addresses associated with a particular Company account.
Equivalent Storefront GraphQL API Query: addresses
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
example
Response
Body
codenumber
Default: 200
dataobject
200 - SUCCESS
Create a Company Address
POST https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/addressesRequest
Creates an address for a Company account, if address book management is enabled for your storefront. You can designate whether the address is for shipping, billing, or both.
Equivalent Storefront GraphQL API Mutation: addressCreate
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
Body
firstNamestring
requiredThe first name of the address.Example: MarieisShippingstring
Indicates whether the address can be used as a shipping address.Example: 1isBillingstring
Indicates whether the address can be used as a billing address.Example: 1phoneNumberstring
The phone number associated with the address.Example: 8001234567addressLine1string
requiredThe first line of the addressExample: 11305 Four Points DriveaddressLine2string
The second line of the addressExample: Building 2citystring
requiredCity of the address.Example: AustinzipCodestring
Zip or Postal Code of the address.Example: 78726stateobject
State of the address as an object with both the name and the two-character code.countryobject
requiredCountry of the address as an object with both the name and the two-character code.isDefaultShippingstring
Indicates whether the address is the default shipping address for the Company account.Example: 1isDefaultBillingstring
Indicates whether the address is the default billing address for the Company account.Example: 1labelstring
The label used on the storefront to identify the address.Example: Austin WarehouseextraFieldsarray[object]
Create an Address
Response
Body
codenumber
Default: 200
dataobject
example
Search Company Addresses
GET https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/addresses/searchesRequest
Returns all addresses associated with a Company account that match the query string q
Equivalent Storefront GraphQL API Query: addresses
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
- q in query - stringThe search string for the request.
- limit in query - stringrequiredThe total number of items per page of the response.
- offset in query - stringrequiredThe number of items to skip before the current page of the response.
example
Response
Body
codenumber
Default: 200
dataobject
example
Search Addresses with Multiple Filters
POST https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/addresses/searchesRequest
Returns one or more Company addresses based on the filter parameters. You can use this to make refined searches, such as locating a particular address by its label or viewing all addresses in a specific country.
Equivalent Storefront GraphQL API Query: addresses
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
Body
filtersobject
offsetnumber
Pagination offset for the results.limitnumber
Pagination limit for the results.Example: 10qstring
The search string for the request. Its value determines the results returned by the request.Example: United States
example
Response
Body
codenumber
Default: 200
dataobject
Search Addresses
Get an Address
GET https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/addresses/{addressId}Request
Returns a specific address based on the companyId
and addressId
in the path.
Equivalent Storefront GraphQL API Query: address. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
- addressId in path - stringrequiredThe unique ID of the address.
example
Response
Body
codenumber
Default: 200
dataobject
Extra Field ValuesExample: {"extraFields":[{"fieldName":"string","fieldValue":"string"}]}
Create an Address
Update Address Information
PUT https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/addresses/{addressId}Request
Updates the details of a billing or shipping address, if address book management is enabled for your storefront.
Equivalent Storefront GraphQL API Mutation: addressUpdate
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
- addressId in path - stringrequiredThe unique ID of the address.
Body
firstNamestring
requiredThe first name of the address.Example: MarieisShippingstring
requiredIndicates whether the address can be used as a shipping address.Example: 1isBillingstring
requiredIndicates whether the address can be used as a billing address.Example: 1phoneNumberstring
requiredThe phone number associated with the address.Example: 8001234567addressLine1string
requiredThe first line of the addressExample: 11305 Four Points DriveaddressLine2string
requiredThe second line of the addressExample: Building 2citystring
requiredCity of the address.Example: AustinzipCodestring
requiredZip or Postal Code of the address.Example: 78726stateobject
requiredState of the address as an object with both the name and the two-character code.countryobject
requiredCountry of the address as an object with both the name and the two-character code.addressIdstring
requiredThe unique ID of the address.Example: 27lastNamestring
requiredThe last name of the address.Example: CurieisDefaultShippingstring
requiredIndicates whether the address is the default shipping address for the Company account.Example: 1isDefaultBillingstring
requiredIndicates whether the address is the default billing address for the Company account.Example: 1labelstring
requiredThe label used on the storefront to identify the address.Example: Austin WarehouseextraFieldsarray[object]
Create an Address
Response
Body
codenumber
Default: 200
dataobject
example
Mark an Address as Active or Inactive
PUT https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/addresses/{addressId}/activationRequest
Specifies whether or not a Company account can use a particular address on quotes or at checkout.
Equivalent Storefront GraphQL API Mutation: addressDelete
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
- addressId in path - stringrequiredThe unique ID of the address.
Response
Body
codenumber
Default: 200
dataobject
example
Get Company Default Addresses
GET https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/default-addressesRequest
Returns a Company’s default shipping and billing addresses. Use Update Address Information to change which addresses are set as the defaults.
Equivalent Storefront GraphQL API Query: defaultBillingAddress
for the billing address and defaultShippingAddress
for the shipping address. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
example
Response
Body
codenumber
Default: 200
dataobject