Payments API and Refunds API

Payments API and Refunds API Webhooks

The Payments API and Refunds API support a set of webhooks. You can subscribe to these webhook events to get notified when there are changes. For a list of supported webhooks, see Subscribe to Events. Note the following about these webhooks.

payment.created webhook Permalink Get a link to this section

The payment.created event notification is sent when:

  • Square processes these endpoint requests: the Payments API (CreatePayment endpoint) and the v2 Transactions API (Charge endpoint).

  • All payments (card, cash, and external) are taken by a seller through other means, such as the Point of Sale application and invoices.

    Note

    For Point of Sale payments, the published notification does not include information added as a Note. However, a note added in a CreatePayment call is returned in the webhook notification.

payment.updated webhook Permalink Get a link to this section

The payment.updated event is generated when the state of a payment changes. For example:

  • In a delayed capture scenario, the payment is only authorized. Later, when you call CompletePayment (or CancelPayment), the payment state changes. In addition, if an authorized payment is not completed (or canceled) within the time limit, the payment is automatically voided (Square cancels the payment) and you get the payment.updated event notification.

  • If you call UpdatePayment, you get the payment.updated event notification.

  • Additional information is added to a payment. For example, Square calculates and add payment processing fees to the payment.

Refund-related webhook behavior Permalink Get a link to this section

When you refund a payment (using the RefundPayment endpoint), you get the following event notifications:

  • refund.created initially indicates that the task is pending. Later, you get the refund.updated event after the refund is completed or failed.

  • payment.updated event notification. The Payment object in the notification includes the refund ID.

The refund.updated event is sent any time a refund state changes.