title: Using Square API, how do I get my orders to appear in the Sandbox Dashboard?
body: <p>The following code seems to work in producing an order. In the API explorer, I can Batch Retrieve Order by that order ID and I get the right response but It doesn't show up in my Sandbox dashboard. I'm definitely using my sandbox credentials and my env has PROD set to false.</p>
  
  <p>How do I get orders to appear in my Sandbox (and eventually the production) Dashboard?</p>
  
  <pre><code>require 'vendor/autoload.php';
  
  # dotenv is used to read from the '.env' file created for credentials
  $dotenv = Dotenv\Dotenv::create(__DIR__);
  $dotenv-&gt;load();
  
  
  # The access token to use in all Connect API requests. Use your *sandbox* access
  # token if you're just testing things out.
  $access_token = ($_ENV["USE_PROD"] == 'true')  ?  $_ENV["PROD_ACCESS_TOKEN"]
                                                 :  $_ENV["SANDBOX_ACCESS_TOKEN"];
  
  $location_id = ($_ENV["USE_PROD"] == 'true')  ?  $_ENV["PROD_LOCATION_ID"]
                                                 :  $_ENV["SANDBOX_LOCATION_ID"];     
  
  # Set 'Host' url to switch between sandbox env and production env
  # sandbox: https://connect.squareupsandbox.com
  # production: https://connect.squareup.com
  $host_url = ($_ENV["USE_PROD"] == 'true')  ?  "https://connect.squareup.com"
                                             :  "https://connect.squareupsandbox.com";
  
  $api_config = new \SquareConnect\Configuration();
  $api_config-&gt;setHost($host_url);
  
  # Initialize the authorization for Square
  $api_config-&gt;setAccessToken($access_token);
  $api_client = new \SquareConnect\ApiClient($api_config);
  
  if ($_SERVER['REQUEST_METHOD'] != 'POST') {
    error_log("Received a non-POST request");
    echo "Request not allowed";
    http_response_code(405);
    return;
  }
  
  $order_api = new \SquareConnect\Api\OrdersApi($api_client);
  
  $price = new \SquareConnect\Model\Money;
  $price-&gt;setAmount(600);
  $price-&gt;setCurrency('USD');
  
  $item = new \SquareConnect\Model\OrderLineItem;
  $item-&gt;setName('Item');
  $item-&gt;setQuantity('2');
  $item-&gt;setBasePriceMoney($price);
  
  $customer = new \SquareConnect\Model\OrderFulfillmentRecipient;
  $customer-&gt;setDisplayName('John');
  
  $pickup_details = new \SquareConnect\Model\OrderFulfillmentPickupDetails;
  $pickup_details-&gt;setRecipient($customer);
  $pickup_details-&gt;setPickupAt('2020-01-26T02:25:34Z');
  
  $pickup = new \SquareConnect\Model\OrderFulfillment;
  $pickup-&gt;setUid(uniqid());
  $pickup-&gt;setState('PROPOSED');
  $pickup-&gt;setType('PICKUP');
  $pickup-&gt;setPickupDetails($pickup_details);
  
  $lineItems = array();
  array_push($lineItems, $item);
  
  $fullfillment = array();
  array_push($fullfillment, $pickup);
  
  $order = new \SquareConnect\Model\Order;
  $order-&gt;setLineItems($lineItems);
  $order-&gt;setFulfillments($fullfillment);
  
  $request = new \SquareConnect\Model\CreateOrderRequest();
  $request-&gt;setIdempotencyKey(uniqid()); //uniqid() generates a random string.
  $request-&gt;setOrder($order);
  
  try {
      $result = $order_api-&gt;createOrder($location_id, $request);
      print_r($result);
  }
  catch (Exception $e) {
      echo '&lt;pre&gt;';
      echo 'Exception when calling OrdersApi-&gt;createOrder:', $e-&gt;getMessage(), PHP_EOL;
  }
  </code></pre>
  
  <p>Using the Order ID created from that POST I receive the following response in Square's API explorer.
  The order info and fulfillment details are correct. It doesn't appear in the Sandbox dashboard. What am I missing to make this happen?</p>
  
  <pre><code>{
    "orders": [
      {
        "id": "--Unique Order ID--",
        "location_id": "--My Location ID--",
        "line_items": [
          {
            "uid": "--Unique Item id--",
            "quantity": "2",
            "name": "Item",
            "base_price_money": {
              "amount": 600,
              "currency": "USD"
            },
            "gross_sales_money": {
              "amount": 1200,
              "currency": "USD"
            },
            "total_tax_money": {
              "amount": 0,
              "currency": "USD"
            },
            "total_discount_money": {
              "amount": 0,
              "currency": "USD"
            },
            "total_money": {
              "amount": 1200,
              "currency": "USD"
            },
            "variation_total_price_money": {
              "amount": 1200,
              "currency": "USD"
            }
          }
        ],
        "fulfillments": [
          {
            "uid": "--Unique fulfillment ID--",
            "type": "PICKUP",
            "state": "PROPOSED",
            "pickup_details": {
              "pickup_at": "2020-01-26T02:25:34.000Z",
              "recipient": {
                "display_name": "John"
              }
            }
          }
        ],
        "created_at": "2020-05-20T21:55:46.677Z",
        "updated_at": "2020-05-20T21:55:46.677Z",
        "state": "OPEN",
        "version": 1,
        "total_tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_discount_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_tip_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_money": {
          "amount": 1200,
          "currency": "USD"
        },
        "total_service_charge_money": {
          "amount": 0,
          "currency": "USD"
        },
        "net_amounts": {
          "total_money": {
            "amount": 1200,
            "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"
          }
        },
        "source": {
          "name": "Sandbox for --My Sandbox Id-- "
        }
      }
    ]
  }
  </code></pre>