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.

Requirements

Requirement Description
Integration type Make sure that you have an existing API-only integration.
Setup steps Before you begin, contact our Support Team to add Cash App Pay in your Customer Area.

For an API-only integration, you cannot add Cash App Pay in your Customer Area yourself.

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, taking into account the following recommendations:

    • When using the HTTP GET method:
      For security reasons, when showing 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.

    • Redirection for mobile integrations:
      For mobile integrations, we strongly recommended that you redirect the shopper to the default browser of their device. Redirecting to the default browser ensures the best compatibility, handling of multi-factor authentication, app-to-app redirection, and error handling.

  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
Received The shopper has completed the payment but the final result is not yet known. Inform the shopper that you have received their order, and are waiting for the payment to be completed.
You will receive an AUTHORISATION webhook when the status of the payment is updated.
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.

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.

When you are ready to go live, add Cash App Pay in your live Customer Area.

See also