Add card payments to your app.

Do you want the power to collect card payments with your mobile app? Are you looking for a solution, which is easy to implement and to use? SumUp, Europe’s fastest growing mobile payments provider, has a solution for you: Say hello to the SumUp API.

The SumUp API provides an out-of-box solution for iOS and Android app developers to quickly add a powerful, secure and compliant payment feature to your own apps.

How does it work

  1. Your app sends a payment request to the SumUp app.

    Present your user with a means to check out. Define a payment request object in your native app, using the parameters supported by our API.

  2. User completes the customer payment in the SumUp app.

    When the user clicks the check out point, the payment request will launch the SumUp app. Select the appropriate payment option and complete the transaction with the customer's card details.

  3. Your app shows the result of the payment transaction.

    On completion of the transaction, the SumUp app will send back a result to the native app using the callback URLs supplied in the original request.

Code examples

iOS implementation

The following is an SMPPaymentRequest object example to launch SumUp Merchant App with SumUp API.

  // create request with mandatory values
     SMPPaymentRequest *request =
      [SMPPaymentRequest paymentRequestWithAmount:[
                                    NSDecimalNumber decimalNumberWithString:@"12.34"]
                                    currency:@"EUR"
                                    productTitle:@"Taxi Ride"
                                    affiliateKey:@"abcd1234wxyz"];
  // set optional values
      [request setCallbackUrlPatternFail:@"your-app-scheme://failed"];
      [request setCallbackUrlPatternSuccess:@"your-app-scheme://succeeded"];
      [request setReceiptEmail:@"customer@mail.com"];
      [request setReceiptSMS:@"+3531234567890"];
  // add multiple tags
      [request addTag:@"taxi0334" forKey:@"AccountId"];
      [request addTag:@"Here" forKey:@"from"];
      [request addTag:@"There" forKey:@"to"];
  // launch SumUp Merchant App
      [request openSumUpMerchantApp];

Android implementation

The following is an activity example to launch SumUp Merchant App with SumUp API

// create SumUpPayment with mandatory fields -> String affiliateKey, double productAmount, String currency,
String responseActivity, Context context
        SumUpPayment sumUpPayment = new SumUpPayment("abcd1234wxyz", 12.34, "EUR",
"com.MyApp.ResponseActivity", this);
        // add optional additional details.
        sumUpPayment.setProductTitle("Taxi Ride");
        sumUpPayment.setReceiptEmail("customer@mail.com");
        sumUpPayment.setReceiptSMS("+3531234567890");
        // Create a hashMap to add additional information to the transaction
        HashMap additionalInfo = new HashMap(3);
        additionalInfo.put("AccountId","taxi0334");
        additionalInfo.put("From","Here");
        additionalInfo.put("To","There");
        // add Additional info to transaction history
        sumUpPayment.setAdditionalInfo(additionalInfo);
        // start the payment process
        sumUpPayment.openPaymentActivity(this)
Include in "AndroidManifest.xml"
<activity android:name="PaymentResult"  android:label="Payment Result">
  <intent-filter>
    <action android:name="com.MyApp.PaymentResult"></action>
    <category android:name="android.intent.category.DEFAULT"></category>
    <category android:name="android.intent.category.BROWSABLE"></category>
  </intent-filter>
</activity>

Supported parameters

The following table outlines the parameters supported in payment request.

Parameter M/O* Value, Type Description
productAmount M Decimal currency as string Payment request amount
currency M 3-digit ISO-code as string. Currently supported values = [ EUR | GBP] Payment request currency
affiliateKey M String Unique code assigned to the developers of the native app that identifies all transactions originating from this app. This will be assigned to you on request.
productTitle O String Title of the native store or application
receiptEmail O Email address as string This is the email address of the customer who is buying the product. If present, it is used to send an email receipt of the payment.
receiptSMS O Phone number as string, formatted with full international access code. This is the phone number the customer who is buying the product. If present, it is used to send an SMS receipt of the payment.
callbackfail
(iOS only)
O URL “your-app-scheme://failed”

Example:
your-app-scheme://failed?smp- status=failed&smp-message=Card%20has %20expired.
Callback URL for SumUp app to return the result of any failed payment.
callbacksuccess
(iOS only)
O URL “your-app-scheme://succeeded”

Example:
your-app-scheme://succeeded?smp- status=success&smp-message=Have%20a %20great%20day%21
Callback URL for SumUp app to return the result of any succesfull payment.
additionalInfo-* O Optional tags that can be added See examples in this document.

Explanatory Notes: * M=Mandatory parameter, O=Optional parameter.

Request a developer key

Are you interested in trying the SumUp API? Great! All you need to do is fill out this form and we'll get in touch with you as fast as we can and provide you with all the information you need.