"Your cart is empty" in Sandbox

I’m creating checkout payment links in sandbox successfully, but when I navigate to the link and preview the checkout page, it shows “Your cart is empty”. Why would that be?

Here’s the sample checkout response:

{
  "payment_link": {
    "id": "TQTN7UUHMLQEBGFN",
    "version": 1,
    "order_id": "xLXrDG1jtMLZAOrxEy6eVtsPmLJZY",
    "url": "https://sandbox.square.link/u/9PQ5QbY8",
    "long_url": "https://connect.squareupsandbox.com/v2/online-checkout/sandbox-testing-panel/MLG7DDWWYBB1V/TQTN7UUHMLQEBGFN",
    "created_at": "2023-07-05T19:19:08Z"
  },
  "related_resources": {
    "orders": [
      {
        "id": "xLXrDG1jtMLZAOrxEy6eVtsPmLJZY",
        "location_id": "LNR8WX2PQJ3QP",
        "reference_id": "None",
        "source": {
          "name": "TextJoy"
        },
        "line_items": [
          {
            "uid": "1NE68K3vBUQvuvYawexz2B",
            "name": "Latte",
            "quantity": "1",
            "catalog_object_id": "FG3EVAMYSIR4WEGQY5ZBO4JR",
            "catalog_version": 1681401955233,
            "variation_name": "16 oz",
            "item_type": "ITEM",
            "modifiers": [
              {
                "uid": "0sG1eLP0q0FRO6jXLt84CD",
                "catalog_object_id": "E4UNF56EBVUQQZUGI3PRA6NO",
                "catalog_version": 1681401955233,
                "name": "Oat Milk",
                "quantity": "1",
                "base_price_money": {
                  "amount": 50,
                  "currency": "USD"
                },
                "total_price_money": {
                  "amount": 50,
                  "currency": "USD"
                }
              }
            ],
            "base_price_money": {
              "amount": 500,
              "currency": "USD"
            },
            "variation_total_price_money": {
              "amount": 500,
              "currency": "USD"
            },
            "gross_sales_money": {
              "amount": 550,
              "currency": "USD"
            },
            "total_tax_money": {
              "amount": 0,
              "currency": "USD"
            },
            "total_discount_money": {
              "amount": 0,
              "currency": "USD"
            },
            "total_money": {
              "amount": 550,
              "currency": "USD"
            },
            "total_service_charge_money": {
              "amount": 0,
              "currency": "USD"
            }
          }
        ],
        "fulfillments": [
          {
            "uid": "TBQwTX83wJBGCbprMr2dJD",
            "type": "PICKUP",
            "state": "PROPOSED",
            "pickup_details": {
              "recipient": {
                "display_name": "Customer",
                "phone_number": "None"
              },
              "schedule_type": "ASAP",
              "pickup_at": "2023-07-05T19:24:07.725Z",
              "prep_time_duration": "PT5M"
            }
          }
        ],
        "net_amounts": {
          "total_money": {
            "amount": 550,
            "currency": "USD"
          },
          "tax_money": {
            "amount": 0,
            "currency": "USD"
          },
          "discount_money": {
            "amount": 0,
            "currency": "USD"
          },
          "tip_money": {
            "amount": 0,
            "currency": "USD"
          },
          "service_charge_money": {
            "amount": 0,
            "currency": "USD"
          }
        },
        "created_at": "2023-07-05T19:19:07.733Z",
        "updated_at": "2023-07-05T19:19:07.733Z",
        "state": "DRAFT",
        "version": 1,
        "total_money": {
          "amount": 550,
          "currency": "USD"
        },
        "total_tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_discount_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_tip_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_service_charge_money": {
          "amount": 0,
          "currency": "USD"
        },
        "net_amount_due_money": {
          "amount": 550,
          "currency": "USD"
        }
      }
    ]
  }
}

I figured this out. The order.fulfillments.pickup_details.phone_number was None.

For some reason, filling that out gets rid of the “Your cart is empty” message.

Thanks for bringing this to our attention. I don’t believe that should be a blocker. I’m checking with the team cause I was able to replicate. :slightly_smiling_face:

1 Like

Hey Bryan, I’m getting the “Your cart is empty” message for all CreatePaymentLink requests.

Here’s a very basic request:

result = client.checkout.create_payment_link(
  body = {
    "order": {
      "location_id": "LNR8WX2PQJ3QP",
      "line_items": [
        {
          "quantity": "1",
          "catalog_object_id": "FG3EVAMYSIR4WEGQY5ZBO4JR"
        }
      ]
    }
  }
)

Payment link and order are created successfully:

{
  "payment_link": {
    "id": "UIH3IMSF5GBE6EZD",
    "version": 1,
    "order_id": "x37UOTn0xDD0L6EDzAuT9DvI0E7YY",
    "url": "https://sandbox.square.link/u/nrZoLP2i",
    "long_url": "https://connect.squareupsandbox.com/v2/online-checkout/sandbox-testing-panel/MLG7DDWWYBB1V/UIH3IMSF5GBE6EZD",
    "created_at": "2023-11-01T14:23:57Z"
  },
  "related_resources": {
    "orders": [
      {
        "id": "x37UOTn0xDD0L6EDzAuT9DvI0E7YY",
        "location_id": "LNR8WX2PQJ3QP",
        "source": {
          "name": "Sandbox for sq0idp-KshCgzZLurzTGtlvuR4Eaw"
        },
        "line_items": [
          {
            "uid": "hDxHTfWBeUwABPY5VNXEX",
            "name": "Latte",
            "quantity": "1",
            "catalog_object_id": "FG3EVAMYSIR4WEGQY5ZBO4JR",
            "catalog_version": 1697214751535,
            "variation_name": "Small, Hot",
            "item_type": "ITEM",
            "base_price_money": {
              "amount": 480,
              "currency": "USD"
            },
            "variation_total_price_money": {
              "amount": 480,
              "currency": "USD"
            },
            "gross_sales_money": {
              "amount": 480,
              "currency": "USD"
            },
            "total_tax_money": {
              "amount": 0,
              "currency": "USD"
            },
            "total_discount_money": {
              "amount": 0,
              "currency": "USD"
            },
            "total_money": {
              "amount": 480,
              "currency": "USD"
            },
            "total_service_charge_money": {
              "amount": 0,
              "currency": "USD"
            }
          }
        ],
        "fulfillments": [
          {
            "uid": "JjMKkgs0dJsh44t8dwKTm",
            "type": "DIGITAL",
            "state": "PROPOSED"
          }
        ],
        "net_amounts": {
          "total_money": {
            "amount": 480,
            "currency": "USD"
          },
          "tax_money": {
            "amount": 0,
            "currency": "USD"
          },
          "discount_money": {
            "amount": 0,
            "currency": "USD"
          },
          "tip_money": {
            "amount": 0,
            "currency": "USD"
          },
          "service_charge_money": {
            "amount": 0,
            "currency": "USD"
          }
        },
        "created_at": "2023-11-01T14:23:56.551Z",
        "updated_at": "2023-11-01T14:23:56.551Z",
        "state": "DRAFT",
        "version": 1,
        "total_money": {
          "amount": 480,
          "currency": "USD"
        },
        "total_tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_discount_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_tip_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_service_charge_money": {
          "amount": 0,
          "currency": "USD"
        },
        "net_amount_due_money": {
          "amount": 480,
          "currency": "USD"
        }
      }
    ]
  }
}

But navigating to the payment link url shows “Your cart is empty”

I tried adding the fulfillment details as mentioned in my earlier post, but still got the same message.

Also, this seems to only affect Sandbox.

Thanks for bringing this to our attention. The team is working on a fix. :slightly_smiling_face: