Why Gross sale recognised when payment was made?

Please look at the below order. This customer is in -07:00 timezone. Below order was created on 11/28 in their timezone but Square is recognising gross sale in their transaction report on 11/29 instead of 11/28. It has only one payment and that was received on 11/29. Also there is a no way to capture this order on 11/29 using date range of orders API as there is no order level timestamp for that day. This order can be captured only using payments API.

Why this is happening or what should be the logic to calculate gross sale to match it with transactions report in Square dashboard?

Can it be captured accurately using webhooks https://developer.squareup.com/docs/webhooks/v2webhook-events-tech-ref?

Only logic that I could think of :
If order’s source is a payment link then we need to use the first payment’s create date as order line item summary date.

Thanks in advance!

{
  "id": "rdyI3xWxk1NEtOawkrX9l2JKU4JZY",
  "locationId": "ZR5SQTPGG9760",
  "source": {
    "name": "Payment Link"
  },
  "customerId": "A7QMMRWPM10YV388AFNNNMP6X8",
  "lineItems": [
    {
      "uid": "Zn5jfc5QBwsb2sk7PtmvSD",
      "name": "Custom Amount",
      "quantity": "4",
      "itemType": "ITEM",
      "appliedTaxes": [
        {
          "uid": "61a4265646126",
          "taxUid": "4A6C2DD2-6903-46C1-AEFA-7D01C70CC25A",
          "appliedMoney": {
            "amount": "2071",
            "currency": "USD"
          }
        }
      ],
      "basePriceMoney": {
        "amount": "6000",
        "currency": "USD"
      },
      "variationTotalPriceMoney": {
        "amount": "24000",
        "currency": "USD"
      },
      "grossSalesMoney": {
        "amount": "24000",
        "currency": "USD"
      },
      "totalTaxMoney": {
        "amount": "2071",
        "currency": "USD"
      },
      "totalDiscountMoney": {
        "amount": "0",
        "currency": "USD"
      },
      "totalMoney": {
        "amount": "26071",
        "currency": "USD"
      }
    }
  ],
  "taxes": [
    {
      "uid": "4A6C2DD2-6903-46C1-AEFA-7D01C70CC25A",
      "catalogObjectId": "UUGDHKSJV6WHP7M4DPR6Q2LB",
      "catalogVersion": "1638123217355",
      "name": "Sales Tax",
      "type": "ADDITIVE",
      "percentage": "8.63",
      "appliedMoney": {
        "amount": "2071",
        "currency": "USD"
      },
      "scope": "LINE_ITEM"
    }
  ],
  "fulfillments": [
    {
      "uid": "srSQs5J3zKWNAc21Bq3YzB",
      "type": "DIGITAL",
      "state": "COMPLETED",
      "lineItemApplication": "ALL"
    }
  ],
  "netAmounts": {
    "totalMoney": {
      "amount": "29671",
      "currency": "USD"
    },
    "taxMoney": {
      "amount": "2071",
      "currency": "USD"
    },
    "discountMoney": {
      "amount": "0",
      "currency": "USD"
    },
    "tipMoney": {
      "amount": "3600",
      "currency": "USD"
    },
    "serviceChargeMoney": {
      "amount": "0",
      "currency": "USD"
    }
  },
  "tenders": [
    {
      "id": "tcH4drP3Rso431jgCRdL14Zq9daZY",
      "locationId": "ZR5SQTPGG9760",
      "transactionId": "rdyI3xWxk1NEtOawkrX9l2JKU4JZY",
      "createdAt": "2021-11-29T11:02:05Z",
      "amountMoney": {
        "amount": "29671",
        "currency": "USD"
      },
      "tipMoney": {
        "amount": "3600",
        "currency": "USD"
      },
      "processingFeeMoney": {
        "amount": "1157",
        "currency": "USD"
      },
      "type": "CARD",
      "cardDetails": {
        "status": "CAPTURED",
        "card": {
          "cardBrand": "MASTERCARD",
          "last4": "7831",
          "fingerprint": "sq-1-x0i87mg96Lm8vt4IggWDTvXd_4mjP1LfFj2Y0_aYzUSSbRXKELXd-1GFqOxS1ti6kw"
        },
        "entryMethod": "ON_FILE"
      },
      "paymentId": "tcH4drP3Rso431jgCRdL14Zq9daZY",
      "payment": {
        "id": "tcH4drP3Rso431jgCRdL14Zq9daZY",
        "createdAt": "2021-11-29T11:02:05.397Z",
        "updatedAt": "2021-11-29T11:02:10.377Z",
        "amountMoney": {
          "amount": "26071",
          "currency": "USD"
        },
        "tipMoney": {
          "amount": "3600",
          "currency": "USD"
        },
        "totalMoney": {
          "amount": "29671",
          "currency": "USD"
        },
        "approvedMoney": {
          "amount": "29671",
          "currency": "USD"
        },
        "processingFee": [
          {
            "effectiveAt": "2021-11-29T13:02:07.000Z",
            "type": "INITIAL",
            "amountMoney": {
              "amount": "1157",
              "currency": "USD"
            }
          }
        ],
        "status": "COMPLETED",
        "delayDuration": "PT168H",
        "delayAction": "CANCEL",
        "delayedUntil": "2021-12-06T11:02:05.397Z",
        "sourceType": "CARD",
        "cardDetails": {
          "status": "CAPTURED",
          "card": {
            "cardBrand": "MASTERCARD",
            "last4": "7831",
            "expMonth": "11",
            "expYear": "2025",
            "fingerprint": "sq-1-x0i87mg96Lm8vt4IggWDTvXd_4mjP1LfFj2Y0_aYzUSSbRXKELXd-1GFqOxS1ti6kw",
            "cardType": "DEBIT",
            "prepaidType": "NOT_PREPAID",
            "bin": "514759"
          },
          "entryMethod": "ON_FILE",
          "cvvStatus": "CVV_NOT_CHECKED",
          "avsStatus": "AVS_ACCEPTED",
          "authResultCode": "050205",
          "statementDescription": "SQ *HEMP SUPPLY PLUS LLC",
          "cardPaymentTimeline": {
            "authorizedAt": "2021-11-29T11:02:06.086Z",
            "capturedAt": "2021-11-29T11:02:06.442Z"
          }
        },
        "locationId": "ZR5SQTPGG9760",
        "orderId": "rdyI3xWxk1NEtOawkrX9l2JKU4JZY",
        "customerId": "A7QMMRWPM10YV388AFNNNMP6X8",
        "riskEvaluation": {
          "createdAt": "2021-11-29T11:02:06.291Z",
          "riskLevel": "MODERATE"
        },
        "receiptNumber": "tcH4",
        "receiptUrl": "https://squareup.com/receipt/preview/tcH4drP3Rso431jgCRdL14Zq9daZY",
        "applicationDetails": {
          "squareProduct": "ECOMMERCE_API",
          "applicationId": "sq0idp-w46nJ_NCNDMSOywaCY0mwA"
        },
        "versionToken": "ROdK7s2xXLRyYbQEXaIOyr3M4ahKUcNaIuyeqgU4ksU6o"
      }
    }
  ],
  "createdAt": "2021-11-29T01:01:10.318Z",
  "updatedAt": "2021-12-02T00:27:58.884Z",
  "closedAt": "2021-12-02T00:27:58.884Z",
  "state": "COMPLETED",
  "version": 8,
  "totalMoney": {
    "amount": "29671",
    "currency": "USD"
  },
  "totalTaxMoney": {
    "amount": "2071",
    "currency": "USD"
  },
  "totalDiscountMoney": {
    "amount": "0",
    "currency": "USD"
  },
  "totalTipMoney": {
    "amount": "3600",
    "currency": "USD"
  },
  "totalServiceChargeMoney": {
    "amount": "0",
    "currency": "USD"
  },
  "square_product": [
    "ECOMMERCE_API"
  ]
}

With Square the order will show on the report when the payment was taken. Looking at the payment is was taken on the 29th which is why it’s showing in that day.

Also when you say that you’re not getting the order from the API whats the query your running. All orders have timestamps. :slightly_smiling_face:

Thanks @Bryan-Square.

I looked at createdAt, closedAt and updatedAt filters between 2021-11-28T00:00:00-07:00 and 2021-11-28T23:59:59-07:00. This order will not appear between this 24 hour range but Square’s transaction report will show it under the transaction report.

@Bryan-Square Any idea what will happen if an order has multiple payments or split tenders on different days. How Square will recognise gross sale?