@bates-solutions/squareup API Reference - v3.2.0
    Preparing search index...

    Function parseWebhookEvent

    • Parse a webhook request body into a typed event

      Parameters

      • rawBody: string

        The raw request body string

      Returns WebhookEvent

      Parsed webhook event

      Error if parsing fails

      const event = parseWebhookEvent(rawBody);
      console.log(event.type); // 'payment.completed'