API Integration Quickstart
We recommend that partners use the Pay Kit SDK to integrate with Cash App Pay.
Before getting started, confirm with the Cash App Pay Partner Engineering team that the API-only approach is right for you. Make sure that you have access to:
- API credentials and API access
- Cash App Sandbox App
We recommend reading the following pages:
Integrate with the Cash App Pay API
Step 1: Create a Brand and Merchant
First, create a Brand and associate a Merchant with that brand.
These APIs are server-side between your website or application and Cash App Pay.
Step 2: Link a Customer to the Merchant, Brand, or Client
To link a Customer to the Merchant, Brand, or Client, do the following:
-
Create a customer request with one Channel and at least one Action.
See the list of supported actions and channels here. You can have many actions but only one channel.
-
Save the Request ID and the URL from the
auth_flow_triggers
object in the response.When you call
create customer request
, a customer request is returned to you withauth_flow_triggers
populated. This gives you access to URLs including the QR Code URL, Mobile URL, and Desktop URL. -
Listen for updates to the customer request.
-
When the request enters the
approved
state, stop polling. -
Save the Grant IDs listed in the
grants
array to create a payment later.To test the customer request, you can use the Sandbox App or Sandbox Web to scan and approve the request. See more at Sandbox App and Developer Sandbox.
Listen for updates to the customer request
You can listen for updates to the customer request in two ways:
- Polling (recommended): Call retrieve customer request repeatedly (ideally once per second or more frequently).
- Webhooks: Subscribe to the
customer_request.state.updated
event.
QR codes rotate every 30 seconds and expire every 60 seconds, so you must get the latest QR code. This will change based on how you listen for customer request updates:
- If you are using polling, set the image tag’s URL to the latest QR code that is returned after each polling response. Since you poll more frequently than QR codes rotate, you don’t need to keep track of the
refreshes_at
value. - If using webhook, there is no webhook event for QR code rotation. Instead, you should fetch the latest customer request once the current timestamp is after the
refreshes_at
value. The auth flow triggers will contain the newest, valid QR code.
These APIs are client-side from the browser to Cash App.
Example - Create Customer Request
Example - Retrieve Customer Request
Step 3: Create a Payment
You can now create a payment using the Grant ID and Merchant ID from the previous steps using the Create a payment request endpoint. You can use void, capture, or refund actions depending on the state of the payment.
We use magic values in the amount field to determine outcomes for payments in the sandbox environment. You can use any amount, but these amounts will result in specific outcomes.
Example - Create Payment
Notes
Pay Kit SDK
Pay Kit is the name of the Cash App Pay SDK. This SDK specifically handles linking a Customer to a Merchant and uses the Customer Request API underneath. Instead of using the SDK, you can call the APIs directly as described in the steps to integrate with the Cash App Pay API above. To know more about our SDK, see Pay Kit.
Signatures
Cash App Pay Network API and Management API require that all requests be signed. However, when using Sandbox, you can skip this by setting x-signature
to the value sandbox:skip-signature-check
. Use these Magic Values to control the behavior in Sandbox and to produce preset outcomes.