# How to manage a store (https://developer.godaddy.com/en/docs/api-users/commerce/set-up-a-store)

***

title: How to manage a store
description: Find your store ID and read store configuration — required starting points for all Commerce API calls.
agentNotes:
permissions: \[]
scopes: \["commerce.store:read"]
idempotent: true
destructive: false
failureRecovery: "Safe to retry on any error. Store reads are idempotent."
related:
apis:

* title: "Store API reference"
  href: "/docs/references/rest/stores/store"
  guides:
* title: "List sales channels"
  href: "/docs/api-users/commerce/set-up-a-store/channel"
  concepts:
* title: "Commerce core concepts"
  href: "/docs/api-users/commerce/concepts"
* title: "Authentication"
  href: "/docs/api-users/auth"
* title: "Rate limits"
  href: "/docs/api-users/rate-limits"

***

## Overview

Every Commerce API call is scoped to a store. Your store ID (`storeId`) is a UUID you copy from the platform and pass in the path for every subsequent request. This page covers reading store configuration once you have a `storeId`.

## Prerequisites

The following prerequisites are required before you can manage a store:

* a [GoDaddy Payments](https://www.godaddy.com/payments) account with an active store

  Go to [Set up a GoDaddy Payments account](https://www.godaddy.com/help/get-started-with-godaddy-payments-40721) to create your account and activate your store.
* a [Personal Access Token (PAT)](https://developer.godaddy.com/docs/api-users/auth) with the `commerce.store:read` scope
* your `storeId`

  Sign in to your GoDaddy account and go to [About the Commerce API](https://developer.godaddy.com/docs/api-users/commerce#your-stores) to retrieve your `storeId`.

## Get store by ID

`GET /v1/commerce/stores/{storeId}` retrieves the configuration for a specific store.

The following procedure reads the details of a store by ID.

1. Retrieve the details of a store by its `id`:

   ```bash tab="curl"
   curl -s "https://api.godaddy.com/v1/commerce/stores/${STORE_ID}" \
     -H "Authorization: Bearer $GODADDY_PAT"
   ```

   ```js tab="Node"
   const token = process.env.GODADDY_PAT;
   const storeId = process.env.STORE_ID;

   const res = await fetch(
     `https://api.godaddy.com/v1/commerce/stores/${storeId}`,
     { headers: { Authorization: `Bearer ${token}` } }
   );
   const store = await res.json();
   console.log(store);
   ```

   ```python tab="Python"
   import os, requests

   token = os.environ["GODADDY_PAT"]
   store_id = os.environ["STORE_ID"]

   res = requests.get(
       f"https://api.godaddy.com/v1/commerce/stores/{store_id}",
       headers={"Authorization": f"Bearer {token}"},
   )
   res.raise_for_status()
   print(res.json())
   ```

   ```go tab="Go"
   package main

   import (
       "encoding/json"
       "fmt"
       "net/http"
       "os"
   )

   func main() {
       token := os.Getenv("GODADDY_PAT")
       storeId := os.Getenv("STORE_ID")

       url := fmt.Sprintf("https://api.godaddy.com/v1/commerce/stores/%s", storeId)
       req, _ := http.NewRequest("GET", url, nil)
       req.Header.Set("Authorization", "Bearer "+token)

       res, err := http.DefaultClient.Do(req)
       if err != nil { panic(err) }
       defer res.Body.Close()

       var store map[string]any
       json.NewDecoder(res.Body).Decode(&store)
       fmt.Println(store)
   }
   ```

2. Review the response including the store ID, name, status, currency, and address:

   ```json
   {
     "id": "<STORE_UUID>",
     "name": "<STORE_DISPLAY_NAME>",
     "status": "<LIFECYCLE_STATUS>",
     "currency": "<ISO_4217_CURRENCY_CODE>",
     "timezone": "<IANA_TIMEZONE>",
     "address": {
       "line1": "<STREET_ADDRESS>",
       "city": "<CITY_NAME>",
       "state": "<STATE_OR_PROVINCE_CODE>",
       "postalCode": "<POSTAL_OR_ZIP_CODE>",
       "country": "<ISO_3166_COUNTRY_CODE>"
     },
     "createdAt": "<ISO8601_CREATED_TIMESTAMP>",
     "updatedAt": "<ISO8601_UPDATED_TIMESTAMP>"
   }
   ```

## Get store attribute

`GET /v1/commerce/stores/{storeId}/attributes/{attrName}` retrieves a single configuration attribute for a store.

The following procedure reads one attribute by name.

1. Retrieve a single attribute by name:

   ```bash tab="curl"
   ATTR_NAME="<STORE_ATTRIBUTE_NAME>"

   curl -s "https://api.godaddy.com/v1/commerce/stores/${STORE_ID}/attributes/${ATTR_NAME}" \
     -H "Authorization: Bearer $GODADDY_PAT"
   ```

   ```js tab="Node"
   const token = process.env.GODADDY_PAT;
   const storeId = process.env.STORE_ID;
   const attrName = "<STORE_ATTRIBUTE_NAME>";

   const res = await fetch(
     `https://api.godaddy.com/v1/commerce/stores/${storeId}/attributes/${attrName}`,
     { headers: { Authorization: `Bearer ${token}` } }
   );
   const attr = await res.json();
   console.log(attr);
   ```

   ```python tab="Python"
   import os, requests

   token = os.environ["GODADDY_PAT"]
   store_id = os.environ["STORE_ID"]
   attr_name = "<STORE_ATTRIBUTE_NAME>"

   res = requests.get(
       f"https://api.godaddy.com/v1/commerce/stores/{store_id}/attributes/{attr_name}",
       headers={"Authorization": f"Bearer {token}"},
   )
   res.raise_for_status()
   print(res.json())
   ```

   ```go tab="Go"
   package main

   import (
       "encoding/json"
       "fmt"
       "net/http"
       "os"
   )

   func main() {
       token := os.Getenv("GODADDY_PAT")
       storeId := os.Getenv("STORE_ID")
       attrName := "<STORE_ATTRIBUTE_NAME>"

       url := fmt.Sprintf("https://api.godaddy.com/v1/commerce/stores/%s/attributes/%s", storeId, attrName)
       req, _ := http.NewRequest("GET", url, nil)
       req.Header.Set("Authorization", "Bearer "+token)

       res, err := http.DefaultClient.Do(req)
       if err != nil { panic(err) }
       defer res.Body.Close()

       var attr map[string]any
       json.NewDecoder(res.Body).Decode(&attr)
       fmt.Println(attr)
   }
   ```

2. Review the response returning the attribute name and its current value:

   ```json
   {
     "name": "<STORE_ATTRIBUTE_NAME>",
     "value": "<STORE_ATTRIBUTE_VALUE>"
   }
   ```

## Common errors

The following table lists common errors when reading store configuration and their most likely causes:

| Status | Most likely cause                                                                                |
| ------ | ------------------------------------------------------------------------------------------------ |
| `401`  | PAT is missing or expired. Go to [Authentication](https://developer.godaddy.com/docs/api-users/auth) to generate a new token. |
| `403`  | Token doesn't include the `commerce.store:read` scope.                                           |
| `404`  | Store ID doesn't exist or isn't accessible with the provided token.                              |
| `429`  | Rate limit exceeded. Honor the `Retry-After` header before retrying.                             |
