### Install SumUp React Native SDK
Source: https://developer.sumup.com/llms-full.txt
Commands to install the SumUp React Native Payment SDK and its dependency `react-native-webview` using npm or yarn.
```bash
npm i sumup-react-native-alpha
npm i react-native-webview
```
```bash
yarn add sumup-react-native-alpha
yarn add react-native-webview
```
--------------------------------
### Install SumUp PHP SDK with Composer
Source: https://developer.sumup.com/llms-small.txt
This command uses Composer, a dependency manager for PHP, to install the SumUp eCom PHP SDK. Ensure Composer is installed on your system before running this command. This is the primary method for adding the SDK to your PHP project.
```bash
composer require sumup/sumup-ecom-php-sdk
```
--------------------------------
### Install SumUp React Native SDK (npm/yarn)
Source: https://developer.sumup.com/llms-small.txt
Instructions for installing the SumUp React Native Payment SDK and its dependencies using npm or yarn. It also includes installing react-native-webview and react-native-localization, which are required for certain SDK functionalities.
```bash
npm i sumup-react-native-alpha
npm i react-native-webview
yarn add sumup-react-native-alpha
yarn add react-native-webview
```
--------------------------------
### Google Pay Integration
Source: https://developer.sumup.com/llms-full.txt
Guide to integrating Google Pay directly with SumUp. Covers prerequisites and setup.
```APIDOC
## Google Pay Integration Guide
This guide explains how to integrate Google Pay directly with SumUp. Google Pay is also available via the SumUp Payment Widget.
### Prerequisites
Before you begin:
* Ensure you have a merchant profile with SumUp and have completed your profile details.
* If you need to test payments without using real funds, create a test profile.
* Review the Google Pay API terms of service.
* Complete the domain onboarding setup in your SumUp Dashboard under **Settings** > **For developers** > **Payment wallets**. Refer to Google's tutorial on Google Pay for Payments for detailed requirements.
```
--------------------------------
### Wrap Payment Screen with SumUpProvider
Source: https://developer.sumup.com/llms-full.txt
Example of initializing the SumUp SDK by wrapping the main payment screen component with `SumUpProvider`. This requires an `apiKey` obtained from the SumUp developer portal.
```javascript
import { SumUpProvider } from 'sumup-react-native-alpha';
export default function App() {
return (
);
}
```
--------------------------------
### Install Native Modules for iOS
Source: https://developer.sumup.com/llms-full.txt
Command to navigate to the 'ios' directory and install native modules using CocoaPods, a necessary step after installing React Native libraries.
```bash
cd ios
pod install
```
--------------------------------
### Accept Payments with PrestaShop
Source: https://developer.sumup.com/llms-small.txt
Guide on accepting payments using the SumUp Payment module plugin for PrestaShop, including prerequisites and installation steps.
```APIDOC
## Accept payments with PrestaShop
### Description
This guide details how to accept payments using the SumUp Payment module plugin for PrestaShop. It covers the necessary prerequisites and installation steps.
### Prerequisites
1. An active SumUp account.
2. Verified business information as required by SumUp's legal and verification policies.
3. Ensure your business model is supported by SumUp.
### Installation
1. Obtain client credentials by registering an application via the [register application guide](/tools/authorization/register-app).
2. Download the client credentials JSON file from the [access client credentials section](/tools/authorization/register-app/#4-access-the-client-credentials).
3. Upload the JSON file to the "Module Configuration" page in your PrestaShop Backoffice.
4. Contact SumUp support to request enabling of the online payments scope for your store after your account is fully verified.
### Note
The minimum transaction amount accepted through SumUp is 1 EUR (or equivalent).
```
--------------------------------
### Create Checkout for Recurring Payments (Bash)
Source: https://developer.sumup.com/llms-small.txt
This example shows how to create a checkout resource intended for setting up recurring payments. It includes essential details like amount, currency, customer ID, and crucially, sets the 'purpose' to 'SETUP_RECURRING_PAYMENT' for tokenization.
```bash
curl -X POST \
https://api.sumup.com/v0.1/checkouts \
-H "Authorization: Bearer $SUMUP_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"checkout_reference": "MYCHECKOUT",
"amount": 100,
"currency": "EUR",
"merchant_code": "MDEERENR",
"description": "My checkout",
"customer_id": "MYCUSTOMERID-123",
"purpose": "SETUP_RECURRING_PAYMENT"
}'
```
--------------------------------
### Initialize LLMtxt SDK
Source: https://developer.sumup.com/llms-small.txt
Initializes the LLMtxt SDK, providing the access token. This method should be called once at the application's start. It returns a `Result` object indicating success or failure.
```kotlin
```kotlin
// Assumes an init function is defined elsewhere
// Example placeholder:
// fun init(accessToken: String): Result
```
```
--------------------------------
### Start Payment Process
Source: https://developer.sumup.com/llms-full.txt
Initiates a payment transaction. Takes `CheckoutData` and a boolean to skip the success screen. Returns a `Flow` of `PaymentEvent`s or throws an exception on error.
```kotlin
suspend fun startPayment(
checkoutData: CheckoutData,
skipSuccessScreen: Boolean
): Flow
```
--------------------------------
### Solo Terminal API - Reader Checkout Request Example
Source: https://developer.sumup.com/llms-full.txt
An example of how to include Affiliate Key details in a Solo Terminal API Reader Checkout Request.
```APIDOC
## Solo Terminal API - Reader Checkout Request
### Description
This request demonstrates the inclusion of affiliate information, specifically the `app_id` and `key`, within the `affiliate` object for a Solo Terminal API checkout request.
### Method
POST
### Endpoint
(Specific endpoint for creating checkout not provided in text, assumed for example)
### Parameters
#### Request Body
- **affiliate** (object) - Required - Contains affiliate identification details.
- **app_id** (string) - Required - The application ID or Bundle ID.
- **key** (string) - Required - The unique Affiliate key.
- **checkout** (object) - Required - Details of the checkout.
- **amount** (number) - Required - The transaction amount.
- **currency** (string) - Required - The currency of the transaction (e.g., "EUR").
- **description** (string) - Optional - A description for the transaction.
### Request Example
```json
{
"affiliate": {
"app_id": "your_application_id",
"key": "your_affiliate_key"
},
"checkout": {
"amount": 10.0,
"currency": "EUR",
"description": "Test Transaction"
}
}
```
### Response
#### Success Response (200)
(Response structure not provided in text)
#### Response Example
(Response example not provided in text)
```
--------------------------------
### Install react-native-localization SDK
Source: https://developer.sumup.com/llms-full.txt
Commands to install the `react-native-localization` library using npm or yarn, which helps in automatically detecting the user's system language for the SDK.
```bash
npm i react-native-localization
```
```bash
yarn add react-native-localization
```
--------------------------------
### Create and Complete a Checkout
Source: https://developer.sumup.com/llms-full.txt
Guides on how to create a checkout and then complete it for a payment with a customer-entered card. Useful for quick payment processing without storing customer data.
```APIDOC
## Create and Complete a Checkout
### Description
This guide explains how to make a single payment using a customer's card details without associating it with a saved customer profile. This is ideal for scenarios where customer account data is not stored or managed.
### Steps
1. **Create a checkout**: Initiate a checkout process.
2. **Complete a checkout**: Finalize the payment using the customer's card information.
### Response Handling
- **Successful requests**: Indicated by `2xx` HTTP status codes (e.g., `200 OK`, `201 Created`, `202 Accepted`, `204 No Content`). Response bodies may vary or be absent.
- **Client-side issues**: Indicated by `4xx` codes, usually due to invalid requests, incorrect values, or missing parameters. The response body will detail the error.
- **Server-side issues**: Indicated by `5xx` codes, suggesting temporary server problems. Retrying the request is recommended.
### Example Success Response Body
```json
{
"next_step": {
"url": "https://dummy-3ds-gateway.com/cap?RID=1233&VAA=A",
"method": "POST",
"redirect_url": "https://mysite.com/completed_purchase",
"mechanism": "iframe",
"payload": {
"PaReq": "eJxVUttu2zAM/RXDr4MjyY5dO6BVuE27FZuDZHGG9VGRmMSFb/..f16+jLt/gPhUvGGw==",
"MD": "b1a536c0-29b9-11eb-adc1-0242ac120002"
}
}
}
```
### Example Error Response Body (4xx)
```json
{
"message": "Validation error",
"error_code": "MISSING",
"param": "merchant_code"
}
```
```
--------------------------------
### JavaScript Example for CSP with Nonce
Source: https://developer.sumup.com/llms-small.txt
This Node.js Express example demonstrates how to set the 'Content-Security-Policy' header dynamically with a generated nonce to allow inline scripts and styles required by the SumUp Payment Widget. It whitelists necessary SumUp domains for API connections, images, scripts, and frames.
```javascript
const express = require("express");
const app = express();
const http = require("http");
const server = http.createServer(app);
const port = process.env.PORT || 4000;
const crypto = require("crypto");
// Resources
const apisToConnect = ["https://gateway.sumup.com", "https://api.sumup.com"];
const imagesResources = [
"data:", // inline icons
"https://static.sumup.com",
// For generated barcodes
"https://api.sumup.com",
];
const scriptsResources = [
"https://gateway.sumup.com",
// PLUS nonce-$HASH
];
const stylesResources = [
// nonce-$HASH
];
const framesResources = ["https://gateway.sumup.com"];
app.get("/", (req, res) => {
const nonce = crypto.randomBytes(16).toString("base64");
res.setHeader(
"Content-Security-Policy",
`default-src 'self';` +
` connect-src 'self' ${apisToConnect.join(" ")};` +
` img-src 'self' ${imagesResources.join(" ")};` +
` script-src 'self' ${scriptsResources.join(" ")} 'nonce-${nonce}';` +
` style-src 'self' 'nonce-${nonce}';` +
` frame-src 'self' ${framesResources.join(" ")};`
);
//
res.send(
`
`
);
});
server.listen(port, () => {
console.log("listening on:", port);
});
```
--------------------------------
### Community and Support
Source: https://developer.sumup.com/llms-small.txt
Information on how to get help and contact the SumUp integration team.
```APIDOC
## Community
Got questions or found a bug? Get in contact with our integration team by sending an email to .
```
--------------------------------
### Initialize Payment Sheet with Apple Pay
Source: https://developer.sumup.com/llms-full.txt
Provides instructions for enabling and configuring Apple Pay for the payment sheet, including merchant ID registration and Xcode setup.
```APIDOC
## Initialize Payment Sheet with Apple Pay
### Description
This section outlines the steps required to enable Apple Pay for the SumUp payment sheet. It includes registering an Apple Merchant ID, configuring your Xcode project, and providing the necessary details during payment sheet initialization.
**Note:** The backend does not currently process Apple Pay payments, and a fix is in progress.
### Method
Asynchronous function call within JavaScript after setup.
### Endpoint
N/A (Client-side function)
### Parameters
#### Apple Merchant ID Registration
1. Register for a new Merchant ID on the Apple Developer website.
2. Create a new Apple Pay certificate (requires implementation).
#### Xcode Configuration
1. Open your target settings in Xcode.
2. Navigate to the "Signing & Capabilities" tab.
3. Click "Add Capability" and select your Merchant Identifier.
#### `initPaymentSheet` options
- **applePay** (object) - Optional - Configuration object for Apple Pay.
- **merchantIdentifier** (string) - Required - Your registered Apple Merchant ID (e.g., `merchant.com.YOUR_APP_NAME`).
- **label** (string) - Optional - The label displayed to the user (default is 'Pay').
### Request Example
```javascript
await initPaymentSheet({
// Other configuration options...
applePay: {
merchantIdentifier: 'merchant.com.{{YOUR_APP_NAME}}',
label: 'Pay',
},
});
```
### Response
No direct response, this function initializes the SDK's state.
```
--------------------------------
### Example Client Credentials JSON
Source: https://developer.sumup.com/llms-small.txt
This JSON structure represents the client credentials obtained after registering an application with SumUp. It includes essential information like the client ID, client secret, and redirect URIs needed for authentication and API interactions.
```json
{
"id": "CCCFAXYD",
"name": "My Online Store Name",
"client_id": "fOcmczrYtYMJ7Li5GjMLLcUeC9dN",
"client_secret": "717bd571b54297494cd7a79b491e8f2c1da6189c4cc2d3481380e8366eef539c",
"application_type": "web",
"redirect_uris": ["https://mywebsite.com/callback"]
}
```
--------------------------------
### Next Steps
Source: https://developer.sumup.com/llms-small.txt
Resources for further learning and integration.
```APIDOC
## What’s Next?
Check other resources we have, such as:
* [SumUp Android SDK](https://github.com/sumup/sumup-android-sdk)
* Our [Postman REST API collection](https://github.com/sumup/sumup-postman)
```
--------------------------------
### Initialize SumUp iOS SDK with Affiliate Key (Objective-C)
Source: https://developer.sumup.com/llms-full.txt
Initializes the SumUp iOS SDK with the given Affiliate Key. The setup should occur on the main thread and might be delayed until post-app launch due to its impact on location services. Verify `info.plist` for usage descriptions and that the Bundle Identifier is correctly configured in the SumUp developer portal.
```objc
#import "SUSAppDelegate.h"
#import
@implementation SUSAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[SMPSumUpSDK setupWithAPIKey:@"sup_afk_abcqwerty"];
return YES;
}
```
--------------------------------
### Initialization and Mounting
Source: https://developer.sumup.com/llms-small.txt
Initializes and renders the payment form using the `mount` method. This method accepts a JSON object with configuration options.
```APIDOC
## POST /payment/card
### Description
Initializes and renders the payment form.
### Method
POST
### Endpoint
/payment/card
### Parameters
#### Query Parameters
- **locale** (string) - Optional - Specifies the formatting of the `amount` and `currency` according to the given locale. Example: `"en-GB"`
- **country** (string) - Optional - Sets the country where the user account is from. Example: `"GB"`
- **googlePay** (object) - Optional - Required for accepting payments with the widget via Google Pay. Should contain `merchantId` and `merchantName`.
- **merchantId** (string) - Required - A value provided by Google.
- **merchantName** (string) - Required - Visible to the customer on the Google Pay payment flow.
#### Request Body
- **configuration** (object) - Required - JSON object with configuration options.
- **checkoutId** (string) - Required - The ID of the checkout.
- **email** (string) - Required - The email of the customer.
- **amount** (number) - Required - The payment amount.
- **currency** (string) - Required - The currency of the payment (e.g., "EUR").
- **installments** (number) - Optional - Number of installments for the payment (available only for merchants in Brazil).
- **showSubmitButton** (boolean) - Optional - Whether to show the default submit button. Defaults to true.
- **skipBinLookup** (boolean) - Optional - Skips the BIN lookup process.
- **paymentMethodsView** (object) - Optional - Configuration for payment methods view.
- **analyticsId** (string) - Optional - ID for analytics tracking.
### Request Example
```json
{
"configuration": {
"checkoutId": "2ceffb63-cbbe-4227-87cf-0409dd191a98",
"email": "customer@example.com",
"amount": 100,
"currency": "EUR",
"installments": 3,
"showSubmitButton": false
}
}
```
### Response
#### Success Response (200)
- **submit** (function) - Method to submit the form.
- **unmount** (function) - Method to destroy the card.
- **update** (function) - Method to dynamically change some configurations. Accepts an object with configuration keys like `checkoutId`, `email`, `amount`, `currency`, or `installments`.
#### Response Example
```json
{
"submit": "function() { ... }",
"unmount": "function() { ... }",
"update": "function(newConfig) { ... }"
}
```
```
--------------------------------
### SumUp API Checkout Creation Response
Source: https://developer.sumup.com/llms-full.txt
Example of a successful 201 Created response from the SumUp API after creating a checkout resource for recurring payment setup. Includes details about the checkout and associated merchant and customer information.
```json
{
"amount": 100,
"checkout_reference": "MYCHECKOUT",
"checkout_type": "checkout",
"currency": "EUR",
"customer_id": "MYCUSTOMERID-123",
"date": "2025-10-29T15:09:11.550+00:00",
"description": "My checkout",
"id": "7164c99b-13cb-42a1-8ba1-3c2c46a29de7",
"merchant_code": "MDEERENR",
"merchant_country": "PL",
"merchant_name": "Test Account",
"pay_to_email": "a8e019f9bb2f49159182e8bd61eb5ea6@developer.sumup.com",
"purpose": "SETUP_RECURRING_PAYMENT",
"status": "PENDING",
"transactions": []
}
```
--------------------------------
### Present Tap to Pay Activation UI (Objective-C)
Source: https://developer.sumup.com/llms-full.txt
Initiates the activation process for Tap to Pay on iPhone. This method presents a modal view controller to guide the merchant through the setup, linking their Apple ID to their SumUp account. It requires the `com.apple.developer.proximity-reader.payment.acceptance` entitlement and specific iOS versions.
```objc
+ (void)presentTapToPayActivationFromViewController:(UIViewController *)fromViewController
animated:(BOOL)animated
completionBlock:(nullable SMPCompletionBlock)block;
```
--------------------------------
### Initialize SumUp iOS SDK with Affiliate Key (Swift)
Source: https://developer.sumup.com/llms-full.txt
Sets up the SumUp iOS SDK using the provided Affiliate Key. This function should be called on the main thread, potentially after app launch, as it initiates location updates. Ensure necessary location descriptions are in `info.plist` and the Bundle Identifier is registered.
```swift
import SumUpSDK
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
SumUpSDK.setup(withAPIKey: "sup_afk_abcqwerty")
return true
}
}
```
--------------------------------
### Make Partial Refund using Go
Source: https://developer.sumup.com/llms-small.txt
This Go code example shows how to initiate a partial refund for a transaction using the SumUp client library. It requires authentication with an API key and specifies the transaction ID and the refund amount. The function handles context and client initialization.
```go
ctx := context.Background()
client := sumup.NewClient().WithAuth(os.Getenv("SUMUP_API_KEY"))
amount := 12.24
client.Transactions.Refund(ctx, "sa", sumup.RefundTransactionBody{
Amount: &amount,
})
```
--------------------------------
### Create Checkout Resource with Go
Source: https://developer.sumup.com/llms-full.txt
This Go code snippet shows how to use the SumUp Go client library to create a checkout. It initializes the client with an API key and calls the `Create` method with the necessary checkout details.
```go
ctx := context.Background()
client := sumup.NewClient().WithAuth(os.Getenv("SUMUP_API_KEY"))
checkout, err := client.Checkouts.Create(ctx, sumup.CreateCheckoutBody{
Amount: 19,
CheckoutReference: "CO746453",
Currency: "EUR",
MerchantCode: "MK0001",
})
```
--------------------------------
### Installments
Source: https://developer.sumup.com/llms-full.txt
When using SMPProcessAsCredit, the number of installments must be obtained from the customer via your UI and assigned to the numberOfInstallments field in SMPCheckoutRequest.
```APIDOC
## Installments
When `SMPProcessAsCredit` is used, you should obtain the number of installments from the customer using your own UI. Assign the positive, non-zero value to `numberOfInstallments` on `SMPCheckoutRequest`.
```
--------------------------------
### Start SumUp MCP Server Locally (Shell)
Source: https://developer.sumup.com/llms-small.txt
This command initiates the SumUp Model Context Protocol (MCP) server locally. It requires an API key, which can be provided via the SUMUP_API_KEY environment variable or directly as an argument. The server enables AI agents to interact with the SumUp API and knowledge base.
```sh
SUMUP_API_KEY='sup_sk_MvxmLOl0...' npx -y @sumup/mcp
```
--------------------------------
### Basic PHP SDK Usage for Creating a Checkout
Source: https://developer.sumup.com/llms-full.txt
This PHP code demonstrates the basic usage of the SumUp PHP SDK to create a checkout. It initializes the SDK with your credentials and authorization code, then uses the CheckoutService to initiate a payment. Error handling for authentication and response exceptions is included.
```php
try {
$sumup = new \SumUp\SumUp([
'app_id' => 'YOUR-CLIENT-ID',
'app_secret' => 'YOUR-CLIENT-SECRET',
'code' => 'YOUR-AUTHORIZATION-CODE'
]);
$checkoutService = $sumup->getCheckoutService();
$checkoutResponse = $checkoutService->create($amount, $currency, $checkoutRef, $payToEmail);
$checkoutId = $checkoutResponse->getBody()->id;
// pass the $chekoutId to the front-end to be processed
} catch (\SumUp\Exceptions\SumUpAuthenticationException $e) {
echo 'Authentication error: ' . $e->getMessage();
} catch (\SumUp\Exceptions\SumUpResponseException $e) {
echo 'Response error: ' . $e->getMessage();
} catch(\SumUp\Exceptions\SumUpSDKException $e) {
echo 'SumUp SDK error: ' . $e->getMessage();
}
```
--------------------------------
### Set Number of Installments for SumUp Credit Payments
Source: https://developer.sumup.com/llms-small.txt
Assigns a positive, non-zero value to the `numberOfInstallments` property on `SMPCheckoutRequest` when `SMPProcessAsCredit` is used. This is necessary to obtain the number of installments from the customer, typically after prompting them via your own UI.
```Objective-C
// Assign the positive, non-zero value to `numberOfInstallments` on `SMPCheckoutRequest`.
```
--------------------------------
### Install SumUp iOS SDK with Cocoapods
Source: https://developer.sumup.com/llms-small.txt
This snippet shows how to add the SumUp iOS SDK to your project using Cocoapods. It specifies the SDK name and version constraint. Ensure you have Cocoapods installed and configured in your project.
```ruby
target '' do
pod 'SumUpSDK', '~> 6.0'
end
```
--------------------------------
### Boleto Payment Artifact Example
Source: https://developer.sumup.com/llms-small.txt
An example of the artifact data received for a 'boleto' payment. This typically includes a barcode for payment, a URL to generate the boleto, and its validity period. The `artefacts` array may contain the PDF document for the boleto.
```JSON
{
"boleto": {
"barcode": "23790001246004987209031123456704579990000010000",
"url": "https://api.sumup.com/v0.1/checkouts/19c11c6c-be1d-4dd6-b718-2798878117cb/boletos/1044833949",
"valid_until": "2022-02-01T17:57:10.442+00:00",
"artefacts": [
{
"name": "invoice",
"content_type": "application/pdf",
"location": "h"
}
]
}
}
```
--------------------------------
### Initialize SumUp SDK with Affiliate Key in Swift
Source: https://developer.sumup.com/llms-small.txt
Initializes the SumUp SDK using your Affiliate Key. This method should be called on the main thread, preferably after app launch, as it may request location permissions. Ensure your app's Bundle Identifier is registered in the SumUp developer portal.
```swift
import SumUpSDK
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Setup the SumUpSDK with your Affiliate Key
SumUpSDK.setup(withAPIKey: "sup_afk_abcqwerty")
return true
}
}
```
--------------------------------
### SumUp API Client-Side Error (4xx) Example
Source: https://developer.sumup.com/llms-small.txt
This JSON example illustrates a typical client-side error response (4xx) from the SumUp API. It indicates a validation failure, specifying the error message, a unique error code, and the parameter that caused the issue.
```json
{
"message": "Validation error",
"error_code": "MISSING",
"param": "merchant_code"
}
```
--------------------------------
### Present Payment Sheet
Source: https://developer.sumup.com/llms-full.txt
Demonstrates how to initialize and present the payment sheet, handling success and error callbacks.
```APIDOC
## Present Payment Sheet
### Description
This function `presentPaymentSheet()` displays the payment interface to the user. Upon completion of a payment, it returns a callback with either success or error details.
### Method
Asynchronous function call within JavaScript.
### Endpoint
N/A (Client-side function)
### Parameters
None directly for `presentPaymentSheet()`.
### Request Example
```javascript
const showPaymentSheet = async () => {
const { error } = await presentPaymentSheet();
if (error) {
Alert.alert(
error.status,
error.status === "failure" ? error.message : undefined
);
} else {
Alert.alert("Payment successfully was processed");
}
};
// Usage within a component:
return (
);
```
### Response
#### Success Response
Callback with no error object.
#### Response Example
```json
{
"paymentStatus": "success"
}
```
#### Error Response
Callback with an error object.
#### Error Response Example
```json
{
"error": {
"status": "failure",
"message": "Payment failed due to insufficient funds."
}
}
```
```
--------------------------------
### SumUp Hosted Checkout API Response Example
Source: https://developer.sumup.com/llms-small.txt
Example JSON response from the SumUp API after successfully creating a hosted checkout. The response includes the checkout details and the 'hosted_checkout_url' which directs users to the payment page. It also confirms that 'hosted_checkout' is enabled.
```json
{
"amount": 12,
"checkout_reference": "b50pr914-6k0e-3091-a592-890010285b3d",
"checkout_type": "checkout",
"currency": "EUR",
"date":"2000-01-01T12:49:24.899+00:00",
"description": "A sample checkout",
"id": "64553e20-3f0e-49e4-8af3-fd0eca86ce91",
"merchant_code": "MCXXXXXX",
"merchant_country": "DE",
"merchant_name": "Sample Shop",
"purpose": "CHECKOUT",
"status": "PENDING",
"transactions": [],
"hosted_checkout": {
"enabled": true
},
"hosted_checkout_url": "https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676"
}
```
--------------------------------
### Initialize and Render Payment Form (JavaScript)
Source: https://developer.sumup.com/llms-full.txt
Initializes and renders the payment form using the `mount` method. This method accepts a configuration object and returns an object with `submit`, `unmount`, and `update` methods for managing the payment form lifecycle and dynamic updates.
```javascript
instance.mount({
// Configuration object
});
```
--------------------------------
### Initialize TapToPay API
Source: https://developer.sumup.com/llms-small.txt
Obtain an instance of the `TapToPay` interface, which is the primary point of interaction with the SDK. This is done by calling `TapToPayApiProvider.provide()` and passing the application's context.
```kotlin
1 val tapToPay = TapToPayApiProvider.provide(applicationContext)
```
--------------------------------
### POST /api/checkouts/create
Source: https://developer.sumup.com/llms-full.txt
Initiates the checkout process. It's crucial to include `customer_id` for linking to a payment instrument and `purpose` set to 'SETUP_RECURRING_PAYMENT' to process an authorization charge that is instantly reimbursed.
```APIDOC
## POST /api/checkouts/create
### Description
Initiates the checkout process, allowing for the setup of recurring payments by linking a customer ID and processing an initial authorization charge.
### Method
POST
### Endpoint
/api/checkouts/create
### Parameters
#### Request Body
- **customer_id** (string) - Required - Identifier for the customer.
- **purpose** (string) - Required - Indicates the purpose of the checkout, e.g., 'SETUP_RECURRING_PAYMENT'.
- **amount** (number) - Required - The amount for the checkout.
- **currency** (string) - Required - The currency for the checkout (e.g., 'EUR').
- **merchant_code** (string) - Required - The merchant's code.
- **description** (string) - Optional - A description for the checkout.
- **return_url** (string) - Optional - The URL to redirect the customer to after the checkout.
### Request Example
```json
{
"checkout_reference": "CO746453",
"amount": 5,
"currency": "EUR",
"merchant_code": "ME7RMQN3",
"description": "Sample request",
"return_url": "http://example.com",
"customer_id": "DC000101",
"purpose": "SETUP_RECURRING_PAYMENT"
}
```
### Response
#### Success Response (200)
- **checkout_reference** (string) - The reference for the created checkout.
- **amount** (number) - The amount of the checkout.
- **currency** (string) - The currency of the checkout.
#### Response Example
```json
{
"checkout_reference": "CO746453",
"amount": 5,
"currency": "EUR"
}
```
```
--------------------------------
### Checkout Call
Source: https://developer.sumup.com/llms-small.txt
Information on how to retrieve the final status of a payment via a GET checkout call.
```APIDOC
## GET /api/checkouts/{checkout_id}
### Description
Retrieves the final status of a payment after a user has paid using a generated artifact (Boleto, Pix, or QR Code Pix).
### Method
GET
### Endpoint
/api/checkouts/{checkout_id}
### Parameters
#### Path Parameters
- **checkout_id** (string) - Required - The unique identifier for the checkout.
### Response
#### Success Response (200)
- **status** (string) - The final status of the checkout (e.g., "PAID", "PENDING", "FAILED").
- Other relevant checkout details may be returned.
#### Response Example
```json
{
"id": "checkout_abc123",
"status": "PAID",
"amount": 50.00,
"currency": "BRL",
"created_at": "2023-10-27T10:00:00Z"
}
```
```
--------------------------------
### Create Customer via API (Bash)
Source: https://developer.sumup.com/llms-small.txt
This snippet demonstrates how to create a new customer resource by making a POST request to the SumUp API. It requires an API key for authorization and sends customer details in JSON format.
```bash
curl -X POST \
https://api.sumup.com/v0.1/customers \
-H "Authorization: Bearer $SUMUP_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "MYCUSTOMERID-123",
"personal_details": {
"address": {
"city": "Venice",
"state": "California",
"country": "US",
"line1": "606 Venezia Ave",
"line2": "Front",
"postal_code": "90291"
},
"birthdate": "1949-11-11",
"email": "thedude@example.com",
"first_name": "Jeffrey",
"last_name": "Lebowski",
"phone": "+1 310-555-1234"
}
}'
```
--------------------------------
### GET /api/checkouts/get
Source: https://developer.sumup.com/llms-full.txt
Retrieves the details of a specific checkout, including the payment instrument token if the checkout was successfully processed.
```APIDOC
## GET /api/checkouts/get
### Description
Retrieves the details of a previously processed checkout. If the checkout was successful, this endpoint returns a `payment_instrument` object containing a token for future use.
### Method
GET
### Endpoint
/api/checkouts/get
### Parameters
#### Query Parameters
- **id** (string) - Required - The ID of the checkout to retrieve.
### Response
#### Success Response (200)
- **id** (string) - The unique identifier for the checkout.
- **checkout_reference** (string) - The reference for the checkout.
- **amount** (number) - The amount of the checkout.
- **currency** (string) - The currency of the checkout.
- **payment_instrument** (object) - Contains details about the payment instrument.
- **token** (string) - The token representing the payment instrument for recurring payments.
#### Response Example
```json
{
"id": "cd36780e-f43d-4f22-1i9e-e32a1a1bafc8",
"checkout_reference": "0BYNWLYC7KV",
"amount": 3.51,
"currency": "EUR",
"payment_instrument": {
"token": "2fa27578-e765-5dbh-aa97-d45d3d6cdfbb"
}
}
```
```
--------------------------------
### GET /v0.1/checkouts/{id}
Source: https://developer.sumup.com/llms-small.txt
Retrieves the details of a specific checkout transaction. This is useful for obtaining the transaction ID required for refunds.
```APIDOC
## GET /v0.1/checkouts/{id}
### Description
Retrieves the details of a specific checkout transaction, including its associated transactions. This endpoint is typically used to find the `id` of a transaction that needs to be refunded.
### Method
GET
### Endpoint
`/v0.1/checkouts/{id}`
### Parameters
#### Path Parameters
- **id** (string) - Required - The identifier of the checkout resource.
#### Query Parameters
None
#### Request Body
None
### Request Example
```bash
curl -X GET \
https://api.sumup.com/v0.1/checkouts/4ebc2ed7-bb8c-4d4d-a110-08fd31301bf2 \
-H "Authorization: Bearer $SUMUP_API_KEY"
```
### Response
#### Success Response (200)
- **checkout_reference** (string) - The reference of the checkout.
- **id** (string) - The identifier of the checkout.
- **transactions** (array) - A list of transactions associated with the checkout.
- **id** (string) - The identifier of the transaction.
#### Response Example
```json
{
"checkout_reference": "CO287866",
"id": "4ebc2ed7-bb8c-4d4d-a110-08fd31301bf2",
"transactions": [
{
"id": "664200af-2b62-4142-9c73-a2a505310d78"
}
]
}
```
```
--------------------------------
### Provide TapToPay Implementation
Source: https://developer.sumup.com/llms-full.txt
Retrieves an implementation of the `TapToPay` interface using the application context. This is the entry point for interacting with the TapToPay SDK.
```kotlin
val tapToPay = TapToPayApiProvider.provide(applicationContext)
```
--------------------------------
### Start Checkout on Reader
Source: https://developer.sumup.com/llms-small.txt
This section describes how to initiate a checkout transaction on a paired Solo reader via the Cloud API.
```APIDOC
## Start Checkout on Reader
### Description
Once a Solo reader is paired, you can use the Cloud API to initiate a checkout transaction. The Solo reader will then present the payment details to the customer.
### Method
POST
### Endpoint
`/v1/reader/{reader_id}/checkout` (Example endpoint, actual may vary)
### Parameters
#### Path Parameters
- **reader_id** (string) - Required - The unique identifier of the paired Solo reader.
#### Query Parameters
None
#### Request Body
- **amount** (number) - Required - The transaction amount.
- **currency** (string) - Required - The currency of the transaction (e.g., "EUR", "USD").
- **title** (string) - Optional - A title for the transaction.
- **reference** (string) - Optional - A reference for the transaction.
### Request Example
```json
{
"amount": 10.50,
"currency": "EUR",
"title": "Order #12345",
"reference": "REF98765"
}
```
### Response
#### Success Response (200)
- **transaction_id** (string) - The unique identifier for the initiated transaction.
- **status** (string) - The status of the checkout initiation.
#### Response Example
```json
{
"transaction_id": "txn_abcdef12345",
"status": "initiated"
}
```
```
--------------------------------
### Start Payment Process with LLMtxt SDK
Source: https://developer.sumup.com/llms-small.txt
Initiates a payment process using the `startPayment` method. It takes `CheckoutData` and a `skipSuccessScreen` boolean, returning a `Flow` of `PaymentEvent` or throwing an exception on failure. Possible events include card detection, CVM requests, transaction completion, failure, cancellation, and unknown results.
```kotlin
```kotlin
suspend fun startPayment(
checkoutData: CheckoutData,
skipSuccessScreen: Boolean
): Flow
```
```
--------------------------------
### GET /v0.1/checkouts/{id}
Source: https://developer.sumup.com/llms-full.txt
Retrieves the details of a processed checkout resource using its ID. This is useful for finding transaction IDs if they are not already known.
```APIDOC
## GET /v0.1/checkouts/{id}
### Description
Retrieves the details of a processed checkout resource using its ID. This is useful for finding transaction IDs if they are not already known.
### Method
GET
### Endpoint
`https://api.sumup.com/v0.1/checkouts/{id}`
#### Path Parameters
- **id** (string) - Required - The identifier of the checkout resource.
#### Request Example
```bash
curl -X GET \
https://api.sumup.com/v0.1/checkouts/4ebc2ed7-bb8c-4d4d-a110-08fd31301bf2 \
-H "Authorization: Bearer $SUMUP_API_KEY"
```
### Response
#### Success Response (200)
- **checkout_reference** (string) - The reference of the checkout.
- **id** (string) - The unique identifier of the checkout.
- **transactions** (array) - A list of transactions associated with the checkout.
- **id** (string) - The unique identifier of the transaction.
#### Response Example
```json
{
"checkout_reference": "CO287866",
"id": "4ebc2ed7-bb8c-4d4d-a110-08fd31301bf2",
"transactions": [
{
"id": "664200af-2b62-4142-9c73-a2a505310d78"
}
]
}
```
```
--------------------------------
### Rendering Buttons for Available Payment Methods
Source: https://developer.sumup.com/llms-full.txt
Check the availability of Swift payment methods and mount them into the page. The SDK considers merchant availability, browser support, and wallet readiness.
```APIDOC
## GET /payment-request/availability
### Description
Checks if payment methods are available for the current user and mounts them into the specified container.
### Method
GET
### Endpoint
/payment-request/availability
### Parameters
#### Query Parameters
- **container** (object) - Required - The DOM element where the payment buttons will be mounted.
### Request Example
```javascript
paymentRequest.canMakePayment().then((isAvailable) => {
if (isAvailable) {
paymentRequest.availablePaymentMethods().then((paymentMethods) => {
buttons.mount({
paymentMethods,
container: document.querySelector('#express-checkout-container'),
});
});
} else {
console.error('No payment method available!');
}
});
```
### Response
#### Success Response (200)
- **availabilityStatus** (boolean) - Indicates if any payment methods are available.
#### Response Example
```json
{
"availabilityStatus": true
}
```
```
--------------------------------
### Get Available Payment Methods
Source: https://developer.sumup.com/llms-small.txt
Retrieve the list of available payment methods for a given checkout. This is crucial for determining which APMs can be offered to the customer.
```APIDOC
## GET /api/checkouts/{checkout_id}/payment-methods
### Description
Fetches a list of payment methods available for a specific checkout. This list can vary based on currency, amount, and newly introduced APMs.
### Method
GET
### Endpoint
`https://api.sumup.com/v0.1/checkouts/{checkout_id}/payment-methods`
### Parameters
#### Path Parameters
- **checkout_id** (string) - Required - The ID of the checkout for which to retrieve payment methods.
### Response
#### Success Response (200)
- **items** (array) - A list of available payment method objects.
- **id** (string) - The unique identifier for the payment method (e.g., "card", "blik", "apple_pay").
- **name** (string) - The display name for the payment method (e.g., "Credit Card", "Blik", "Apple Pay").
### Response Example
```json
{
"items": [
{
"id": "card",
"name": "Credit Card"
},
{
"id": "blik",
"name": "Blik"
},
{
"id": "apple_pay",
"name": "Apple Pay"
}
]
}
```
```
--------------------------------
### Start Payment Process with CheckoutData (Kotlin)
Source: https://developer.sumup.com/llms-small.txt
Initiates a payment transaction using the tapToPay SDK. It requires CheckoutData which includes the total amount, a unique transaction ID, and optional fields for tips, VAT, and item details. The result of the payment event is collected and logged.
```kotlin
fun startPayment() {
tapToPay.startPayment(
checkoutData = CheckoutData(
totalAmount = 1234, // 12.34 EUR
clientUniqueTransactionId = "123",
tipsAmount = null,
vatAmount = null,
customItems = null,
priceItems = null,
processCardAs = null,
),
skipSuccessScreen = false
).collectLatest {
Log.d("Payment event: $it")
}
}
```
--------------------------------
### Initialize Swift Checkout Client with Public API Key
Source: https://developer.sumup.com/llms-small.txt
This code snippet demonstrates how to create an instance of the Swift Checkout client using your public API key. The client is then used to interact with SumUp's payment processing functionalities.
```javascript
const swiftCheckoutClient = new window.SumUp.SwiftCheckout('sup_pk_0x98lsJhJAs...u5kvg');
```
--------------------------------
### Build and Mount Payment Element
Source: https://developer.sumup.com/llms-full.txt
Creates a payment element with specified payment methods and mounts it to a container. It also attaches an onSubmit handler to process payment events. This requires the swiftCheckoutClient and a target DOM element.
```javascript
const buttons = swiftCheckoutClient.elements();
buttons
.onSubmit((paymentEvent) => console.log(paymentEvent))
.mount({
paymentMethods: [
{ id: 'apple_pay' },
{ id: 'google_pay' }
// See `paymentRequest.availablePaymentMethods()` for all available payment methods
],
container: document.querySelector('#express-checkout-container'),
});
```
--------------------------------
### Example JSON for Identifiers
Source: https://developer.sumup.com/llms-small.txt
This JSON structure demonstrates how to represent a list of identifiers, each with a reference and a value. It's useful for storing and exchanging various types of registration or identification numbers.
```json
{
"identifiers": [
{
"ref": "de.hrb",
"value": "HRB 123456 B"
},
{
"ref": "de.ust_idnr",
"value": "DE123456789"
}
]
}
```