Webhooks: Steps
Webhooks: Steps
Webhooks: Steps
The webhook endpoint URL must expect JSON data from a POST request and confirm the successful receipt of that data. To subscribe to our webhook events see Create a webhook endpoint. For a list of all Cash App Pay API events that you can subscribe to, see event_type under List Webhook Events.
The webhook endpoint must do the following:
delivery_timeout (default 5 seconds).event_id field in the body of each event notification as an idempotency value. Your application should ignore any duplicate values.You can use a server endpoint as a webhook endpoint URL or you can create a serverless endpoint on services such as Amazon Web Services (AWS) or Google Cloud Platform. You can test a webhook endpoint URL with websites such as https://webhook.site.
The following headers are included when making a POST request to the webhook endpoint to deliver the webhook event:
Webhook signatures: Webhook deliveries also contain an X-Signature header that is computed using the same process as signing regular requests. This allows webhooks delivered by Cash App to be validated by computing the signature from the request payload and verifying that it matches the X-Signature header. See Signing Requests for more details.
The body of the webhook event has the following JSON schema:
The event’s data object contains the following attributes:
bodyYou can test webhook endpoints in our Sandbox environments both on an App and on the web. Go to the following links to learn more:
There are two aspects of Cash App Pay webhook events that you must understand:
For a list of all Cash App Pay API events that you can subscribe to, see event_type under List webhook events.
Events that you can subscribe to using webhooks are generated by the various Cash App Pay applications and APIs. For example, during a sales transaction, several events could be generated including an updated payment received, customer created, grant declined, etc.
When your webhook endpoint URL receives an event notification, you must respond within the specified delivery timeout (or default 5 seconds) to the POST and store the event information securely.
When your application is ready to be moved from the Sandbox environment to production, there are several tasks you must complete to manage webhook event notifications in production. These include the following:
The base URL for calling Sandbox endpoints is
sandbox.api.cash.app. When you move your application to production, you need production credentials and you must useapi.cash.appas the base URL.
event_id field in the body of each event notification as an idempotency value. Your application should ignore any duplicate values.X-Signed-Headers and X-Signature header. See Signing Requests for more information.The customer.deleted webhook event is delivered when a Cash App customer account is deleted.
This operation is often related to requests to forget a customer’s data (for example, CCPA/GDPR), so that the customer
data in the webhook event does not contain any data that the customer provided (for example, a Cashtag). Since the
customer reference ID is provided by the API client, not the customer, any reference ID previously
attached to the customer will be included in the webhook event data.
When a customer account is deleted, all active grants for that customer are automatically revoked. Any
future attempts to use grants associated with that customer will fail. Any attempt to retrieve the customer
through the API will return a CUSTOMER_DELETED_ACCOUNT error.