No momento, esta página não está disponível em português
Payment-method icon

Cash App Pay for API only

Add Cash App Pay to an existing API-only integration.

Accept Cash App Pay payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

Before you begin

Before starting your Cash App Pay integration:

  1. Make sure that you have set up your back end implementation.
  2. Add Cash App Pay in your test Customer Area.
  3. If you want to make recurring Cash App Pay payments, make sure you have implemented tokenization.

Build your payment form for Cash App Pay

Include Cash App Pay in the list of available payment methods.

We provide logos for Cash App Pay which you can use on your payment form. For more information, refer to Downloading logos.

If you are using the /paymentMethods endpoint to show available payment methods to the shopper, specify the following:

The response contains paymentMethod.type: cashapp.

Make a payment

  1. From your server, make a /payments request, specifying:

    • paymentMethod.type: cashapp
    • paymentMethod.subtype: redirect
    • channel: specify Web, iOS, or Android.
  2. In the /payments response, note the action object. This contains the information needed to redirect the shopper.

Handle the redirect

  1. To complete the payment, redirect the shopper to the action.url returned in the /payments response.

    When using the HTTP GET method:
    For security reasons, when displaying the redirect in the app, we recommend that you use SFSafariViewController for iOS or Chrome Custom Tabs for Android, instead of WebView objects. Also refer to the security best practices for WebView.

  2. After the shopper is redirected back to your website, check the payment result by making a POST /payments/details request, specifying:

    • details: object that contains the URL-decoded redirectResult returned when the shopper was redirected back to your site.
  3. In the response note the following:

    • resultCode: use this to present the result to your shopper.
    • pspReference: our unique identifier for the transaction.

Present the payment result

Use the  resultCode from the /payments/details response to show the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a webhook.

For Cash App Pay payments, you can receive the following resultCode values:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment has been successful.
If you are using manual capture, you also need to capture the payment.
Cancelled The shopper cancelled the payment. Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.
Error There was an error when the payment was being processed. For more information, check the refusalReason field. Inform the shopper that there was an error processing their payment.
Refused The payment was refused. For more information, check the refusalReason field. Ask the shopper to try the payment again using a different payment method.

Recurring payments

Cash App Pay supports tokenization for recurring transactions.

We strongly recommend that you ask explicit permission from the shopper if you intend to make future recurring payments. Being transparent about the payment schedule and the charged amount reduces the risk of chargebacks.

To make recurring payments:

  1. Create a token through the initial Cash App Pay transaction for the shopper, specifying:

    • The tokenization parameters.
    • paymentMethod.type: cashapp
    • paymentMethod.subtype: redirect
    • channel: specify Web, iOS, or Android.
  2. Get the shopper's token from the payment response or the RECURRING_CONTRACT webhook.
    For example: additionalData.recurring.recurringDetailReference: M5N7TQ4TG5PFWR50.

  3. Use the token in later Cash App Pay payments for the shopper, specifying:

    • The tokenization parameters.
    • paymentMethod.type: cashapp
    • paymentMethod.subtype: redirect
    • channel: specify Web, iOS, or Android.

Chargebacks

Shoppers can initiate chargebacks directly with Cash App Pay up to 120 days after the payment, cancellation, or expected receipt of goods or services. For guidelines when a dispute is raised, see Cash App Pay chargebacks.

Test and go live

Test your Cash App Pay integration using the test environment. You can simulate various payment scenarios using Cash App Pay magic values. You can check the status of Cash App Pay test payments in your Customer Area, under Transactions > Payments.

Add Cash App Pay in your live Customer Area when you are ready to accept live payments.

See also