Gross sale calculation in transactions report and orders API is different

Gross sale should be calculated as $7.24 for below order but Square transactions report is showing it as $1.81. How is this number is calculated?

Below is how it looks in the transaction report extracted from Square.

Date: 6/29/2021 8:45:40 Pacific Time (US & Canada)
Gross sale: $ 1.81
Discount: $ 0.00
Service charge: $ 0.00
Net sales: $1.81
Gift card sales: $0.00
Tax: $0.00
Tip: $1.00
Partial refund: $0.00
total collected: $2.81
Transaction id: VMUH7w56sjMjudCB06CoyUueV
Transaction Status: (**looks weird in Square report**) {:PENDING=>"Awaiting Capture", :BOOKED=>"Complete", :FAILED=>"Failed", :CANCELED=>"Canceled", :VOIDED=>"Voided", :OPEN=>"Partially Paid"}

Below is how order looks in the order API.

{
  "id": "VMUH7w56sjMjudCB06CoyUueV",
  "locationId": "LPN6RY8R6K7WK",
  "lineItems": [
   {
    "uid": "39961804-f3fc-4f9a-bbe3-adc8b2514f5d",
    "name": "Kids Dots",
    "quantity": "1",
    "catalogObjectId": "JAUNX7466H4VXOKRYPXFELEG",
    "catalogVersion": 1649705317739,
    "variationName": "Kids Dots",
    "itemType": "ITEM",
    "modifiers": [
     {
      "uid": "afd23eab-882d-4bf6-9a68-9288e3288e96",
      "catalogObjectId": "VD7SVJFKOFM7266J2BACJIVW",
      "catalogVersion": 1654021833084,
      "name": "Cookies & Cream",
      "quantity": "1",
      "basePriceMoney": {
       "amount": 0,
       "currency": "USD"
      },
      "totalPriceMoney": {
       "amount": 0,
       "currency": "USD"
      }
     },
     {
      "uid": "4d081ffb-5888-4bf5-9009-05c90574a30d",
      "catalogObjectId": "UDWPTKKQ4VS2DLZ4VG3ZBYX2",
      "catalogVersion": 1654021833084,
      "name": "$.25 City Disposable Cup Fee",
      "quantity": "1",
      "basePriceMoney": {
       "amount": 25,
       "currency": "USD"
      },
      "totalPriceMoney": {
       "amount": 25,
       "currency": "USD"
      }
     }
    ],
    "appliedDiscounts": [
     {
      "uid": "df268a80-7c63-46e8-a135-8b4bf31cf051",
      "discountUid": "df268a80-7c63-46e8-a135-8b4bf31cf051",
      "appliedMoney": {
       "amount": 362,
       "currency": "USD"
      }
     }
    ],
    "basePriceMoney": {
     "amount": 699,
     "currency": "USD"
    },
    "variationTotalPriceMoney": {
     "amount": 699,
     "currency": "USD"
    },
    "grossSalesMoney": {
     "amount": 724,
     "currency": "USD"
    },
    "totalTaxMoney": {
     "amount": 0,
     "currency": "USD"
    },
    "totalDiscountMoney": {
     "amount": 362,
     "currency": "USD"
    },
    "totalMoney": {
     "amount": 362,
     "currency": "USD"
    }
   }
  ],
  "discounts": [
   {
    "uid": "df268a80-7c63-46e8-a135-8b4bf31cf051",
    "catalogObjectId": "44XAK42BBLTFMSSVTRAI4DAR",
    "catalogVersion": 1614111954653,
    "name": "Whiting's Foods Employee",
    "type": "FIXED_PERCENTAGE",
    "percentage": "50",
    "appliedMoney": {
     "amount": 362,
     "currency": "USD"
    },
    "scope": "ORDER"
   }
  ],
  "returnAmounts": {
   "totalMoney": {
    "amount": 0,
    "currency": "USD"
   },
   "taxMoney": {
    "amount": 0,
    "currency": "USD"
   },
   "discountMoney": {
    "amount": 0,
    "currency": "USD"
   },
   "tipMoney": {
    "amount": 0,
    "currency": "USD"
   },
   "serviceChargeMoney": {
    "amount": 0,
    "currency": "USD"
   }
  },
  "netAmounts": {
   "totalMoney": {
    "amount": 662,
    "currency": "USD"
   },
   "taxMoney": {
    "amount": 0,
    "currency": "USD"
   },
   "discountMoney": {
    "amount": 362,
    "currency": "USD"
   },
   "tipMoney": {
    "amount": 300,
    "currency": "USD"
   },
   "serviceChargeMoney": {
    "amount": 0,
    "currency": "USD"
   }
  },
  "tenders": [
   {
    "id": "Je14oj6cetouyt4gdaoyOvqovaB",
    "locationId": "LPN6RY8R6K7WK",
    "transactionId": "VMUH7w56sjMjudCB06CoyUueV",
    "createdAt": "2022-06-30T01:45:11Z",
    "amountMoney": {
     "amount": 381,
     "currency": "USD"
    },
    "tipMoney": {
     "amount": 200,
     "currency": "USD"
    },
    "processingFeeMoney": {
     "amount": 0,
     "currency": "USD"
    },
    "type": "CARD",
    "cardDetails": {
     "status": "FAILED",
     "card": {
      "cardBrand": "VISA",
      "last4": "6379",
      "fingerprint": "sq-1-ngjZxAaYih1re5PYAltb-8MdOi4YIKxpuvlcf90bRdMYmXt-eahjxgX25hiLOIxmng"
     },
     "entryMethod": "SWIPED"
    },
    "payment": {
     "id": "Je14oj6cetouyt4gdaoyOvqovaB",
     "createdAt": "2022-06-30T01:45:43.854Z",
     "updatedAt": "2022-06-30T01:45:44.325Z",
     "amountMoney": {
      "amount": 181,
      "currency": "USD"
     },
     "totalMoney": {
      "amount": 181,
      "currency": "USD"
     },
     "approvedMoney": {
      "amount": 0,
      "currency": "USD"
     },
     "status": "FAILED",
     "sourceType": "CARD",
     "cardDetails": {
      "status": "FAILED",
      "card": {
       "cardBrand": "VISA",
       "last4": "6379",
       "expMonth": 2,
       "expYear": 2026,
       "cardholderName": "KIM/ SUNYOUN              ",
       "fingerprint": "sq-1-ngjZxAaYih1re5PYAltb-8MdOi4YIKxpuvlcf90bRdMYmXt-eahjxgX25hiLOIxmng",
       "cardType": "DEBIT",
       "prepaidType": "NOT_PREPAID",
       "bin": "434256"
      },
      "entryMethod": "SWIPED",
      "cvvStatus": "CVV_NOT_CHECKED",
      "avsStatus": "AVS_NOT_CHECKED",
      "statementDescription": "SQ *SANTA CRUZ BEACH BOA",
      "deviceDetails": {
       "deviceId": "122CS134A2001012",
       "deviceInstallationId": "7ab8eefe-6cfc-4259-90a0-c052a4e81acb",
       "deviceName": "Midway Dots"
      },
      "cardPaymentTimeline": {
       "authorizedAt": "2022-06-30T01:45:44.325Z"
      },
      "errors": [
       {
        "category": "PAYMENT_METHOD_ERROR",
        "code": "GENERIC_DECLINE",
        "detail": "Authorization error: 'GENERIC_DECLINE'"
       }
      ]
     },
     "locationId": "LPN6RY8R6K7WK",
     "orderId": "VMUH7w56sjMjudCB06CoyUueV",
     "employeeId": "TMhnBZ5mLRyrdpMF",
     "teamMemberId": "TMhnBZ5mLRyrdpMF",
     "deviceDetails": {
      "deviceId": "122CS134A2001012",
      "deviceInstallationId": "7ab8eefe-6cfc-4259-90a0-c052a4e81acb",
      "deviceName": "Midway Dots"
     },
     "applicationDetails": {
      "squareProduct": "OTHER"
     },
     "versionToken": "seAAaomFFW29A2QKykYXx760vsgWordfYlBcSVJEpVP6o"
    }
   },
   {
    "id": "b7PIygiYRWUEp5BQWceB45c8uaB",
    "locationId": "LPN6RY8R6K7WK",
    "transactionId": "VMUH7w56sjMjudCB06CoyUueV",
    "createdAt": "2022-06-30T01:45:35Z",
    "amountMoney": {
     "amount": 281,
     "currency": "USD"
    },
    "tipMoney": {
     "amount": 100,
     "currency": "USD"
    },
    "processingFeeMoney": {
     "amount": 7,
     "currency": "USD"
    },
    "customerId": "DM3J0YZZF504D3Y1XKXANS0E60",
    "type": "CARD",
    "cardDetails": {
     "status": "CAPTURED",
     "card": {
      "cardBrand": "VISA",
      "last4": "2498",
      "fingerprint": "sq-1-XCpqQzmjerA1Anzh4deSbpCWS73io5Dyiem0BOMkQoITIRjThp_2LOM4NqY97-IieQ"
     },
     "entryMethod": "SWIPED"
    },
    "payment": {
     "id": "b7PIygiYRWUEp5BQWceB45c8uaB",
     "createdAt": "2022-06-30T01:45:43.475Z",
     "updatedAt": "2022-06-30T01:45:47.564Z",
     "amountMoney": {
      "amount": 181,
      "currency": "USD"
     },
     "tipMoney": {
      "amount": 100,
      "currency": "USD"
     },
     "totalMoney": {
      "amount": 281,
      "currency": "USD"
     },
     "approvedMoney": {
      "amount": 181,
      "currency": "USD"
     },
     "processingFee": [
      {
       "effectiveAt": "2022-06-30T03:45:46.000Z",
       "type": "INITIAL",
       "amountMoney": {
        "amount": 7,
        "currency": "USD"
       }
      }
     ],
     "status": "COMPLETED",
     "sourceType": "CARD",
     "cardDetails": {
      "status": "CAPTURED",
      "card": {
       "cardBrand": "VISA",
       "last4": "2498",
       "expMonth": 6,
       "expYear": 2025,
       "cardholderName": "ROYBAL/HANNAH J",
       "fingerprint": "sq-1-XCpqQzmjerA1Anzh4deSbpCWS73io5Dyiem0BOMkQoITIRjThp_2LOM4NqY97-IieQ",
       "cardType": "DEBIT",
       "prepaidType": "NOT_PREPAID",
       "bin": "436572"
      },
      "entryMethod": "SWIPED",
      "cvvStatus": "CVV_NOT_CHECKED",
      "avsStatus": "AVS_NOT_CHECKED",
      "authResultCode": "998735",
      "statementDescription": "SQ *SANTA CRUZ BEACH BOA",
      "deviceDetails": {
       "deviceId": "122CS134A2001012",
       "deviceInstallationId": "7ab8eefe-6cfc-4259-90a0-c052a4e81acb",
       "deviceName": "Midway Dots"
      },
      "cardPaymentTimeline": {
       "authorizedAt": "2022-06-30T01:45:43.864Z",
       "capturedAt": "2022-06-30T01:45:46.091Z"
      }
     },
     "locationId": "LPN6RY8R6K7WK",
     "orderId": "VMUH7w56sjMjudCB06CoyUueV",
     "employeeId": "TMhnBZ5mLRyrdpMF",
     "teamMemberId": "TMhnBZ5mLRyrdpMF",
     "receiptNumber": "b7PI",
     "receiptUrl": "https://squareup.com/receipt/preview/b7PIygiYRWUEp5BQWceB45c8uaB",
     "deviceDetails": {
      "deviceId": "122CS134A2001012",
      "deviceInstallationId": "7ab8eefe-6cfc-4259-90a0-c052a4e81acb",
      "deviceName": "Midway Dots"
     },
     "applicationDetails": {
      "squareProduct": "OTHER"
     },
     "versionToken": "jkkHCos5o0ic2qxZ6hp7iLcysLNuKKQjCfG9WGvazi45o"
    }
   }
  ],
  "createdAt": "2022-06-30T01:45:40Z",
  "updatedAt": "2022-06-30T01:45:40Z",
  "closedAt": "2022-06-30T01:45:40Z",
  "state": "COMPLETED",
  "totalMoney": {
   "amount": 662,
   "currency": "USD"
  },
  "totalTaxMoney": {
   "amount": 0,
   "currency": "USD"
  },
  "totalDiscountMoney": {
   "amount": 362,
   "currency": "USD"
  },
  "totalTipMoney": {
   "amount": 300,
   "currency": "USD"
  },
  "totalServiceChargeMoney": {
   "amount": 0,
   "currency": "USD"
  },
  "ticketName": "Order",
  "square_product": [
   "OTHER",
   "OTHER"
  ]
 }

