--- title: "Samsung Pay for API only" description: "Accept Samsung Pay payments with your existing API-only integration." url: "https://docs.adyen.com/payment-methods/samsung-pay/samsung-pay-api" source_url: "https://docs.adyen.com/payment-methods/samsung-pay/samsung-pay-api.md" canonical: "https://docs.adyen.com/payment-methods/samsung-pay/samsung-pay-api" last_modified: "2026-05-26T13:48:55+02:00" language: "en" --- # Samsung Pay for API only Accept Samsung Pay payments with your existing API-only integration. [View source](/payment-methods/samsung-pay/samsung-pay-api.md) Accept Samsung 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 built an [API-only integration](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=API%20only). | | **Setup steps** | Before you begin, [add in your test Customer Area](/payment-methods/add-payment-methods). | ## Preparation 1. [Request for a CSR](/payment-methods/samsung-pay/enable-samsung-pay#generate-csr) from Adyen. 2. [Sign up for a Samsung Pay Developer account](/payment-methods/samsung-pay/enable-samsung-pay#create-developer-account). 3. [Set Adyen as your payment gateway](/payment-methods/samsung-pay/enable-samsung-pay#set-payment-gateway). 4. [Integrate the Samsung Pay SDK](/payment-methods/samsung-pay/enable-samsung-pay#integrate-samsung-pay-sdk). 5. Contact Adyen's [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to configure the compatible card schemes (Visa, Mastercard, Maestro, Amex, and Discover) for SamsungPay on your merchant account. ## Build your payment form for Samsung Pay Check if the Samsung Pay app is available in the shopper's device, and then show Samsung Pay as an available payment method. We provide logos for Samsung Pay which you can use on your payment form. For more information, refer to [Downloading logos](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only#downloading-logos). You can also submit a [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request specifying: * [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods): Any supported country/region. For example, **GB**. * [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount): Any supported currency. For example, **GBP**. In the response, you receive `paymentMethod.type`: **samsungpay**. ## Make a payment When the shopper selects to pay with Samsung Pay: 1. Get the tokenized payment information from the Samsung Pay SDK. For more information, see [Samsung Pay SDK Programming Guide](https://pay.samsung.com/developers) under **Resources**. In the guide, look for a sample of the `paymentCredential` output. 2. From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request providing: * `paymentMethod.type`: **samsungpay** * `paymentMethod.samsungPayToken`: The payload you received from the Samsung Pay SDK response. This is the complete base64-encoded token, not just the `3DS.data`. #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount":"ADYEN_MERCHANT_ACCOUNT", "reference":"YOUR_ORDER_NUMBER", "amount":{ "currency":"EUR", "value":1000 }, "paymentMethod":{ "type":"samsungpay", "{hint:Payload from Samsung Pay SDK response}samsungPayToken{/hint}":"eyJyZXN1bHRDb2RlIjoiMC=..." } }' ``` #### Java ```java // Adyen Java API Library v27.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the live environment, additionally include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); SamsungPayDetails samsungPayDetails = new SamsungPayDetails() .type(SamsungPayDetails.TypeEnum.SAMSUNGPAY) .samsungPayToken("eyJyZXN1bHRDb2RlIjoiMC=..."); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(samsungPayDetails)); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v19.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\CheckoutPaymentMethod; use Adyen\Model\Checkout\PaymentRequest; use Adyen\Service\Checkout\PaymentsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); // For the live environment, additionally include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setType("samsungpay") ->setSamsungPayToken("eyJyZXN1bHRDb2RlIjoiMC=..."); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v17.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the live environment, additionally include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) Amount amount = new Amount { Currency = "EUR", Value = 1000 }; SamsungPayDetails samsungPayDetails = new SamsungPayDetails { Type = SamsungPayDetails.TypeEnum.Samsungpay, SamsungPayToken = "eyJyZXN1bHRDb2RlIjoiMC=..." }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(samsungPayDetails) }; // Send the request var service = new PaymentsService(client); var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const paymentRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", reference: "YOUR_ORDER_NUMBER", amount: { currency: "EUR", value: 1000 }, paymentMethod: { type: "samsungpay", samsungPayToken: "eyJyZXN1bHRDb2RlIjoiMC=..." } } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.4.0 import ( "context" "github.com/adyen/adyen-go-api-library/v9/src/common" "github.com/adyen/adyen-go-api-library/v9/src/adyen" "github.com/adyen/adyen-go-api-library/v9/src/checkout" ) // For the live environment, additionally include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 1000, } samsungPayDetails := checkout.SamsungPayDetails{ Type: common.PtrString("samsungpay"), SamsungPayToken: "eyJyZXN1bHRDb2RlIjoiMC=...", } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", PaymentMethod: checkout.SamsungPayDetailsAsCheckoutPaymentMethod(&samsungPayDetails), } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v12.5.1 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "reference": "YOUR_ORDER_NUMBER", "amount": { "currency": "EUR", "value": 1000 }, "paymentMethod": { "type": "samsungpay", "samsungPayToken": "eyJyZXN1bHRDb2RlIjoiMC=..." } } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :reference => 'YOUR_ORDER_NUMBER', :amount => { :currency => 'EUR', :value => 1000 }, :paymentMethod => { :type => 'samsungpay', :samsungPayToken => 'eyJyZXN1bHRDb2RlIjoiMC=...' } } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const samsungPayDetails: Types.checkout.SamsungPayDetails = { type: Types.checkout.SamsungPayDetails.TypeEnum.Samsungpay, samsungPayToken: "eyJyZXN1bHRDb2RlIjoiMC=..." }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", paymentMethod: samsungPayDetails }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains: * `resultCode` **/payments response** ```json { "pspReference": "882573482151437A", "resultCode": "Authorised", "merchantReference": "YOUR_ORDER_NUMBER" } ``` ## Present the payment result Use the `resultCode` that you received in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response to present the payment result to your shopper. The `resultCode` values you can receive for Samsung Pay are: | resultCode | Description | Action to take | | -------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | **Authorised** | The payment was successful. | Inform the shopper that the payment has been successful. | | **Error** | There was an error when the payment was being processed. | Inform the shopper that there was an error processing their payment. The response contains a `refusalReason`, indicating the cause of the error. | | **Refused** | The payment was refused by the shopper's bank. | Ask the shopper to try the payment again using a different payment method. | ## Test and go live Samsung Pay will provide guidelines for testing. For more information, go to **Getting Started** > **Create Services** on the [Samsung Pay Developers](https://pay.samsung.com/developers/tour/svcguide) website. You can check the status of a Samsung Pay test payment in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**. Before you can accept live Samsung Pay payments, you need to submit a request for Samsung Pay in your [live Customer Area](https://ca-live.adyen.com/). ## See also * [Samsung Pay Developers](https://pay.samsung.com/developers) * [API only integration guide](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=API%20only) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)