Duplicate webhook when payment success on Sandbox-Environment

Hi Square team,

We have issue from Square.
When we finish payment → we receive more than one web-hook for this payment.

Can you please help me.
Application id: sq0idp-VCiRT6a2bXxIklbSH0Tm3w
event 1 id: 23db8b83-7342-5d9c-bcf8-45c26451d543
event 2 id: 5e2b4275-1c3f-5aae-8244-a37590817389

Thank you!

These events are unique events for payments made to two different invoices. :slightly_smiling_face:

We only pay one time but this still duplicate. Can you please explain more why duplicate event

These are two unique events. For example event 23db8b83-7342-5d9c-bcf8-45c26451d543 payload is:

{
  "merchant_id": "MLD3X6HHQV5WQ",
  "location_id": "L2DT2E49DP6ST",
  "type": "invoice.payment_made",
  "event_id": "23db8b83-7342-5d9c-bcf8-45c26451d543",
  "created_at": "2024-04-23T12:38:31Z",
  "data": {
    "type": "invoice",
    "id": "inv:0-ChDObyZFFSJJG3cr4G_pxL6nEK8M",
    "object": {
      "invoice": {
        "accepted_payment_methods": {
          "bank_account": false,
          "buy_now_pay_later": false,
          "card": true,
          "cash_app_pay": false,
          "square_gift_card": false
        },
        "created_at": "2024-04-23T12:38:25Z",
        "delivery_method": "EMAIL",
        "id": "inv:0-ChDObyZFFSJJG3cr4G_pxL6nEK8M",
        "invoice_number": "001387",
        "location_id": "L2DT2E49DP6ST",
        "order_id": "0szsunNnOGsnwjkgjmHpcmmaYa4F",
        "payment_requests": [
          {
            "automatic_payment_source": "CARD_ON_FILE",
            "card_id": "ccof:CBASELCu88X1d3cXbzsVYbaijC8",
            "computed_amount_money": {
              "amount": 9000,
              "currency": "JPY"
            },
            "due_date": "2024-04-23",
            "request_type": "BALANCE",
            "tipping_enabled": false,
            "total_completed_amount_money": {
              "amount": 9000,
              "currency": "JPY"
            },
            "uid": "eff2a512-73ba-412c-a30c-df76de1257f9"
          }
        ],
        "primary_recipient": {
          "customer_id": "HK4W8HG7CVMFST90BGTS9GKQCC",
          "email_address": "[email protected]",
          "given_name": "hádf"
        },
        "public_url": "https://squareupsandbox.com/pay-invoice/inv:0-ChDObyZFFSJJG3cr4G_pxL6nEK8M",
        "status": "PAID",
        "store_payment_method_enabled": true,
        "subscription_id": "f688129f-f273-4937-a90f-14a24f784933",
        "timezone": "UTC",
        "title": "plan3h 07 Subscription",
        "updated_at": "2024-04-23T12:38:27Z",
        "version": 2
      }
    }
  }
}

The payload for event 5e2b4275-1c3f-5aae-8244-a37590817389 is:

{
  "merchant_id": "MLD3X6HHQV5WQ",
  "location_id": "L2DT2E49DP6ST",
  "type": "invoice.payment_made",
  "event_id": "5e2b4275-1c3f-5aae-8244-a37590817389",
  "created_at": "2024-04-23T12:38:41Z",
  "data": {
    "type": "invoice",
    "id": "inv:0-ChACziTJWbqSRxA1AsUJ070_EK8M",
    "object": {
      "invoice": {
        "accepted_payment_methods": {
          "bank_account": false,
          "buy_now_pay_later": false,
          "card": true,
          "cash_app_pay": false,
          "square_gift_card": false
        },
        "created_at": "2024-04-23T12:38:29Z",
        "delivery_method": "EMAIL",
        "id": "inv:0-ChACziTJWbqSRxA1AsUJ070_EK8M",
        "invoice_number": "001388",
        "location_id": "L2DT2E49DP6ST",
        "order_id": "E8vcu2g7Dzgu0uHk1VUyKffGCi4F",
        "payment_requests": [
          {
            "automatic_payment_source": "CARD_ON_FILE",
            "card_id": "ccof:CBASELCu88X1d3cXbzsVYbaijC8",
            "computed_amount_money": {
              "amount": 9000,
              "currency": "JPY"
            },
            "due_date": "2024-04-23",
            "request_type": "BALANCE",
            "tipping_enabled": false,
            "total_completed_amount_money": {
              "amount": 9000,
              "currency": "JPY"
            },
            "uid": "c8f0424a-0c9d-4e7c-818d-100e16583876"
          }
        ],
        "primary_recipient": {
          "customer_id": "HK4W8HG7CVMFST90BGTS9GKQCC",
          "email_address": "[email protected]",
          "given_name": "hádf"
        },
        "public_url": "https://squareupsandbox.com/pay-invoice/inv:0-ChACziTJWbqSRxA1AsUJ070_EK8M",
        "status": "PAID",
        "store_payment_method_enabled": true,
        "subscription_id": "f688129f-f273-4937-a90f-14a24f784933",
        "timezone": "UTC",
        "title": "plan3h 07 Subscription",
        "updated_at": "2024-04-23T12:38:31Z",
        "version": 2
      }
    }
  }
}

The invoice_ids for each event are different. :slightly_smiling_face:

Dear Mr Brian,

I knew, there are 2 events with 2 invoices.

But you know 2 invoices has same “subscription_id”: “f688129f-f273-4937-a90f-14a24f784933” and time created very nearly

“event_id”: “23db8b83-7342-5d9c-bcf8-45c26451d543” => “created_at”: “2024-04-23T12:38:31Z”,

“event_id”: “5e2b4275-1c3f-5aae-8244-a37590817389” => “created_at”: “2024-04-23T12:38:41Z”,

And please note that we test on sandbox env And I ensure we only payment one time.