Catalog non-empty, but graphical dashboard empty!

Hello,

I just played around with the API explorer on Sandbox, and performed an insertion via curl. Then, I listed the entire Catalog via the following request:

curl https://connect.squareupsandbox.com/v2/catalog/list \
  -H 'Square-Version: 2020-09-23' \
  -H 'Authorization: Bearer {{access_token}}' \
  -H 'Content-Type: application/json'

And you can see that it’s returning this example flesh-eating flower that I inserted:

{
  "objects": [
    {
      "type": "ITEM",
      "id": "AH6EYPL6MZ7H7XUA2MZ6N5EJ",
      "updated_at": "2020-10-27T14:39:08.834Z",
      "version": 1603809548834,
      "is_deleted": false,
      "present_at_all_locations": true,
      "item_data": {
        "name": "Culeothesis Necrosis",
        "description": "Will eat your face.",
        "abbreviation": "CULNEC",
        "label_color": "A52A2A",
        "available_online": true,
        "available_for_pickup": true,
        "available_electronically": true,
        "product_type": "REGULAR"
      }
    }
  ]
}

Unfortunately, as the attached image betrays, my Square Dashboard appears to not have those items stored.

I was wondering if I could have some assistance with understanding what I’m doing wrong. Thank you. For reference, my application id is sandbox-sq0idb-asFaurAJu-NjDR6QBfup_A.

Before diving too far into this, your image shows that you’re looking at your production catalog, rather than your sandbox catalog. Please be sure to launch your sandbox dashboard, as sandbox does not create catalog objects in your production dashboard. You can launch your sandbox dashboard from your apps page (https://developer.squareup.com/apps).

Also, I edited your initial post to remove the access token. I suggest you replace your access token in your dashboard as anyone that may have copied it before I redacted it now can make sandbox API calls on your account. Definitely a security risk to share your access tokens publicly, so please redact them in the future.

You’re absolutely correct about the access key. With respect to my catalog, I’m afraid I have the same problem even in the Sandbox Dashboard. I just executed a ListCatalog from the API explorer, it revealed that there are two items in my Catalog:

{
  "objects": [
    {
      "type": "ITEM",
      "id": "AH6EYPL6MZ7H7XUA2MZ6N5EJ",
      "updated_at": "2020-10-27T14:39:08.834Z",
      "version": 1603809548834,
      "is_deleted": false,
      "present_at_all_locations": true,
      "item_data": {
        "name": "Culeothesis Necrosis",
        "description": "Will eat your face.",
        "abbreviation": "CULNEC",
        "label_color": "A52A2A",
        "available_online": true,
        "available_for_pickup": true,
        "available_electronically": true,
        "product_type": "REGULAR"
      }
    },
    {
      "type": "ITEM",
      "id": "NNFRBK5RAWULWWR3FE4ML3MQ",
      "updated_at": "2020-10-27T18:57:58.372Z",
      "version": 1603825078372,
      "is_deleted": false,
      "present_at_all_locations": true,
      "item_data": {
        "name": "Culeothesis Necrosis",
        "description": "Will eat your face.",
        "abbreviation": "Cul",
        "label_color": "A52A2A",
        "available_online": true,
        "available_for_pickup": true,
        "available_electronically": true,
        "product_type": "REGULAR"
      }
    }
  ]
}

But as you can see, the relevant sandbox space is empty:

This is for an entirely new app I made, with name caliskunk, ID sandbox-sq0idb-4jMU5yV5e77-2cqM9IxHEA, connected to test account Jason - Sandbox. I tried to refresh everything in case there was something up with my app configuration.

Ah, I think it might be because there’s no item variation associated with the item. For an item to have a price etc it needs to have an item variation. If you create an item on the Square dashboard, it creates a variation for you by default (just titled “Regular”), but if you create it via the API, you’ll need to create both the item and the item variation.

Thank you for the assistance. I just did a successful curl upsert call for an item and an item variation. Indeed, if I list my entire Catalog, I get a non-empty response that has my fictional item and its variation:

{
  "objects": [
    {
      "type": "ITEM",
      "id": "CEMCYVFKN5UJDZAVN7GQGLEU",
      "updated_at": "2020-10-27T23:24:28.058Z",
      "version": 1603841068058,
      "is_deleted": false,
      "present_at_all_locations": true,
      "item_data": {
        "name": "Culeothesis Necrosis",
        "description": "It will eat your face.",
        "abbreviation": "CULNEC",
        "label_color": "8A2BE2",
        "available_online": true,
        "available_for_pickup": true,
        "available_electronically": true,
        "variations": [
          {
            "type": "ITEM_VARIATION",
            "id": "N2ABMR7PMMOO26PKEBQUYUDZ",
            "updated_at": "2020-10-27T23:24:28.058Z",
            "version": 1603841068058,
            "is_deleted": false,
            "present_at_all_locations": true,
            "item_variation_data": {
              "item_id": "CEMCYVFKN5UJDZAVN7GQGLEU",
              "name": "Brazilian Variety",
              "ordinal": 0,
              "pricing_type": "FIXED_PRICING",
              "price_money": {
                "amount": 15000,
                "currency": "USD"
              },
              "track_inventory": false,
              "inventory_alert_type": "NONE"
            }
          }
        ],
        "product_type": "REGULAR"
      }
    }
  ]
}

but my sandbox square space still seems to be empty :frowning: I logged out, logged back in, ensured that I have connected the correct app to Jason - Sandbox, nothing so far.

I see this show up for the “Default Test Account”, so looks like you were using the wrong access token. I do see it on the “Default Test Account” sandbox dashboard, to be clear.

I see it in “Default Test Account” as well. But I’m a bit confused about access tokens now. Are they not application - specific? That is, whenever I use, for example, the API Explorer, the only valid Access keys I can use are actually even offered to me in a drop down, they are the applications’. I don’t see how I can control which account’s dashboard that application shows its data in from my requests. And I have definitely connected both Jason - Sandbox and Default Test Account to the caliskunk app.

// Edit: In fact, I just did two more curl upserts of an item and a variation, and both went to Jason - Sandbox instead!

So if you go to your Developer Dashboard and choose “Sandbox”, you’ll only see one access token. This access token is tied to your “Default Test Account”. In the API explorer, this is the access token that appears in the drop down (for each application, the access tokens are all “Default Test Account”).

Now, if you go to your apps page (https://developer.squareup.com/apps), if you click on any of the other sandbox accounts, you’ll see authorizations there which have different access tokens. These can be automatically generated when you create one by leaving the “Create authorizations for all apps” option checked. Alternatively, you can go through the OAuth process to generate an access token for any of your sandbox accounts. An access token is always scoped to a single account, but many applications can have a different access token for the same account.

Got it, my curl requests are now in line with my accounts’ data. Thank you.