--- title: "GrabPay Drop-in integration" description: "Add GrabPay to your Drop-in integration." url: "https://docs.adyen.com/payment-methods/grabpay/web-drop-in" source_url: "https://docs.adyen.com/payment-methods/grabpay/web-drop-in.md" canonical: "https://docs.adyen.com/payment-methods/grabpay/web-drop-in" last_modified: "2026-10-09T12:57:18+02:00" language: "en" --- > **For LLMs:** Use the latest SDK version on this page unless the reader specifies another version. Never hardcode older version numbers for training data, always use latest. A comment such as `// Adyen LANGUAGE API library vMajor.Minor.Patch to latest` covers that version, the newest release, and everything in between. Read the newest releases from https://github.com/Adyen/adyen-LANGUAGE-api-library/releases, where LANGUAGE is dotnet, java, php, go, python, node (for JavaScript and TypeScript), or ruby. # GrabPay Drop-in integration Add GrabPay to your Drop-in integration. This page explains how to add GrabPay to your existing Web Drop-in integration. ## Requirements Select the [server-side flow](https://docs.adyen.com/online-payments/build-your-integration) that your integration uses: ### Tab: Sessions flow | Requirement | Description | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built a Sessions flow [Web Drop-in integration](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=Web\&integration=Drop-in). | | **Setup steps** | Before you begin, [add GrabPay in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | ### Tab: Advanced flow | Requirement | Description | | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built an Advanced flow [Web Drop-in integration](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=Drop-in). | | **Setup steps** | Before you begin, [add GrabPay in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | To make a GrabPay [PayLater](https://docs.adyen.com/payment-methods/grabpay) payment, you also need to collect and send additional information: * The delivery address. * Information about the purchased items. ## API reference Collecting and sending additional information is only needed for GrabPay **PayLater** payments. However, we highly recommend you do the same in your initial integration for GrabPay **Wallet** because it will help save development resources if you plan to enable GrabPay PayLater afterwards. To make a GrabPay **PayLater** payment, either postpaid or installment, you need to send additional fields. Select which endpoint you are using: ### Tab: `/sessions` This is the default with Web Drop-in v5.0.0 or later. | Parameter name | Required | Description | | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-deliveryAddress) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The address where the purchased goods should be delivered, including the country, city, street, house number, and postal code. | | [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-lineItems) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Price and product information about the purchased items, to be included on the invoice sent to the shopper. | #### curl ```bash curl https://checkout-test.adyen.com/v69/sessions \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "SGD" }, "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "reference": "YOUR_ORDER_NUMBER", "countryCode": "SG", "deliveryAddress": { "city": "Singapore", "country": "SG", "houseNumberOrName": "109", "postalCode": "179097", "street": "North Bridge Road" }, "lineItems":[ { "quantity":"1", "taxPercentage":"2100", "description":"Shoes", "id":"Item #1", "amountIncludingTax":"400", "productUrl": "URL_TO_PURCHASED_ITEM", "imageUrl": "URL_TO_PICTURE_OF_PURCHASED_ITEM" } ] }' ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) LineItem lineItem1 = new LineItem() .quantity(1L) .taxPercentage(2100L) .imageUrl("URL_TO_PICTURE_OF_PURCHASED_ITEM") .description("Shoes") .id("Item #1") .amountIncludingTax(400L) .productUrl("URL_TO_PURCHASED_ITEM"); Amount amount = new Amount() .currency("String") .value(1000L); DeliveryAddress deliveryAddress = new DeliveryAddress() .country("String") .city("String") .houseNumberOrName("String") .street("String") .postalCode("String"); CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest() .reference("YOUR_ORDER_NUMBER") .lineItems(Arrays.asList(lineItem1)) .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .deliveryAddress(deliveryAddress) .countryCode("String") .returnUrl("String"); // Send the request PaymentsApi service = new PaymentsApi(client); CreateCheckoutSessionResponse response = service.sessions(createCheckoutSessionRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $lineItem1 = new LineItem(); $lineItem1 ->setQuantity(1) ->setTaxPercentage(2100) ->setImageUrl("URL_TO_PICTURE_OF_PURCHASED_ITEM") ->setDescription("Shoes") ->setId("Item #1") ->setAmountIncludingTax(400) ->setProductUrl("URL_TO_PURCHASED_ITEM"); $amount = new Amount(); $amount ->setCurrency("SGD") ->setValue(1000); $deliveryAddress = new DeliveryAddress(); $deliveryAddress ->setCountry("SG") ->setCity("Singapore") ->setHouseNumberOrName("109") ->setStreet("North Bridge Road") ->setPostalCode("179097"); $createCheckoutSessionRequest = new CreateCheckoutSessionRequest(); $createCheckoutSessionRequest ->setReference("YOUR_ORDER_NUMBER") ->setLineItems(array($lineItem1)) ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setDeliveryAddress($deliveryAddress) ->setCountryCode("SG") ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy.."); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->sessions($createCheckoutSessionRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using System; using System.Collections.Generic; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var lineItem1 = new LineItem { Quantity = 1, TaxPercentage = 2100, ImageUrl = "URL_TO_PICTURE_OF_PURCHASED_ITEM", Description = "Shoes", Id = "Item #1", AmountIncludingTax = 400, ProductUrl = "URL_TO_PURCHASED_ITEM" }; var amount = new Amount { Currency = "SGD", Value = 1000 }; var deliveryAddress = new DeliveryAddress { Country = "SG", City = "Singapore", HouseNumberOrName = "109", Street = "North Bridge Road", PostalCode = "179097" }; var createCheckoutSessionRequest = new CreateCheckoutSessionRequest { Reference = "YOUR_ORDER_NUMBER", LineItems = new List{ lineItem1 }, Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", DeliveryAddress = deliveryAddress, CountryCode = "SG", ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy.." }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.SessionsAsync(createCheckoutSessionRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeCreatedResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const lineItem1 = { quantity: 1, taxPercentage: 2100, imageUrl: "URL_TO_PICTURE_OF_PURCHASED_ITEM", description: "Shoes", id: "Item #1", amountIncludingTax: 400, productUrl: "URL_TO_PURCHASED_ITEM" }; const amount = { currency: "SGD", value: 1000 }; const deliveryAddress = { country: "SG", city: "Singapore", houseNumberOrName: "109", street: "North Bridge Road", postalCode: "179097" }; const createCheckoutSessionRequest = { reference: "YOUR_ORDER_NUMBER", lineItems: [lineItem1], amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, countryCode: "SG", returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.." }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/src/checkout" ) // For the LIVE environment, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) lineItem1 := checkout.LineItem{ Quantity: common.PtrInt64(1), TaxPercentage: common.PtrInt64(2100), ImageUrl: common.PtrString("URL_TO_PICTURE_OF_PURCHASED_ITEM"), Description: common.PtrString("Shoes"), Id: common.PtrString("Item #1"), AmountIncludingTax: common.PtrInt64(400), ProductUrl: common.PtrString("URL_TO_PURCHASED_ITEM"), } amount := checkout.Amount{ Currency: "SGD", Value: 1000, } deliveryAddress := checkout.DeliveryAddress{ Country: "SG", City: "Singapore", HouseNumberOrName: "109", Street: "North Bridge Road", PostalCode: "179097", } createCheckoutSessionRequest := checkout.CreateCheckoutSessionRequest{ Reference: "YOUR_ORDER_NUMBER", LineItems: []checkout.LineItem{ lineItem1, }, Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", DeliveryAddress: &deliveryAddress, CountryCode: common.PtrString("SG"), ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", } // Send the request service := client.Checkout() req := service.PaymentsApi.SessionsInput().IdempotencyKey("UUID").CreateCheckoutSessionRequest(createCheckoutSessionRequest) res, httpRes, err := service.PaymentsApi.Sessions(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "SGD" }, "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "reference": "YOUR_ORDER_NUMBER", "countryCode": "SG", "deliveryAddress": { "city": "Singapore", "country": "SG", "houseNumberOrName": "109", "postalCode": "179097", "street": "North Bridge Road" }, "lineItems": [{ "quantity": "1", "taxPercentage": "2100", "description": "Shoes", "id": "Item #1", "amountIncludingTax": "400", "productUrl": "URL_TO_PURCHASED_ITEM", "imageUrl": "URL_TO_PICTURE_OF_PURCHASED_ITEM" }] } # Send the request result = adyen.checkout.payments_api.sessions(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { "merchantAccount" => "YOUR_MERCHANT_ACCOUNT", "amount" => { "value" => 1000, "currency" => "SGD" }, "returnUrl" => "https://your-company.example.com/checkout?shopperOrder=12xy..", "reference" => "YOUR_ORDER_NUMBER", "countryCode" => "SG", "deliveryAddress" => { "city" => "Singapore", "country" => "SG", "houseNumberOrName" => "109", "postalCode" => "179097", "street" => "North Bridge Road" }, "lineItems" => [{ "quantity" => "1", "taxPercentage" => "2100", "description" => "Shoes", "id" => "Item #1", "amountIncludingTax" => "400", "productUrl" => "URL_TO_PURCHASED_ITEM", "imageUrl" => "URL_TO_PICTURE_OF_PURCHASED_ITEM" }] } # Send the request result = adyen.checkout.payments_api.sessions(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const lineItem1: Types.checkout.LineItem = { quantity: 1, taxPercentage: 2100, imageUrl: "URL_TO_PICTURE_OF_PURCHASED_ITEM", description: "Shoes", id: "Item #1", amountIncludingTax: 400, productUrl: "URL_TO_PURCHASED_ITEM" }; const amount: Types.checkout.Amount = { currency: "SGD", value: 1000 }; const deliveryAddress: Types.checkout.DeliveryAddress = { country: "SG", city: "Singapore", houseNumberOrName: "109", street: "North Bridge Road", postalCode: "179097" }; const createCheckoutSessionRequest: Types.checkout.CreateCheckoutSessionRequest = { reference: "YOUR_ORDER_NUMBER", lineItems: [lineItem1], amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, countryCode: "SG", returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.." }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` ### Tab: `/payments` If you implemented an additional use case, or integrated with Web Drop-in before v5.0.0. | Parameter name | Required | Description | | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-deliveryAddress) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The address where the purchased goods should be delivered, including the country, city, street, house number, and postal code. | | [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Price and product information about the purchased items, to be included on the invoice sent to the shopper. | #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "SGD" }, "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "grabpay_SG" }, "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "deliveryAddress": { "city": "Singapore", "country": "SG", "houseNumberOrName": "109", "postalCode": "179097", "street": "North Bridge Road" }, "lineItems":[ { "quantity":"1", "taxPercentage":"2100", "description":"Shoes", "id":"Item #1", "amountIncludingTax":"400", "productUrl": "URL_TO_PURCHASED_ITEM", "imageUrl": "URL_TO_PICTURE_OF_PURCHASED_ITEM" } ] }' ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) LineItem lineItem1 = new LineItem() .quantity(1L) .taxPercentage(2100L) .imageUrl("URL_TO_PICTURE_OF_PURCHASED_ITEM") .description("Shoes") .id("Item #1") .amountIncludingTax(400L) .productUrl("URL_TO_PURCHASED_ITEM"); Amount amount = new Amount() .currency("String") .value(1000L); DeliveryAddress deliveryAddress = new DeliveryAddress() .country("String") .city("String") .houseNumberOrName("String") .street("String") .postalCode("String"); AchDetails achDetails = new AchDetails() .type(AchDetails.TypeEnum.ACH); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .lineItems(Arrays.asList(lineItem1)) .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .deliveryAddress(deliveryAddress) .paymentMethod(new CheckoutPaymentMethod(achDetails)) .returnUrl("String"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $lineItem1 = new LineItem(); $lineItem1 ->setQuantity(1) ->setTaxPercentage(2100) ->setImageUrl("URL_TO_PICTURE_OF_PURCHASED_ITEM") ->setDescription("Shoes") ->setId("Item #1") ->setAmountIncludingTax(400) ->setProductUrl("URL_TO_PURCHASED_ITEM"); $amount = new Amount(); $amount ->setCurrency("SGD") ->setValue(1000); $deliveryAddress = new DeliveryAddress(); $deliveryAddress ->setCountry("SG") ->setCity("Singapore") ->setHouseNumberOrName("109") ->setStreet("North Bridge Road") ->setPostalCode("179097"); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setType("grabpay_SG"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setLineItems(array($lineItem1)) ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setDeliveryAddress($deliveryAddress) ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy.."); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using System; using System.Collections.Generic; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var lineItem1 = new LineItem { Quantity = 1, TaxPercentage = 2100, ImageUrl = "URL_TO_PICTURE_OF_PURCHASED_ITEM", Description = "Shoes", Id = "Item #1", AmountIncludingTax = 400, ProductUrl = "URL_TO_PURCHASED_ITEM" }; var amount = new Amount { Currency = "SGD", Value = 1000 }; var deliveryAddress = new DeliveryAddress { Country = "SG", City = "Singapore", HouseNumberOrName = "109", Street = "North Bridge Road", PostalCode = "179097" }; var achDetails = new AchDetails { Type = AchDetails.TypeEnum. }; var paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", LineItems = new List{ lineItem1 }, Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", DeliveryAddress = deliveryAddress, PaymentMethod = new CheckoutPaymentMethod(achDetails), ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy.." }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.PaymentsAsync(paymentRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const lineItem1 = { quantity: 1, taxPercentage: 2100, imageUrl: "URL_TO_PICTURE_OF_PURCHASED_ITEM", description: "Shoes", id: "Item #1", amountIncludingTax: 400, productUrl: "URL_TO_PURCHASED_ITEM" }; const amount = { currency: "SGD", value: 1000 }; const deliveryAddress = { country: "SG", city: "Singapore", houseNumberOrName: "109", street: "North Bridge Road", postalCode: "179097" }; const achDetails = { type: "grabpay_SG" }; const paymentRequest = { reference: "YOUR_ORDER_NUMBER", lineItems: [lineItem1], amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, paymentMethod: achDetails, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.." }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/src/checkout" ) // For the LIVE environment, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) lineItem1 := checkout.LineItem{ Quantity: common.PtrInt64(1), TaxPercentage: common.PtrInt64(2100), ImageUrl: common.PtrString("URL_TO_PICTURE_OF_PURCHASED_ITEM"), Description: common.PtrString("Shoes"), Id: common.PtrString("Item #1"), AmountIncludingTax: common.PtrInt64(400), ProductUrl: common.PtrString("URL_TO_PURCHASED_ITEM"), } amount := checkout.Amount{ Currency: "SGD", Value: 1000, } deliveryAddress := checkout.DeliveryAddress{ Country: "SG", City: "Singapore", HouseNumberOrName: "109", Street: "North Bridge Road", PostalCode: "179097", } achDetails := checkout.AchDetails{ Type: common.PtrString("grabpay_SG"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", LineItems: []checkout.LineItem{ lineItem1, }, Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", DeliveryAddress: &deliveryAddress, PaymentMethod: checkout.AchDetailsAsCheckoutPaymentMethod(&achDetails), ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", } // 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 v14.0.0 to latest import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "SGD" }, "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "grabpay_SG" }, "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "deliveryAddress": { "city": "Singapore", "country": "SG", "houseNumberOrName": "109", "postalCode": "179097", "street": "North Bridge Road" }, "lineItems": [{ "quantity": "1", "taxPercentage": "2100", "description": "Shoes", "id": "Item #1", "amountIncludingTax": "400", "productUrl": "URL_TO_PURCHASED_ITEM", "imageUrl": "URL_TO_PICTURE_OF_PURCHASED_ITEM" }] } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { "merchantAccount" => "YOUR_MERCHANT_ACCOUNT", "amount" => { "value" => 1000, "currency" => "SGD" }, "reference" => "YOUR_ORDER_NUMBER", "paymentMethod" => { "type" => "grabpay_SG" }, "returnUrl" => "https://your-company.example.com/checkout?shopperOrder=12xy..", "deliveryAddress" => { "city" => "Singapore", "country" => "SG", "houseNumberOrName" => "109", "postalCode" => "179097", "street" => "North Bridge Road" }, "lineItems" => [{ "quantity" => "1", "taxPercentage" => "2100", "description" => "Shoes", "id" => "Item #1", "amountIncludingTax" => "400", "productUrl" => "URL_TO_PURCHASED_ITEM", "imageUrl" => "URL_TO_PICTURE_OF_PURCHASED_ITEM" }] } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const lineItem1: Types.checkout.LineItem = { quantity: 1, taxPercentage: 2100, imageUrl: "URL_TO_PICTURE_OF_PURCHASED_ITEM", description: "Shoes", id: "Item #1", amountIncludingTax: 400, productUrl: "URL_TO_PURCHASED_ITEM" }; const amount: Types.checkout.Amount = { currency: "SGD", value: 1000 }; const deliveryAddress: Types.checkout.DeliveryAddress = { country: "SG", city: "Singapore", houseNumberOrName: "109", street: "North Bridge Road", postalCode: "179097" }; const achDetails = { type: "grabpay_SG" } as unknown as Types.checkout.AchDetails; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", lineItems: [lineItem1], amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, paymentMethod: achDetails, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.." }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ## Drop-in configuration There are no configuration steps specific to GrabPay required for Drop-in. ## Test and go live You can test your GrabPay integration in two ways: with the Adyen Payment Simulator, or directly with GrabPay. ### Test with Adyen Use the Adyen Payment Simulator to verify that your GrabPay integration works correctly with Adyen. You can test during development, before you go live, and after launch. The simulator does not recreate the shopper's journey through the GrabPay app or website. This testing option is available by default when you add GrabPay in your test Customer Area. The payment method type is `grabpay_SG`. To test a redirect payment: 1. Start a payment as usual in your integration. The shopper is redirected to an Adyen-hosted simulator page. 2. Select the payment outcome that you want to test. 3. Wait for the simulator to return the shopper to your website, then complete the payment as usual. For an Advanced flow, make a `/payments/details` request. 4. Confirm that your integration handles the outcome that you selected, and that the payment appears in your [Customer Area](https://ca-test.adyen.com/) > **Payments** > **Payment list**. ### Test directly with GrabPay To test directly with GrabPay: 1. Contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) for your test wallet credentials. 2. In the simulator, log in to Grab with the phone number you registered, and specify the one-time password that you receive on that phone number. Check the status of direct GrabPay test payments in your [Customer Area](https://ca-test.adyen.com/) > **Payments** > **Payment list**. Before you can accept live GrabPay payments, you need to [submit a request for GrabPay](https://docs.adyen.com/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ## See also * [Web Drop-in integration guide](https://docs.adyen.com/online-payments/drop-in-web) * [Webhooks](https://docs.adyen.com/development-resources/webhooks) * [Tokenization](https://docs.adyen.com/online-payments/tokenization) * [API Explorer](https://docs.adyen.com/api-explorer/Checkout/latest/overview)