{"title":"Gift cards for API only","category":"default","creationDate":1677152340,"content":"<div class=\"additional-info-block output-inline\">\n<div class=\"additional-info-block__body\"><p><img style=\"width: 25px;\" alt=\"\" src=\"\/user\/pages\/reuse\/development-resources\/additional-info-resources\/postman-logo-vertical-orange-2021.svg?decoding=auto&amp;fetchpriority=auto\" \/>&nbsp;&nbsp;<a href=\"https:\/\/www.postman.com\/adyendev\/workspace\/adyen-apis\/collection\/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Postman collection<\/a><\/p><p><strong>Implementation examples<\/strong><br \/><img style=\"width: 25px;\" alt=\"\" src=\"\/user\/pages\/reuse\/development-resources\/additional-info-resources\/java-original.svg?decoding=auto&amp;fetchpriority=auto\" \/>&nbsp;&nbsp;<a href=\"https:\/\/github.com\/adyen-examples\/adyen-java-spring-online-payments\/tree\/main\/giftcard-example\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Java Spring<\/a><br \/><img style=\"width: 25px;\" alt=\"\" src=\"\/user\/pages\/reuse\/development-resources\/additional-info-resources\/dot-net-original.svg?decoding=auto&amp;fetchpriority=auto\" \/>&nbsp;&nbsp;<a href=\"https:\/\/github.com\/adyen-examples\/adyen-dotnet-online-payments\/tree\/main\/giftcard-example\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">.NET<\/a><br \/><img style=\"width: 25px;\" alt=\"\" src=\"\/user\/pages\/reuse\/development-resources\/additional-info-resources\/nodejs-original.svg?decoding=auto&amp;fetchpriority=auto\" \/>&nbsp;&nbsp;<a href=\"https:\/\/github.com\/adyen-examples\/adyen-node-online-payments\/tree\/main\/giftcard-example\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Node.js<\/a><\/p><\/div><\/div>\n\n<p>Accept gift card payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.<\/p>\n<h2>Requirements<\/h2>\n<p>These instructions explain how to add gift cards to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only&amp;version=71\">API-only integration guide<\/a>.<\/p>\n<p>Before starting your integration make sure you:<\/p>\n<ol>\n<li><a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only&amp;version=71#get-available-payment-methods\">Set up your back end implementation<\/a>.<\/li>\n<li>\n<p><a href=\"\/pt\/payment-methods\/add-payment-methods\">Added each gift card variant that you want to test in your Customer Area<\/a>.<\/p>\n<div class=\"notices blue\">\n<p>You can <a href=\"#test-and-go-live\">test<\/a> a limited number of gift card variants and simulate gift card payments. When testing, you use a simulator that tries to behave and respond in the same way as an end-to-end connection with a gift card provider. Before you go live, you must onboard with a gift card provider and add the gift card variant to your live <a href=\"\/pt\/payment-methods\/add-payment-methods\">Customer Area<\/a>.<\/p>\n<\/div>\n<\/li>\n<\/ol>\n<h2>Build your payment form for gift cards<\/h2>\n<p>You must build a separate integration for each gift card provider.<\/p>\n<p>You can process payments for <a href=\"\/pt\/payment-methods\/gift-cards#supported-gift-cards\">supported gift cards<\/a> or <a href=\"\/pt\/payment-methods\/gift-cards\/stored-value-api\">manage other transactions<\/a> like adding to the balance of a gift card.<\/p>\n<p>If you are using the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> request to show the available payment methods to your shopper, specify the following in your request:<\/p>\n<ul>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">countryCode<\/a>&#58; Country where that gift card is supported, for example, <span translate=\"no\"><strong>NL<\/strong><\/span>.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-amount\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.currency<\/a>&#58; Any supported currency, for example, <span translate=\"no\"><strong>EUR<\/strong><\/span>.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-channel\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">channel<\/a>&#58; Set to <span translate=\"no\"><strong>Web<\/strong><\/span>.<\/li>\n<\/ul>\n<p>In the response, you receive the gift cards available to your shopper as elements in the <code>paymentMethods<\/code> array, for example:<\/p>\n<pre><code class=\"language-bash\">    {\n        \"name\": \"VVV Giftcard\",\n        \"brand\": \"vvvgiftcard\",\n        \"type\": \"giftcard\"\n    }<\/code><\/pre>\n<p>Render <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#downloading-logos\">logos<\/a> and names of the available brands for the shopper to choose. When the shopper selects a type of gift card, show the payment form.<\/p>\n<h2>Check the balance<\/h2>\n<p>After the shopper enters the gift card details, check if the balance is enough to make a full payment.<\/p>\n<ol>\n<li>\n<p>Make a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\/balance\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods\/balance<\/a> request including:<\/p>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>paymentMethod.type<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The <code>brand<\/code> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> response. For example, <span translate=\"no\"><strong>givex<\/strong><\/span>.<\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethod.number<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The gift card number.<\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethod.cvc<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The card verification code or security code.<\/td>\n<\/tr>\n<tr>\n<td><code>merchantAccount<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>Your merchant account.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/paymentMethods\/balance request'\" :id=\"'paymentmethods-balance-request-2633995390'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/paymentMethods\\\/balance \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n \\&quot;paymentMethod\\&quot;: {\\n   \\&quot;type\\&quot;: \\&quot;givex\\&quot;,\\n   \\&quot;number\\&quot;: \\&quot;6364530000000000\\&quot;,\\n   \\&quot;cvc\\&quot;: \\&quot;737\\&quot;\\n },\\n \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v27.0.0\\nimport com.adyen.Client;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.checkout.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.model.RequestOptions;\\nimport com.adyen.service.checkout.*;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\nBalanceCheckRequest balanceCheckRequest = new BalanceCheckRequest()\\n  .merchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  .paymentMethod(new HashMap&lt;String, String&gt;(Map.of(\\n    \\&quot;number\\&quot;, \\&quot;6364530000000000\\&quot;,\\n    \\&quot;cvc\\&quot;, \\&quot;737\\&quot;,\\n    \\&quot;type\\&quot;, \\&quot;givex\\&quot;\\n  )));\\n\\n\\\/\\\/ Send the request\\nOrdersApi service = new OrdersApi(client);\\nBalanceCheckResponse response = service.getBalanceOfGiftCard(balanceCheckRequest, new RequestOptions().idempotencyKey(\\&quot;UUID\\&quot;));&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen PHP API Library v19.0.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\Checkout\\\\BalanceCheckRequest;\\nuse Adyen\\\\Service\\\\Checkout\\\\OrdersApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$balanceCheckRequest = new BalanceCheckRequest();\\n$balanceCheckRequest\\n  -&gt;setMerchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  -&gt;setPaymentMethod(\\n    array(\\n      \\&quot;number\\&quot; =&gt; \\&quot;6364530000000000\\&quot;,\\n      \\&quot;cvc\\&quot; =&gt; \\&quot;737\\&quot;,\\n      \\&quot;type\\&quot; =&gt; \\&quot;givex\\&quot;\\n    )\\n  );\\n\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Send the request\\n$service = new OrdersApi($client);\\n$response = $service-&gt;getBalanceOfGiftCard($balanceCheckRequest, $requestOptions);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .net API Library v17.0.0\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.Checkout;\\nusing Adyen.Service.Checkout;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nvar config = new Config()\\n{\\n    XApiKey = \\&quot;ADYEN_API_KEY\\&quot;,\\n    Environment = Environment.Test\\n};\\nvar client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nBalanceCheckRequest balanceCheckRequest = new BalanceCheckRequest\\n{\\n  MerchantAccount = \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  PaymentMethod = new Dictionary&lt;string, string&gt;\\n  {\\n\\n    { \\&quot;number\\&quot;, \\&quot;6364530000000000\\&quot; },\\n    { \\&quot;cvc\\&quot;, \\&quot;737\\&quot; },\\n    { \\&quot;type\\&quot;, \\&quot;givex\\&quot; }\\n  }\\n};\\n\\n\\\/\\\/ Send the request\\nvar service = new OrdersService(client);\\nvar response = service.GetBalanceOfGiftCard(balanceCheckRequest, requestOptions: new RequestOptions { IdempotencyKey = \\&quot;UUID\\&quot;});&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v18.0.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst balanceCheckRequest = {\\n  paymentMethod: {\\n    type: \\&quot;givex\\&quot;,\\n    number: \\&quot;6364530000000000\\&quot;,\\n    cvc: \\&quot;737\\&quot;\\n  },\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}\\n\\n\\\/\\\/ Send the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.OrdersApi.getBalanceOfGiftCard(balanceCheckRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v10.4.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/checkout\\&quot;\\n)\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Create the request object(s)\\nbalanceCheckRequest := checkout.BalanceCheckRequest{\\n  MerchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  PaymentMethod: &amp;map[string]string{\\n    \\&quot;number\\&quot;: \\&quot;6364530000000000\\&quot;,\\n    \\&quot;cvc\\&quot;: \\&quot;737\\&quot;,\\n    \\&quot;type\\&quot;: \\&quot;givex\\&quot;,\\n  },\\n}\\n\\n\\\/\\\/ Send the request\\nservice := client.Checkout()\\nreq := service.OrdersApi.GetBalanceOfGiftCardInput().IdempotencyKey(\\&quot;UUID\\&quot;).BalanceCheckRequest(balanceCheckRequest)\\nres, httpRes, err := service.OrdersApi.GetBalanceOfGiftCard(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v12.5.1\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Create the request object(s)\\njson_request = {\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;givex\\&quot;,\\n    \\&quot;number\\&quot;: \\&quot;6364530000000000\\&quot;,\\n    \\&quot;cvc\\&quot;: \\&quot;737\\&quot;\\n  },\\n  \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}\\n\\n# Send the request\\nresult = adyen.checkout.orders_api.get_balance_of_gift_card(request=json_request, idempotency_key=\\&quot;UUID\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v9.5.1\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'givex',\\n    :number =&gt; '6364530000000000',\\n    :cvc =&gt; '737'\\n  },\\n  :merchantAccount =&gt; 'ADYEN_MERCHANT_ACCOUNT'\\n}\\n\\n# Send the request\\nresult = adyen.checkout.orders_api.get_balance_of_gift_card(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v18.0.0\\n\\\/\\\/ Require the parts of the module you want to use\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst balanceCheckRequest: Types.checkout.BalanceCheckRequest = {\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  paymentMethod: {\\n    \\&quot;number\\&quot;: \\&quot;6364530000000000\\&quot;,\\n    \\&quot;cvc\\&quot;: \\&quot;737\\&quot;,\\n    \\&quot;type\\&quot;: \\&quot;givex\\&quot;\\n  }\\n};\\n\\n\\\/\\\/ Send the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.OrdersApi.getBalanceOfGiftCard(balanceCheckRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>The response includes the balance of the gift card.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/paymentMethods\/balance response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n  \\\"pspReference\\\": \\\"ZQXDPCQ8HXSKGK82\\\",\\n  \\\"resultCode\\\": \\\"Success\\\",\\n  \\\"balance\\\": {\\n    \\\"currency\\\": \\\"EUR\\\",\\n    \\\"value\\\": 5000\\n  }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>If the balance amount is equal to or greater than the full payment amount, then continue to <a href=\"#make-a-payment\">make a payment<\/a>.<\/p>\n<p>If the balance is less than the full payment amount, make an  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/orders\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/orders<\/a> request. This lets you create <a href=\"\/pt\/online-payments\/partial-payments\">partial payments<\/a>: a payment with the gift card, and a payment for the remaining amount using a different payment method.<\/p>\n<\/li>\n<\/ol>\n<h2 id=\"make-a-payment\">Make a payment<\/h2>\n<p>From your server, make a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request, specifying:<\/p>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>paymentMethod.type<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td><span translate=\"no\"><strong>giftcard<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethod.brand<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The <code>brand<\/code> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> response. For example, <span translate=\"no\"><strong>vvvgiftcard<\/strong><\/span> or <span translate=\"no\"><strong>genericgiftcard<\/strong><\/span>.<\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethod.number<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The gift card number without separators.<\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethod.cvc<\/code><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The card verification code.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"notices green\">\n<p>For some gift cards, there are regulatory limits on transaction amounts. Check with your gift card provider to learn if these limits affect you.<\/p>\n<\/div>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"''\" :id=\"'gift-card-payments-api'\" :code-data=\"[{&quot;language&quot;:&quot;json&quot;,&quot;tabTitle&quot;:&quot;JSON&quot;,&quot;content&quot;:[{&quot;name&quot;:&quot;request&quot;,&quot;content&quot;:&quot;{\\n  \\&quot;amount\\&quot;:{\\n    \\&quot;currency\\&quot;:\\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot;:1000\\n  },\\n  \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;giftcard\\&quot;,\\n    \\&quot;brand\\&quot;: \\&quot;givex\\&quot;,\\n    \\&quot;number\\&quot;: \\&quot;62805011000000000000\\&quot;,\\n    \\&quot;cvc\\&quot;: \\&quot;73737\\&quot;\\n  },\\n  \\&quot;merchantAccount\\&quot;:\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}&quot;},{&quot;name&quot;:&quot;response&quot;,&quot;content&quot;:&quot;{\\n  \\&quot;pspReference\\&quot;: \\&quot;851572424333194G\\&quot;,\\n  \\&quot;resultCode\\&quot;: \\&quot;Authorised\\&quot;,\\n  \\&quot;merchantReference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;\\n}&quot;}]},{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/payments \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n  \\&quot;amount\\&quot;:{\\n    \\&quot;currency\\&quot;:\\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot;:1000\\n  },\\n  \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;giftcard\\&quot;,\\n    \\&quot;brand\\&quot;: \\&quot;givex\\&quot;,\\n    \\&quot;number\\&quot;: \\&quot;62805011000000000000\\&quot;,\\n    \\&quot;cvc\\&quot;: \\&quot;73737\\&quot;\\n  },\\n  \\&quot;merchantAccount\\&quot;:\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v27.0.0\\nimport com.adyen.Client;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.checkout.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.model.RequestOptions;\\nimport com.adyen.service.checkout.*;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount()\\n  .currency(\\&quot;EUR\\&quot;)\\n  .value(1000L);\\n\\nCardDetails cardDetails = new CardDetails()\\n  .number(\\&quot;62805011000000000000\\&quot;)\\n  .cvc(\\&quot;73737\\&quot;)\\n  .type(CardDetails.TypeEnum.GIFTCARD)\\n  .brand(\\&quot;givex\\&quot;);\\n\\nPaymentRequest paymentRequest = new PaymentRequest()\\n  .reference(\\&quot;YOUR_ORDER_NUMBER\\&quot;)\\n  .amount(amount)\\n  .merchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  .paymentMethod(new CheckoutPaymentMethod(cardDetails));\\n\\n\\\/\\\/ Send the request\\nPaymentsApi service = new PaymentsApi(client);\\nPaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey(\\&quot;UUID\\&quot;));&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen PHP API Library v19.0.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\Checkout\\\\Amount;\\nuse Adyen\\\\Model\\\\Checkout\\\\CheckoutPaymentMethod;\\nuse Adyen\\\\Model\\\\Checkout\\\\PaymentRequest;\\nuse Adyen\\\\Service\\\\Checkout\\\\PaymentsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$amount = new Amount();\\n$amount\\n  -&gt;setCurrency(\\&quot;EUR\\&quot;)\\n  -&gt;setValue(1000);\\n\\n$checkoutPaymentMethod = new CheckoutPaymentMethod();\\n$checkoutPaymentMethod\\n  -&gt;setNumber(\\&quot;62805011000000000000\\&quot;)\\n  -&gt;setCvc(\\&quot;73737\\&quot;)\\n  -&gt;setType(\\&quot;giftcard\\&quot;)\\n  -&gt;setBrand(\\&quot;givex\\&quot;);\\n\\n$paymentRequest = new PaymentRequest();\\n$paymentRequest\\n  -&gt;setReference(\\&quot;YOUR_ORDER_NUMBER\\&quot;)\\n  -&gt;setAmount($amount)\\n  -&gt;setMerchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  -&gt;setPaymentMethod($checkoutPaymentMethod);\\n\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Send the request\\n$service = new PaymentsApi($client);\\n$response = $service-&gt;payments($paymentRequest, $requestOptions);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .net API Library v17.0.0\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.Checkout;\\nusing Adyen.Service.Checkout;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nvar config = new Config()\\n{\\n    XApiKey = \\&quot;ADYEN_API_KEY\\&quot;,\\n    Environment = Environment.Test\\n};\\nvar client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount\\n{\\n  Currency = \\&quot;EUR\\&quot;,\\n  Value = 1000\\n};\\n\\nCardDetails cardDetails = new CardDetails\\n{\\n  Number = \\&quot;62805011000000000000\\&quot;,\\n  Cvc = \\&quot;73737\\&quot;,\\n  Type = CardDetails.TypeEnum.Giftcard,\\n  Brand = \\&quot;givex\\&quot;\\n};\\n\\nPaymentRequest paymentRequest = new PaymentRequest\\n{\\n  Reference = \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount = amount,\\n  MerchantAccount = \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  PaymentMethod = new CheckoutPaymentMethod(cardDetails)\\n};\\n\\n\\\/\\\/ Send the request\\nvar service = new PaymentsService(client);\\nvar response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = \\&quot;UUID\\&quot;});&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v18.0.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst paymentRequest = {\\n  amount: {\\n    currency: \\&quot;EUR\\&quot;,\\n    value: 1000\\n  },\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  paymentMethod: {\\n    type: \\&quot;giftcard\\&quot;,\\n    brand: \\&quot;givex\\&quot;,\\n    number: \\&quot;62805011000000000000\\&quot;,\\n    cvc: \\&quot;73737\\&quot;\\n  },\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}\\n\\n\\\/\\\/ Send the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v10.4.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/checkout\\&quot;\\n)\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Create the request object(s)\\namount := checkout.Amount{\\n  Currency: \\&quot;EUR\\&quot;,\\n  Value: 1000,\\n}\\n\\ncardDetails := checkout.CardDetails{\\n  Number: common.PtrString(\\&quot;62805011000000000000\\&quot;),\\n  Cvc: common.PtrString(\\&quot;73737\\&quot;),\\n  Type: common.PtrString(\\&quot;giftcard\\&quot;),\\n  Brand: common.PtrString(\\&quot;givex\\&quot;),\\n}\\n\\npaymentRequest := checkout.PaymentRequest{\\n  Reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount: amount,\\n  MerchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&amp;cardDetails),\\n}\\n\\n\\\/\\\/ Send the request\\nservice := client.Checkout()\\nreq := service.PaymentsApi.PaymentsInput().IdempotencyKey(\\&quot;UUID\\&quot;).PaymentRequest(paymentRequest)\\nres, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v12.5.1\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Create the request object(s)\\njson_request = {\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot;: 1000\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;giftcard\\&quot;,\\n    \\&quot;brand\\&quot;: \\&quot;givex\\&quot;,\\n    \\&quot;number\\&quot;: \\&quot;62805011000000000000\\&quot;,\\n    \\&quot;cvc\\&quot;: \\&quot;73737\\&quot;\\n  },\\n  \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}\\n\\n# Send the request\\nresult = adyen.checkout.payments_api.payments(request=json_request, idempotency_key=\\&quot;UUID\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v9.5.1\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :amount =&gt; {\\n    :currency =&gt; 'EUR',\\n    :value =&gt; 1000\\n  },\\n  :reference =&gt; 'YOUR_ORDER_NUMBER',\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'giftcard',\\n    :brand =&gt; 'givex',\\n    :number =&gt; '62805011000000000000',\\n    :cvc =&gt; '73737'\\n  },\\n  :merchantAccount =&gt; 'ADYEN_MERCHANT_ACCOUNT'\\n}\\n\\n# Send the request\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v18.0.0\\n\\\/\\\/ Require the parts of the module you want to use\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst amount: Types.checkout.Amount = {\\n  currency: \\&quot;EUR\\&quot;,\\n  value: 1000\\n};\\n\\nconst cardDetails: Types.checkout.CardDetails = {\\n  number: \\&quot;62805011000000000000\\&quot;,\\n  cvc: \\&quot;73737\\&quot;,\\n  type: Types.checkout.CardDetails.TypeEnum.Giftcard,\\n  brand: \\&quot;givex\\&quot;\\n};\\n\\nconst paymentRequest: Types.checkout.PaymentRequest = {\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  amount: amount,\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  paymentMethod: cardDetails\\n};\\n\\n\\\/\\\/ Send the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> response contains:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/payments__resParam_pspReference\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">pspReference<\/a>: Our unique identifier for the transaction.<\/li>\n<li><code>resultCode<\/code>: Use this to <a href=\"#present-the-payment-result\">present the payment result to your shopper<\/a>.<\/li>\n<li><code>merchantReference<\/code>: The <code>reference<\/code> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request.<\/li>\n<\/ul>\n<h2>Show the payment result<\/h2>\n<p>Use the\u00a0 <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#responses-200-resultCode\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">resultCode<\/a> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> response to show the payment result to your shopper.<\/p>\n<p>You will also receive the outcome of the payment asynchronously in a <a href=\"\/pt\/development-resources\/webhooks\">webhook<\/a>. For gift card payments, you can receive the following <code>resultCode<\/code> values:<\/p>\n<table>\n<thead>\n<tr>\n<th>resultCode<\/th>\n<th>Description<\/th>\n<th>Action to take<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Authorised<\/strong><\/td>\n<td>The payment was successful.<\/td>\n<td>Inform the shopper that the payment has been successful. <br> If you are using <a href=\"\/pt\/online-payments\/capture#manual-capture\">manual capture<\/a>, you also need to <a href=\"\/pt\/online-payments\/capture\">capture<\/a> the payment.<\/td>\n<\/tr>\n<tr>\n<td><strong>Cancelled<\/strong><\/td>\n<td>The shopper cancelled the payment.<\/td>\n<td>Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.<\/td>\n<\/tr>\n<tr>\n<td><strong>Error<\/strong><\/td>\n<td>There was an error when the payment was being processed. For more information, check the <a href=\"\/pt\/development-resources\/refusal-reasons\">\n  <code>refusalReason<\/code>\n<\/a> field.<\/td>\n<td>Inform the shopper that there was an error processing their payment.<\/td>\n<\/tr>\n<tr>\n<td><strong>Refused<\/strong><\/td>\n<td>The payment was refused.  For more information, check the <a href=\"\/pt\/development-resources\/refusal-reasons\">\n  <code>refusalReason<\/code>\n<\/a> field.<\/td>\n<td>Ask the shopper to try the payment again using a different payment method.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>Before making live gift card payments, simulate transactions:<\/p>\n<ol>\n<li>\n<p>Test your integration using our <a href=\"\/pt\/development-resources\/test-cards-and-credentials\/alternative-payment-method-credentials#gift-cards\">test card numbers<\/a> depending on your gift card provider. When testing, you use a simulator that tries to behave and respond in the same way as an end-to-end connection.<\/p>\n<p>To simulate a scenario, send one of the following amounts in the test payment request:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Amount (last three digits)<\/th>\n<th style=\"text-align: left;\"><code>resultCode<\/code><\/th>\n<th style=\"text-align: left;\"><code>refusalReason<\/code><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">100<\/td>\n<td style=\"text-align: left;\">Authorised<\/td>\n<td style=\"text-align: left;\"><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">123<\/td>\n<td style=\"text-align: left;\">Refused<\/td>\n<td style=\"text-align: left;\">Refused<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">124<\/td>\n<td style=\"text-align: left;\">Refused<\/td>\n<td style=\"text-align: left;\">Not enough balance<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">125<\/td>\n<td style=\"text-align: left;\">Refused<\/td>\n<td style=\"text-align: left;\">Blocked Card<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">126<\/td>\n<td style=\"text-align: left;\">Refused<\/td>\n<td style=\"text-align: left;\">Expired Card<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">130<\/td>\n<td style=\"text-align: left;\">Error<\/td>\n<td style=\"text-align: left;\">Acquirer Error<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">134<\/td>\n<td style=\"text-align: left;\">Refused<\/td>\n<td style=\"text-align: left;\">Invalid Pin<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">135<\/td>\n<td style=\"text-align: left;\">Refused<\/td>\n<td style=\"text-align: left;\">Pin tries exceeded<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!--list separator-->\n<p>For example, send a payment amount with <strong>100<\/strong> as the last three digits, such as 1.00 or 11.00. This will result in an <strong>Authorised<\/strong> transaction.<\/p>\n<\/li>\n<li>\n<p>Check the status of test payments in your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">test Customer Area<\/a>\u00a0&gt;\u00a0<strong>Transactions<\/strong>\u00a0&gt;\u00a0<strong>Payments<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<p>When you are ready to go live:<\/p>\n<ol>\n<li>Onboard with a gift card provider and add the <a href=\"\/pt\/payment-methods\/gift-cards#supported-gift-cards\">gift card variant<\/a> to your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live Customer Area<\/a>.<\/li>\n<li>\n<p>Contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a> to add the gift card to your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live Customer Area<\/a>.<\/p>\n<p><div class=\"sc-notice info\"><div>You can test end-to-end scenarios in your live environment using real gift card details and small amounts.<\/div><\/div><\/p>\n<\/li>\n<\/ol>\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/online-payments\/api-only\"\n                        target=\"_self\"\n                        >\n                    API-only integration guide\n                <\/a><\/li><li><a href=\"\/development-resources\/webhooks\"\n                        target=\"_self\"\n                        >\n                    Webhooks\n                <\/a><\/li><li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/overview\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    API Explorer\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/gift-cards\/api-only","articleFields":{"description":"Add gift card payments to an existing API-only integration.","feedback_component":true,"parameters":{"integration":"API-only","platform":"Web","integration_guide_url":"build-your-integration\/advanced-flow?platform=Web&integration=API%20only","api_explorer_shortcode":"[api=\"Checkout\/sessions\" inlineCode=\"false\" t=\"Try it in our API Explorer.\"]","logo_1":"![](\/reuse\/development-resources\/additional-info-resources\/java-original.svg?resize=25)","example_1":"[Java Spring](https:\/\/github.com\/adyen-examples\/adyen-java-spring-online-payments\/tree\/main\/giftcard-example)","logo_2":"![](\/reuse\/development-resources\/additional-info-resources\/dot-net-original.svg?resize=25)","example_2":"[.NET](https:\/\/github.com\/adyen-examples\/adyen-dotnet-online-payments\/tree\/main\/giftcard-example)","logo_3":"![](\/reuse\/development-resources\/additional-info-resources\/nodejs-original.svg?resize=25)","example_3":"[Node.js](https:\/\/github.com\/adyen-examples\/adyen-node-online-payments\/tree\/main\/giftcard-example)"},"status":"current"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/gift-cards\/api-only","title":"Gift cards for API only","content":"\n&nbsp;&nbsp;Postman collectionImplementation examples&nbsp;&nbsp;Java Spring&nbsp;&nbsp;.NET&nbsp;&nbsp;Node.js\n\nAccept gift card payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.\nRequirements\nThese instructions explain how to add gift cards to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.\nBefore starting your integration make sure you:\n\nSet up your back end implementation.\n\nAdded each gift card variant that you want to test in your Customer Area.\n\nYou can test a limited number of gift card variants and simulate gift card payments. When testing, you use a simulator that tries to behave and respond in the same way as an end-to-end connection with a gift card provider. Before you go live, you must onboard with a gift card provider and add the gift card variant to your live Customer Area.\n\n\n\nBuild your payment form for gift cards\nYou must build a separate integration for each gift card provider.\nYou can process payments for supported gift cards or manage other transactions like adding to the balance of a gift card.\nIf you are using the  \/paymentMethods request to show the available payment methods to your shopper, specify the following in your request:\n\n countryCode&#58; Country where that gift card is supported, for example, NL.\n amount.currency&#58; Any supported currency, for example, EUR.\n channel&#58; Set to Web.\n\nIn the response, you receive the gift cards available to your shopper as elements in the paymentMethods array, for example:\n    {\n        \"name\": \"VVV Giftcard\",\n        \"brand\": \"vvvgiftcard\",\n        \"type\": \"giftcard\"\n    }\nRender logos and names of the available brands for the shopper to choose. When the shopper selects a type of gift card, show the payment form.\nCheck the balance\nAfter the shopper enters the gift card details, check if the balance is enough to make a full payment.\n\n\nMake a  \/paymentMethods\/balance request including:\n\n\n\nField\nRequired\nDescription\n\n\n\n\npaymentMethod.type\n\nThe brand from the  \/paymentMethods response. For example, givex.\n\n\npaymentMethod.number\n\nThe gift card number.\n\n\npaymentMethod.cvc\n\nThe card verification code or security code.\n\n\nmerchantAccount\n\nYour merchant account.\n\n\n\n\n\n\nThe response includes the balance of the gift card.\n\n\n\n\n\nIf the balance amount is equal to or greater than the full payment amount, then continue to make a payment.\nIf the balance is less than the full payment amount, make an  \/orders request. This lets you create partial payments: a payment with the gift card, and a payment for the remaining amount using a different payment method.\n\n\nMake a payment\nFrom your server, make a  \/payments request, specifying:\n\n\n\nField\nRequired\nDescription\n\n\n\n\npaymentMethod.type\n\ngiftcard\n\n\npaymentMethod.brand\n\nThe brand from the  \/paymentMethods response. For example, vvvgiftcard or genericgiftcard.\n\n\npaymentMethod.number\n\nThe gift card number without separators.\n\n\npaymentMethod.cvc\n\nThe card verification code.\n\n\n\n\nFor some gift cards, there are regulatory limits on transaction amounts. Check with your gift card provider to learn if these limits affect you.\n\n\n    \n\nThe  \/payments response contains:\n\npspReference: Our unique identifier for the transaction.\nresultCode: Use this to present the payment result to your shopper.\nmerchantReference: The reference from the  \/payments request.\n\nShow the payment result\nUse the\u00a0 resultCode from the  \/payments response to show the payment result to your shopper.\nYou will also receive the outcome of the payment asynchronously in a webhook. For gift card payments, you can receive the following resultCode values:\n\n\n\nresultCode\nDescription\nAction to take\n\n\n\n\nAuthorised\nThe payment was successful.\nInform the shopper that the payment has been successful.  If you are using manual capture, you also need to capture the payment.\n\n\nCancelled\nThe shopper cancelled the payment.\nAsk the shopper whether they want to continue with the order, or ask them to select a different payment method.\n\n\nError\nThere was an error when the payment was being processed. For more information, check the \n  refusalReason\n field.\nInform the shopper that there was an error processing their payment.\n\n\nRefused\nThe payment was refused.  For more information, check the \n  refusalReason\n field.\nAsk the shopper to try the payment again using a different payment method.\n\n\n\nTest and go live\nBefore making live gift card payments, simulate transactions:\n\n\nTest your integration using our test card numbers depending on your gift card provider. When testing, you use a simulator that tries to behave and respond in the same way as an end-to-end connection.\nTo simulate a scenario, send one of the following amounts in the test payment request:\n\n\n\nAmount (last three digits)\nresultCode\nrefusalReason\n\n\n\n\n100\nAuthorised\n\n\n\n123\nRefused\nRefused\n\n\n124\nRefused\nNot enough balance\n\n\n125\nRefused\nBlocked Card\n\n\n126\nRefused\nExpired Card\n\n\n130\nError\nAcquirer Error\n\n\n134\nRefused\nInvalid Pin\n\n\n135\nRefused\nPin tries exceeded\n\n\n\n\nFor example, send a payment amount with 100 as the last three digits, such as 1.00 or 11.00. This will result in an Authorised transaction.\n\n\nCheck the status of test payments in your test Customer Area\u00a0&gt;\u00a0Transactions\u00a0&gt;\u00a0Payments.\n\n\nWhen you are ready to go live:\n\nOnboard with a gift card provider and add the gift card variant to your live Customer Area.\n\nContact our Support Team to add the gift card to your live Customer Area.\nYou can test end-to-end scenarios in your live environment using real gift card details and small amounts.\n\n\nSee also\n\n\n                    API-only integration guide\n                \n                    Webhooks\n                \n                    API Explorer\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Gift cards","lvl3":"Gift cards for API only"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/gift-cards","lvl3":"\/pt\/payment-methods\/gift-cards\/api-only"},"levels":4,"category":"Payment method","category_color":"green","tags":["cards"]},"articleFiles":{"gift-card-payments-api.js":"<p alt=\"\">gift-card-payments-api.js<\/p>","gift-card-payments-api.request.json":"<p alt=\"\">gift-card-payments-api.request.json<\/p>","gift-card-payments-api.response.json":"<p alt=\"\">gift-card-payments-api.response.json<\/p>","paymentmethods-balance-request-2633995390.js":"<p alt=\"\">paymentmethods-balance-request-2633995390.js<\/p>"}}