Looks like that order was paid for by multiple payments. The first is b7PIygiYRWUEp5BQWceB45c8uaB and the second is Je14oj6cetouyt4gdaoyOvqovaB. Is the Transaction report showing both payments or only one? :slightly_smiling_face:

Second one is not there. Do you know why it discarded the other one and how it calculated the split gross sale amount?

What do you mean that the order is not there? Is it not being returned in SearchOrders results?

@Bryan-Square I mean the other transaction is not there. Out of two only one in the transaction report exported from square dashboard. Please link this with your reply to my original question. Hope that will make it clear. :slightly_smiling_face:

Okay, so it looks like the $1.81 is correct. The order was attempted to be paid for by two payments. Je14oj6cetouyt4gdaoyOvqovaB isn’t present in the report cause it was declined. b7PIygiYRWUEp5BQWceB45c8uaB is present cause that payment succeeded. Both tenders are included in the Orders API response but one has the status of FAILED. The Transactions CSV file doesn’t contain Je14oj6cetouyt4gdaoyOvqovaB cause it’s a failed payment which is expected. :slightly_smiling_face:

@Bryan-Square Thanks, I want to match the transaction report exported from square using the orders API. From the order api perspective I want to understand how 1.81 is calculated as gross sale for VMUH7w56sjMjudCB06CoyUueV. I know you said it’s the successful payment amount. But technically gross sale excludes returns, discounts, tips and taxes, as per orders API response it should be 7.24. My question is how gross sale is calculated as $1.81 in your report, as $1.81 is successfully captured payment amount and it can include tax, tips and discount. Where does the order API response show that this is the gross sale, in other words how square is calculating this amount?

I hope you understand my question to help explain the logic to calculate it. :crossed_fingers:t2:

Sorry to trouble you. :slightly_smiling_face:

@Bryan-Square did you get the chance to check this with the team.

They’re still looking into this. :slightly_smiling_face: