Sandbox order not showing in sandbox seller dashboard > orders

Why are my orders created with the orders Api and processed with the Create Payment endpoint of the Payments Api not showing up in my sandbox seller dashboard.?

Using the Api Explorer I have tried to manually set fulfillment status to Completed and order.status to Completed although I am prompted with an error stating these fields are already set to Completed.

At order creation I am assigning order.fullfillments: [{ type: “PICKUP”, state: “PROPOSED” }]

The order is showing up in the Transactions tab and has an order source associated with status completed.

Whats an order_id that’s not showing in the Dashboard? Also what’s your application ID? :slightly_smiling_face:

order_id: RwB7lp8K8jNhdwvi8pyPrF6GlDRZY
Application Id: sandbox-sq0idb-VRBVXN6jOZaVJ6oo5-nHOA

I also included the response from the associated payment in case that helps.

@Bryan-Square Any help here is greatly appreciated.

When you Called CreateOrder what did the request body look like? :slightly_smiling_face:

config: {
  transitional: [Object],
  adapter: [Array],
  transformRequest: [Array],
  transformResponse: [Array],
  timeout: 0,
  xsrfCookieName: 'XSRF-TOKEN',
  xsrfHeaderName: 'X-XSRF-TOKEN',
  maxContentLength: -1,
  maxBodyLength: -1,
  env: [Object],
  validateStatus: [Function: validateStatus],
  headers: [AxiosHeaders],
  method: 'post',
  data: '{"order":{"location_id":"MLKJ1DXSCCQ55","pricing_options":{"auto_apply_discounts":true},"line_items":[{"quantity":"1","catalog_object_id":"GPDRRWKBPJZETADIC3CZABL5"}],"fullfillments":[{"type":"PICKUP","state":"PROPOSED"}]}}',
  url: 'https://connect.squareupsandbox.com/v2/orders'
},

I think I had the wrong location_id, I’ve updated it to match the merchant Id returned on the authorize response although now I’m getting a 403 “Forbidden”. I have permissions scoped to “ORDERS_WRITE” & “ORDERS_READ”. Before the location Id was L4T0BV6XRKDS9.

Do you know why I’m getting a 403?

If you call ListLocations with the access token you got from OAuth do you get back the same location_id your passing in for CreateOrder? :slightly_smiling_face:

@Bryan-Square Yes it is a match.

Screen Shot 2023-11-15 at 3.21.35 PM

What base path URL was used when making the CreateOrder API call? Was it connect.squareupsandbox.com or connect.squareup.com? :slightly_smiling_face:

https://connect.squareupsandbox.com/v2/orders

Screen Shot 2023-11-15 at 5.09.44 PM

With the access token your using when you call RetrieveTokenStatus are ORDERS_READ and ORDERS_WRITE included? :slightly_smiling_face:

yeah they are

Screen Shot 2023-11-15 at 5.40.44 PM

If you try the following CURL with the access token does it work?

curl https://connect.squareupsandbox.com/v2/orders \
  -X POST \
  -H 'Square-Version: 2023-11-15' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "idempotency_key": "{{$guid}}",
  "order": {
    "location_id": "{{location_id}}",
  	"reference_id": "my-order-0001",
  	  "line_items": [
    {
      "name": "New York Strip Steak",
      "quantity": "1",
      "variation_name": "Re",
      "base_price_money": {
        "amount": 100,
        "currency": "USD"
      }
    }
  ],
  "fulfillments": [
    {
      "type": "PICKUP",
      "status": "PROPOSED",
      "pickup_details": 
      {
        "is_square_pickup_order": true,
        "recipient": 
        {
          "display_name": "Jack Dorsyss",
          "email_address": "recipient email address",
          "phone_number": "1 (234) 567 8900"
        },
        "schedule_type": "ASAP",
        "pickup_at": "2019-02-23T01:02:05+00:01",
        "pickup_window_duration": "P1W3D",
        "prep_time_duration": "P1W3D",
        "note": "OPTIONAL NOTE ABOUT THE ORDER"
      }
    }
   ]
  }
}`

:slightly_smiling_face:

still no success

That did work cause it created the order. Now you’ll need to take the order_id and pass it in with the CreatePayment request. Something like this for sandbox:

curl https://connect.squareupsandbox.com/v2/payments \
  -X POST \
  -H 'Square-Version: 2023-11-15' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "{{$guid}}",
    "autocomplete": true,
    "amount_money": {
        "amount": 100,
        "currency": "USD"
    },
    "source_id": "cnon:card-nonce-ok",
    "order_id": "{{order_id}}"
}`

:slightly_smiling_face:

The curl command is showing up in my orders.

Do you see any key value pair that might suggest why this payment response with an associated order is not showing up in my orders dashboard?

{ “payment”: { “id”: “jJIo37foTmLeoHD1tU4hjpibwsJZY”, “created_at”: “2023-11-16T17:21:52.309Z”, “updated_at”: “2023-11-16T17:21:52.495Z”, “amount_money”: { “amount”: 13678, “currency”: “USD” }, “status”: “COMPLETED”, “delay_duration”: “PT168H”, “source_type”: “CARD”, “card_details”: { “status”: “CAPTURED”, “card”: { “card_brand”: “VISA”, “last_4”: “1111”, “exp_month”: 11, “exp_year”: 2025, “fingerprint”: “sq-1-KdVkJPYh8ZLilCfAHUE8QATNgQA9A1vPgksmtCDSAekMPr6kGmG350q0Cp5dUp8hyA”, “card_type”: “CREDIT”, “prepaid_type”: “NOT_PREPAID”, “bin”: “411111” }, “entry_method”: “KEYED”, “cvv_status”: “CVV_ACCEPTED”, “avs_status”: “AVS_ACCEPTED”, “statement_description”: “SQ *NXNW-SANDBOX GOSQ.CO”, “card_payment_timeline”: { “authorized_at”: “2023-11-16T17:21:52.422Z”, “captured_at”: “2023-11-16T17:21:52.495Z” } }, “location_id”: “L4T0BV6XRKDS9”, “order_id”: “nrZ5iKcsCYg5NsEHNTC8e2cWqOTZY”, “customer_id”: “NZ2J5SZD4X4TRPY5AQKSJHWGGM”, “total_money”: { “amount”: 13678, “currency”: “USD” }, “approved_money”: { “amount”: 13678, “currency”: “USD” }, “receipt_number”: “jJIo”, “receipt_url”: “https://squareupsandbox.com/receipt/preview/jJIo37foTmLeoHD1tU4hjpibwsJZY”, “delay_action”: “CANCEL”, “delayed_until”: “2023-11-23T17:21:52.309Z”, “application_details”: { “square_product”: “ECOMMERCE_API”, “application_id”: “sandbox-sq0idb-VRBVXN6jOZaVJ6oo5-nHOA” }, “version_token”: “LcAD8g8QJca8kWVBBTN59GuC7MqF69YnzZBopdXa87Y6o” } }

@Bryan-Square I compared the orders and noticed I had a misspelling in my fulfillments key.

Glad to see that it’s all sorted. :slightly_smiling_face: