Country

The Country API endpoints allow fetching supported countries and their allowed currencies, payment methods and shipping methods from a store.

Gets all the Countries in a Store

GET/umbraco/commerce/storefront/api/v1/countries
Query parameters
Header parameters
Response

Success

Body
idstring (uuid)
codestring
namenullable string
defaultCurrencyCurrencyReferenceDto (object)
defaultPaymentMethodPaymentMethodReferenceDto (object)
defaultShippingMethodShippingMethodReferenceDto (object)
regionsnullable array of RegionReferenceDto (object)
Request
const response = await fetch('/umbraco/commerce/storefront/api/v1/countries', {
    method: 'GET',
    headers: {
      "Api-Key": "text",
      "Store": "text"
    },
});
const data = await response.json();
Response
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "code": "text",
    "name": "text",
    "defaultCurrency": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "code": "text"
    },
    "defaultPaymentMethod": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "alias": "text"
    },
    "defaultShippingMethod": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "alias": "text"
    },
    "regions": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "code": "text"
      }
    ]
  }
]

Gets a Country by ID or Alias

GET/umbraco/commerce/storefront/api/v1/country/{idOrAlias}
Path parameters
idOrAlias*string

The ID or the alias of the given resource

Query parameters
Header parameters
Response

Success

Body
idstring (uuid)
codestring
namenullable string
defaultCurrencyCurrencyReferenceDto (object)
defaultPaymentMethodPaymentMethodReferenceDto (object)
defaultShippingMethodShippingMethodReferenceDto (object)
regionsnullable array of RegionReferenceDto (object)
Request
const response = await fetch('/umbraco/commerce/storefront/api/v1/country/{idOrAlias}', {
    method: 'GET',
    headers: {
      "Api-Key": "text",
      "Store": "text"
    },
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "code": "text",
  "name": "text",
  "defaultCurrency": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "code": "text"
  },
  "defaultPaymentMethod": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "alias": "text"
  },
  "defaultShippingMethod": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "alias": "text"
  },
  "regions": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "code": "text"
    }
  ]
}

Gets the Currencies allowed in a Country

GET/umbraco/commerce/storefront/api/v1/country/{idOrAlias}/currencies
Path parameters
idOrAlias*string

The ID or the alias of the given resource

Query parameters
Header parameters
Response

Success

Body
idstring (uuid)
codestring
namenullable string
culturenullable string
formatTemplatenullable string
allowedCountriesnullable array of AllowedCountryDto (object)
Request
const response = await fetch('/umbraco/commerce/storefront/api/v1/country/{idOrAlias}/currencies', {
    method: 'GET',
    headers: {
      "Api-Key": "text",
      "Store": "text"
    },
});
const data = await response.json();
Response
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "code": "text",
    "name": "text",
    "culture": "text",
    "formatTemplate": "text",
    "allowedCountries": [
      {
        "country": {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "code": "text"
        }
      }
    ]
  }
]

Gets the Payment Methods allowed in a Country

GET/umbraco/commerce/storefront/api/v1/country/{idOrAlias}/paymentmethods
Path parameters
idOrAlias*string

The ID or the alias of the given resource

Query parameters
Header parameters
Response

Success

Body
idstring (uuid)
aliasstring
namenullable string
skunullable string
taxClassTaxClassReferenceDto (object)
paymentProviderAliasnullable string
pricePriceDto (object)
imageUrlnullable string
Request
const response = await fetch('/umbraco/commerce/storefront/api/v1/country/{idOrAlias}/paymentmethods', {
    method: 'GET',
    headers: {
      "Api-Key": "text",
      "Store": "text"
    },
});
const data = await response.json();
Response
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "alias": "text",
    "name": "text",
    "sku": "text",
    "taxClass": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "alias": "text"
    },
    "paymentProviderAlias": "text",
    "price": {
      "currency": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "code": "text"
      },
      "withoutTax": 0,
      "tax": 0,
      "withTax": 0,
      "formatted": {
        "withoutTax": "text",
        "tax": "text",
        "withTax": "text"
      }
    },
    "imageUrl": "text"
  }
]

Gets the Shipping Methods allowed in a Country

GET/umbraco/commerce/storefront/api/v1/country/{idOrAlias}/shippingmethods
Path parameters
idOrAlias*string

The ID or the alias of the given resource

Query parameters
Header parameters
Response

Success

Body
idstring (uuid)
aliasstring
namenullable string
skunullable string
taxClassTaxClassReferenceDto (object)
pricePriceDto (object)
imageUrlnullable string
Request
const response = await fetch('/umbraco/commerce/storefront/api/v1/country/{idOrAlias}/shippingmethods', {
    method: 'GET',
    headers: {
      "Api-Key": "text",
      "Store": "text"
    },
});
const data = await response.json();
Response
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "alias": "text",
    "name": "text",
    "sku": "text",
    "taxClass": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "alias": "text"
    },
    "price": {
      "currency": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "code": "text"
      },
      "withoutTax": 0,
      "tax": 0,
      "withTax": 0,
      "formatted": {
        "withoutTax": "text",
        "tax": "text",
        "withTax": "text"
      }
    },
    "imageUrl": "text"
  }
]

Gets the Payment Methods allowed in a Region

GET/umbraco/commerce/storefront/api/v1/country/{countryIdOrAlias}/region/{regionIdOrAlias}/paymentmethods
Path parameters
countryIdOrAlias*string

The ID or the alias of the country resource

regionIdOrAlias*string

The ID or the alias of the region resource

Query parameters
Header parameters
Response

Success

Body
idstring (uuid)
aliasstring
namenullable string
skunullable string
taxClassTaxClassReferenceDto (object)
paymentProviderAliasnullable string
pricePriceDto (object)
imageUrlnullable string
Request
const response = await fetch('/umbraco/commerce/storefront/api/v1/country/{countryIdOrAlias}/region/{regionIdOrAlias}/paymentmethods', {
    method: 'GET',
    headers: {
      "Api-Key": "text",
      "Store": "text"
    },
});
const data = await response.json();
Response
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "alias": "text",
    "name": "text",
    "sku": "text",
    "taxClass": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "alias": "text"
    },
    "paymentProviderAlias": "text",
    "price": {
      "currency": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "code": "text"
      },
      "withoutTax": 0,
      "tax": 0,
      "withTax": 0,
      "formatted": {
        "withoutTax": "text",
        "tax": "text",
        "withTax": "text"
      }
    },
    "imageUrl": "text"
  }
]

Gets the Payment Methods allowed in a Region

GET/umbraco/commerce/storefront/api/v1/country/{countryIdOrAlias}/region/{regionIdOrAlias}/paymentmethods
Path parameters
countryIdOrAlias*string

The ID or the alias of the country resource

regionIdOrAlias*string

The ID or the alias of the region resource

Query parameters
Header parameters
Response

Success

Body
idstring (uuid)
aliasstring
namenullable string
skunullable string
taxClassTaxClassReferenceDto (object)
paymentProviderAliasnullable string
pricePriceDto (object)
imageUrlnullable string
Request
const response = await fetch('/umbraco/commerce/storefront/api/v1/country/{countryIdOrAlias}/region/{regionIdOrAlias}/paymentmethods', {
    method: 'GET',
    headers: {
      "Api-Key": "text",
      "Store": "text"
    },
});
const data = await response.json();
Response
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "alias": "text",
    "name": "text",
    "sku": "text",
    "taxClass": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "alias": "text"
    },
    "paymentProviderAlias": "text",
    "price": {
      "currency": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "code": "text"
      },
      "withoutTax": 0,
      "tax": 0,
      "withTax": 0,
      "formatted": {
        "withoutTax": "text",
        "tax": "text",
        "withTax": "text"
      }
    },
    "imageUrl": "text"
  }
]

Last updated