Newbie question: Does the invoice.created subscription include item SKU's?

I’m doing some investigation to see if we can use the webhooks subscriptions to synchronize a Square POS terminal with our inventory system. We want to know when we make a sale, what SKUs and how many we have sold and what transaction ID’s they belong to. I’ve set up a endpoint in webhook.site and I’m sending test event data to inspect it but I’m not seeing any order details. All I see is header information. Is that just because it’s test data? What events include the sale of SKUs?

{
“merchant_id”: “MLEEN14GDS67J”,
“location_id”: “ES0RJRZYEC39A”,
“type”: “invoice.created”,
“event_id”: “9cfeaac8-d5db-4baa-943d-58b50889c3b5”,
“created_at”: “2022-12-01T23:14:17.587646532Z”,
“data”: {
“type”: “invoice”,
“id”: “inv:0-ChCHu2mZEabLeeHahQnXDjZQECY”,
“object”: {
“invoice”: {
“accepted_payment_methods”: {
“bank_account”: false,
“buy_now_pay_later”: false,
“card”: true,
“square_gift_card”: false
},
“created_at”: “2020-06-18T17:45:13Z”,
“custom_fields”: [
{
“label”: “Event Reference Number”,
“placement”: “ABOVE_LINE_ITEMS”,
“value”: “Ref. #1234
},
{
“label”: “Terms of Service”,
“placement”: “BELOW_LINE_ITEMS”,
“value”: “The terms of service are…”
}
],
“delivery_method”: “EMAIL”,
“description”: “We appreciate your business!”,
“id”: “inv:0-ChCHu2mZEabLeeHahQnXDjZQECY”,
“invoice_number”: “inv-100”,
“location_id”: “ES0RJRZYEC39A”,
“order_id”: “CAISENgvlJ6jLWAzERDzjyHVybY”,
“payment_requests”: [
{
“automatic_payment_source”: “NONE”,
“computed_amount_money”: {
“amount”: 10000,
“currency”: “USD”
},
“due_date”: “2030-01-24”,
“reminders”: [
{
“message”: “Your invoice is due tomorrow”,
“relative_scheduled_days”: -1,
“status”: “PENDING”,
“uid”: “beebd363-e47f-4075-8785-c235aaa7df11”
}
],
“request_type”: “BALANCE”,
“tipping_enabled”: true,
“total_completed_amount_money”: {
“amount”: 0,
“currency”: “USD”
},
“uid”: “2da7964f-f3d2-4f43-81e8-5aa220bf3355”
}
],
“primary_recipient”: {
“customer_id”: “JDKYHBWT1D4F8MFH63DBMEN8Y4”,
“email_address”: “[email protected]”,
“family_name”: “Earhart”,
“given_name”: “Amelia”,
“phone_number”: “1-212-555-4240”
},
“sale_or_service_date”: “2030-01-24”,
“scheduled_at”: “2030-01-13T10:00:00Z”,
“status”: “DRAFT”,
“store_payment_method_enabled”: false,
“timezone”: “America/Los_Angeles”,
“title”: “Event Planning Services”,
“updated_at”: “2020-06-18T17:45:13Z”,
“version”: 0
}
}
}
}

With Square the itemized details of what was sold are in the order. You’ll want to take the order_id and call RetrieveOrder to get all the itemized information. Or subscribe to the orders webhooks. :slightly_smiling_face:

Thanks for the feedback Bryan! I have some follow-up questions:

I checked the orders.created webhook as you pointed and the example payload looks like this:

{
  "merchant_id": "5S9MXCS9Y99KK",
  "type": "order.created",
  "event_id": "116038d3-2948-439f-8679-fc86dbf80f69",
  "created_at": "2020-04-16T23:14:26.129Z",
  "data": {
    "type": "order",
    "id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY",
    "object": {
      "order_created": {
        "created_at": "2020-04-16T23:14:26.129Z",
        "location_id": "FPYCBCHYMXFK1",
        "order_id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY",
        "state": "OPEN",
        "version": 1
      }
    }
  }
}

I’m not seeing any of the itemized details in this payload example. Is that because this order does not have any or because it’s in another webhook subscription? I checked the order.fulfillment.updated as well and it doesn’t include it in the example either. Is it just that these examples aren’t including those details and normally my orders would? Sorry for being repetitive, I just want to make sure this will give us the information we need.

Ah yes, the order webhook won’t contain the itemized order. You’ll need to call the API to get that information. :slightly_smiling_face:

Thank you for clarifying. I have one more follow-up question:

Since we can only get the information from the API, what’s the standard practice for getting the information on these events in real-time? When a webhook event occurs, do people then use the API from their own endpoint to then get the order details?

Yes, that’s correct. Once they receive an event they’ll then take the necessary IDs and make various API call to Square to get any additional information from our endpoints. :slightly_smiling_face: