Sandbox order API 500

Requests to create order that were working last week are now getting 500s

curl https://connect.squareupsandbox.com/v2/orders \
  -X POST \
  -H 'Square-Version: 2023-07-20' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "58560498-844f-4130-9f87-84832e3106ea",
    "order": {
      "location_id": "L853MS00EAHB3",
      "customer_id": "CTXMC214A1A7TPRY84QDXJSSTR",
      "line_items": [
        {
          "quantity": "1",
          "catalog_object_id": "KIA33376IPHO3OC5WDYWGO24",
          "item_type": "ITEM"
        }
      ],
      "state": "OPEN",
      "reference_id": "12345"
    }
  }'

I did see a 400 once that the catalog item does not exist, but it does:

curl https://connect.squareupsandbox.com/v2/catalog/object/KIA33376IPHO3OC5WDYWGO24 \
  -H 'Square-Version: 2023-07-20' \
  -H 'Authorization: Bearer EAAAELILXYrKaABGNVtalPioQ1bxToqPoBjpG2Nv1Cw4KoyV-_5pwhC-aJfVQUKD' \
  -H 'Content-Type: application/json'

{
  "object": {
    "type": "ITEM",
    "id": "KIA33376IPHO3OC5WDYWGO24",
    "updated_at": "2023-08-01T10:23:14.15Z",
    "created_at": "2023-08-01T10:23:14.15Z",
    "version": 1690885394150,
    "is_deleted": false,
    "present_at_all_locations": true,
    "item_data": {
      "name": "CNS Down Payment",
      "is_taxable": true,
      "visibility": "PRIVATE",
      "variations": [
        {
          "type": "ITEM_VARIATION",
          "id": "672W72WB7EAZ7X67K2E6SC7N",
          "updated_at": "2023-08-01T10:23:14.15Z",
          "created_at": "2023-08-01T10:23:14.15Z",
          "version": 1690885394150,
          "is_deleted": false,
          "present_at_all_locations": true,
          "item_variation_data": {
            "item_id": "KIA33376IPHO3OC5WDYWGO24",
            "name": "Regular",
            "ordinal": 1,
            "pricing_type": "FIXED_PRICING",
            "price_money": {
              "amount": 20000,
              "currency": "USD"
            },
            "track_inventory": false,
            "sellable": true,
            "stockable": true
          }
        }
      ],
      "product_type": "REGULAR",
      "skip_modifier_screen": false
    }
  }
}

The customer exists as well:

curl https://connect.squareupsandbox.com/v2/customers/CTXMC214A1A7TPRY84QDXJSSTR \
  -H 'Square-Version: 2023-07-20' \
  -H 'Authorization: Bearer EAAAELILXYrKaABGNVtalPioQ1bxToqPoBjpG2Nv1Cw4KoyV-_5pwhC-aJfVQUKD' \
  -H 'Content-Type: application/json'

{
  "customer": {
    "id": "CTXMC214A1A7TPRY84QDXJSSTR",
    "created_at": "2023-07-28T10:57:40.701Z",
    "updated_at": "2023-07-28T10:57:40Z",
    "cards": [
      {
        "id": "ccof:CBASEOmV_5a6AucF0ThGnUi_07Y",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEMQg1thmtuUmyfDaHduUFFE",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEGdaXonRg37XyubavJGBETE",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEMbF3rtf9UMiLqxnoQ6n6-U",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEIp0RZZ3j-PuE7Jch5KNMDI",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEKrKV5gINouV8xIov3LuTj0",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 11,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEFcfuw-jjrPPKTBIKqUpn4k",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 11,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEH6VwlzBuTNZYv5tytZpefA",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEGauIvpDiKhJbZhNf1X5w1A",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEO-l_kHzpqQ0LXAAQXtDXeM",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEA0imsJ7UO6VeTchHIG-G_M",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEOX-vzOvVtS-XBeeitQdvVY",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEGFv0KTINX8V4bcYXvhh7Aw",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEGDxPlutPhY6yjbnp_-ODFk",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEOb4fREXeDrXvqjJJhtyMPI",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      },
      {
        "id": "ccof:CBASEOlzqlVwZC4f5RZDscJ96Ec",
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 12,
        "exp_year": 2023,
        "billing_address": {
          "postal_code": "19096"
        }
      }
    ],
    "given_name": "ray",
    "family_name": "courtney",
    "email_address": "[email protected]",
    "address": {
      "address_line_1": "387 montgomery ave",
      "locality": "wynnewood",
      "administrative_district_level_1": "CA",
      "postal_code": "19096",
      "country": "US"
    },
    "reference_id": "582",
    "preferences": {
      "email_unsubscribed": false
    },
    "creation_source": "THIRD_PARTY",
    "segment_ids": [
      "MLYFEFYRSH4FK.CARDS_ON_FILE",
      "MLYFEFYRSH4FK.REACHABLE"
    ],
    "version": 0
  }
}

Is there any way to get more visibility into this 500?

Quick update, order creation succeeds when I use the item variation ID instead of the item id, i.e., 672W72WB7EAZ7X67K2E6SC7N

Is this correct?

Also, why doesn’t the order appear in my seller dashboard? I see the transaction (I used the payment api to complete the order/payment).

Hi @raycionic! Yes, you’ll need to use an ITEM_VARIATION as the line item for an order, not an ITEM. I would expect that this results in a 400 error though — are you saying that your 500 errors also went away after using ITEM_VARIATION?

Orders will only appear on your Seller Dashboard if they have fulfillment details attached and have been fully paid for.

Yes, the 500 went away after I switch to the ITEM_VARIATION. However, I had tried the ITEM_VARIATION previously and it resulted in a 500. It just started working again.

The order is fully paid for via the payments API. What fulfillment details would I need to enter? This would be a purchase for which there is no actual fulfillment (I’m not shipping a product or anything).

Got it, thanks for clarifying. This seems related to time out issues that we’ve been looking into.

You can find our docs for adding fulfillments here: Order Fulfillments