{"title":"API only integration","category":"default","creationDate":1776961628,"content":"<p>On this page, you can find information for accepting DOKU payment methods using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.<\/p>\n<p>Through our partner DOKU, we offer various <a href=\"\/pt\/payment-methods\/doku#bank-transfer\">bank transfer payment methods<\/a> and <a href=\"\/pt\/payment-methods\/doku#convenience-store\">convenience store payment methods<\/a> in Indonesia.<\/p>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that you have built an <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow?platform=Web&amp;integration=API%20only\">API-only integration<\/a>. <\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Before you begin, <a href=\"\/pt\/payment-methods\/add-payment-methods\">add  in your test Customer Area<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Build your payment form<\/h2>\n<p>To make a payment, you need to collect the following shopper details:<\/p>\n<table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>firstName<\/code><\/td>\n<td>Shopper's first name.<\/td>\n<\/tr>\n<tr>\n<td><code>lastName<\/code><\/td>\n<td>Shopper's last name.<\/td>\n<\/tr>\n<tr>\n<td><code>shopperEmail<\/code><\/td>\n<td>Shopper's email address.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"notices green\">\n<p>We provide logos for the different payment method types which you can use in your payment form. For more information, refer to <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#downloading-logos\">Downloading logos<\/a>.<\/p>\n<\/div>\n<p>You can also get the required fields 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 as explained in our <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only&amp;version=71#get-available-payment-methods\">API-only integration guide<\/a>.<\/p>\n<p>In your  <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, specify the following combination of  <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> and  <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;<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Country\/region<\/th>\n<th style=\"text-align: left;\"><code>countryCode<\/code><\/th>\n<th style=\"text-align: left;\"><code>amount.currency<\/code><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">Indonesia<\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>ID<\/strong><\/span><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>IDR<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The required fields for different Doku payments are included in the object with the <code>type<\/code> that you want to integrate with.<\/p>\n<table>\n<thead>\n<tr>\n<th><code>name<\/code><\/th>\n<th><code>type<\/code><\/th>\n<th>Kind of payment method<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Alfamart<\/td>\n<td>doku_alfamart<\/td>\n<td>Convenience store<\/td>\n<\/tr>\n<tr>\n<td>Bank Transfer (Permata)<\/td>\n<td>doku_permata_lite_atm<\/td>\n<td>Bank transfer<\/td>\n<\/tr>\n<tr>\n<td>BCA Bank Transfer<\/td>\n<td>doku_bca_va (only available with a local entity)<\/td>\n<td>Bank transfer<\/td>\n<\/tr>\n<tr>\n<td>BNI VA<\/td>\n<td>doku_bni_va<\/td>\n<td>Bank transfer<\/td>\n<\/tr>\n<tr>\n<td>BRI VA<\/td>\n<td>doku_bri_va (only available with a local entity)<\/td>\n<td>Bank transfer<\/td>\n<\/tr>\n<tr>\n<td>CIMB VA<\/td>\n<td>doku_cimb_va<\/td>\n<td>Bank transfer<\/td>\n<\/tr>\n<tr>\n<td>Danamon VA<\/td>\n<td>doku_danamon_va<\/td>\n<td>Bank transfer<\/td>\n<\/tr>\n<tr>\n<td>Indomaret<\/td>\n<td>doku_indomaret<\/td>\n<td>Convenience store<\/td>\n<\/tr>\n<tr>\n<td>Mandiri VA<\/td>\n<td>doku_mandiri_va<\/td>\n<td>Bank transfer<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\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<ul>\n<li><code>paymentMethod.type<\/code>: The <code>type<\/code> of payment method, for example, <span translate=\"no\"><strong>doku_alfamart<\/strong><\/span>.<\/li>\n<li><code>paymentMethod.firstName<\/code>:  The shopper's first name.<\/li>\n<li><code>paymentMethod.lastName<\/code>: The shopper's last name.<\/li>\n<li><code>paymentMethod.shopperEmail<\/code>: The shopper's email address.<\/li>\n<li><code>amount.value<\/code>: The amount of the transaction, in <a href=\"\/pt\/development-resources\/currency-codes\">minor units<\/a> without decimals. For example, submit a value of 10000 IDR as <em>10000<\/em>.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"''\" :id=\"'doku-payments'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v68\\\/payments \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n  \\&quot;merchantAccount\\&quot;:\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;amount\\&quot;:{\\n    \\&quot;currency\\&quot;:\\&quot;IDR\\&quot;,\\n    \\&quot;value\\&quot;:10000\\n  },\\n  \\&quot;paymentMethod\\&quot;:{\\n    \\&quot;type\\&quot;:\\&quot;doku_alfamart\\&quot;,\\n    \\&quot;firstName\\&quot;:\\&quot;John\\&quot;,\\n    \\&quot;lastName\\&quot;:\\&quot;Smith\\&quot;,\\n    \\&quot;shopperEmail\\&quot;:\\&quot;1212@aaa.com\\&quot;\\n  },\\n  \\&quot;returnUrl\\&quot;:\\&quot;https:\\\/\\\/staging.doku.com\\\/Suite\\\/Receive\\&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;IDR\\&quot;)\\n  .value(10000L);\\n\\nDokuDetails dokuDetails = new DokuDetails()\\n  .firstName(\\&quot;John\\&quot;)\\n  .lastName(\\&quot;Smith\\&quot;)\\n  .shopperEmail(\\&quot;1212@aaa.com\\&quot;)\\n  .type(DokuDetails.TypeEnum.ALFAMART);\\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(dokuDetails))\\n  .returnUrl(\\&quot;https:\\\/\\\/staging.doku.com\\\/Suite\\\/Receive\\&quot;);\\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;IDR\\&quot;)\\n  -&gt;setValue(10000);\\n\\n$checkoutPaymentMethod = new CheckoutPaymentMethod();\\n$checkoutPaymentMethod\\n  -&gt;setFirstName(\\&quot;John\\&quot;)\\n  -&gt;setLastName(\\&quot;Smith\\&quot;)\\n  -&gt;setShopperEmail(\\&quot;1212@aaa.com\\&quot;)\\n  -&gt;setType(\\&quot;alfamart\\&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  -&gt;setReturnUrl(\\&quot;https:\\\/\\\/staging.doku.com\\\/Suite\\\/Receive\\&quot;);\\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;IDR\\&quot;,\\n  Value = 10000\\n};\\n\\nDokuDetails dokuDetails = new DokuDetails\\n{\\n  FirstName = \\&quot;John\\&quot;,\\n  LastName = \\&quot;Smith\\&quot;,\\n  ShopperEmail = \\&quot;1212@aaa.com\\&quot;,\\n  Type = DokuDetails.TypeEnum.Alfamart\\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(dokuDetails),\\n  ReturnUrl = \\&quot;https:\\\/\\\/staging.doku.com\\\/Suite\\\/Receive\\&quot;\\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  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  amount: {\\n    currency: \\&quot;IDR\\&quot;,\\n    value: 10000\\n  },\\n  paymentMethod: {\\n    type: \\&quot;doku_alfamart\\&quot;,\\n    firstName: \\&quot;John\\&quot;,\\n    lastName: \\&quot;Smith\\&quot;,\\n    shopperEmail: \\&quot;1212@aaa.com\\&quot;\\n  },\\n  returnUrl: \\&quot;https:\\\/\\\/staging.doku.com\\\/Suite\\\/Receive\\&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;IDR\\&quot;,\\n  Value: 10000,\\n}\\n\\ndokuDetails := checkout.DokuDetails{\\n  FirstName: \\&quot;John\\&quot;,\\n  LastName: \\&quot;Smith\\&quot;,\\n  ShopperEmail: \\&quot;1212@aaa.com\\&quot;,\\n  Type: \\&quot;doku_alfamart\\&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.DokuDetailsAsCheckoutPaymentMethod(&amp;dokuDetails),\\n  ReturnUrl: \\&quot;https:\\\/\\\/staging.doku.com\\\/Suite\\\/Receive\\&quot;,\\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;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;currency\\&quot;: \\&quot;IDR\\&quot;,\\n    \\&quot;value\\&quot;: 10000\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;doku_alfamart\\&quot;,\\n    \\&quot;firstName\\&quot;: \\&quot;John\\&quot;,\\n    \\&quot;lastName\\&quot;: \\&quot;Smith\\&quot;,\\n    \\&quot;shopperEmail\\&quot;: \\&quot;1212@aaa.com\\&quot;\\n  },\\n  \\&quot;returnUrl\\&quot;: \\&quot;https:\\\/\\\/staging.doku.com\\\/Suite\\\/Receive\\&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  :merchantAccount =&gt; 'ADYEN_MERCHANT_ACCOUNT',\\n  :reference =&gt; 'YOUR_ORDER_NUMBER',\\n  :amount =&gt; {\\n    :currency =&gt; 'IDR',\\n    :value =&gt; 10000\\n  },\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'doku_alfamart',\\n    :firstName =&gt; 'John',\\n    :lastName =&gt; 'Smith',\\n    :shopperEmail =&gt; '1212@aaa.com'\\n  },\\n  :returnUrl =&gt; 'https:\\\/\\\/staging.doku.com\\\/Suite\\\/Receive'\\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;IDR\\&quot;,\\n  value: 10000\\n};\\n\\nconst dokuDetails: Types.checkout.DokuDetails = {\\n  firstName: \\&quot;John\\&quot;,\\n  lastName: \\&quot;Smith\\&quot;,\\n  shopperEmail: \\&quot;1212@aaa.com\\&quot;,\\n  type: Types.checkout.DokuDetails.TypeEnum.Alfamart\\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: dokuDetails,\\n  returnUrl: \\&quot;https:\\\/\\\/staging.doku.com\\\/Suite\\\/Receive\\&quot;\\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><code>resultCode<\/code>: <span translate=\"no\"><strong>PresentToShopper<\/strong><\/span><\/li>\n<li>\n<p><code>action<\/code>: Object containing information about the voucher.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/payments response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"resultCode\\\": \\\"PresentToShopper\\\",\\n    \\\"action\\\": {\\n        \\\"expiresAt\\\": \\\"2019-07-21T16:59:00\\\",\\n        \\\"initialAmount\\\": {\\n            \\\"currency\\\": \\\"IDR\\\",\\n            \\\"value\\\": 10000\\n        },\\n        \\\"instructionsUrl\\\": \\\"...\\\",\\n        \\\"merchantName\\\": \\\"YOUR_MERCHANT_NAME\\\",\\n        \\\"paymentMethodType\\\": \\\"doku_alfamart\\\",\\n        \\\"reference\\\": \\\"888882603010314\\\",\\n        \\\"shopperEmail\\\": \\\"1212@aaa.com\\\",\\n        \\\"shopperName\\\": \\\"J Smith\\\",\\n        \\\"totalAmount\\\": {\\n            \\\"currency\\\": \\\"IDR\\\",\\n            \\\"value\\\": 10000\\n        },\\n        \\\"type\\\": \\\"voucher\\\"\\n    }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ul>\n<h2 id=\"present-the-payment-result\">Present the payment result<\/h2>\n<p>Because the voucher is an offline payment method, there is no need to handle the redirect back from the acquirer. We send you a <a href=\"\/pt\/development-resources\/webhooks\">webhook<\/a> informing you about the payment status.<\/p>\n<p>The <code>eventCode<\/code> <a href=\"\/pt\/development-resources\/webhooks\/webhook-types#event-codes\">values<\/a> you receive with your notification are:<\/p>\n<table>\n<thead>\n<tr>\n<th>eventCode<\/th>\n<th>success field<\/th>\n<th>Description<\/th>\n<th>Action to take<\/th>\n<th>resultCode<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>PENDING<\/strong><\/td>\n<td><strong>true<\/strong><\/td>\n<td>The voucher reference is successfully created and the transaction is pending.<\/td>\n<td>Present the shopper with the voucher and wait for the payment.<\/td>\n<td><strong>PresentToShopper<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>AUTHORISATION<\/strong><\/td>\n<td><strong>false<\/strong><\/td>\n<td>The voucher reference is not successfully generated and the transaction failed.<\/td>\n<td>Cancel the order and inform the shopper that the payment failed.<\/td>\n<td><strong>Error<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>AUTHORISATION<\/strong><\/td>\n<td><strong>true<\/strong><\/td>\n<td>The shopper successfully completed the payment.<\/td>\n<td>Inform the shopper that the payment has been successful and proceed with the order.<\/td>\n<td><strong>PresentToShopper<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>OFFER_CLOSED<\/strong><\/td>\n<td><strong>true<\/strong><\/td>\n<td>The shopper did not complete the payment before the voucher expired.<\/td>\n<td>Cancel the order and inform the shopper that the payment timed out.<\/td>\n<td><strong>PresentToShopper<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Customization<\/h2>\n<p>You can customize the expiry date of the virtual bank account (for bank transfers) or the voucher (for convenience store payments). By default, the validity period is 48 hours. To change the validity period, contact the <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>.<\/p>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>Use our <a href=\"\/pt\/development-resources\/test-cards-and-credentials\/alternative-payment-method-credentials#doku\">test vouchers and card numbers<\/a> to simulate the payments.<\/p>\n<p><\/p>\n<p>Check the status of the test payments in your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>, under <strong>Transactions<\/strong> &gt; <strong>Payments<\/strong>.<\/p>\n<p> <\/p>\n<p>Before you can accept live payments, you need to <a href=\"\/pt\/payment-methods\/add-payment-methods\">submit a request<\/a> for one or more Indonesian DOKU online banking or convenience store payment methods in 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<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\/doku\/doku-api-only","articleFields":{"description":"Learn how to add Indonesian payment methods to an existing API-only integration for mobile and web banking.","last_edit_on":"12-11-2019 17:24","parameters":{"integration":"API-only","platform":"Web"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/doku\/doku-api-only","title":"API only integration","content":"On this page, you can find information for accepting DOKU payment methods using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.\nThrough our partner DOKU, we offer various bank transfer payment methods and convenience store payment methods in Indonesia.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have built an API-only integration. \n\n\nSetup steps\nBefore you begin, add  in your test Customer Area.\n\n\n\nBuild your payment form\nTo make a payment, you need to collect the following shopper details:\n\n\n\nName\nDescription\n\n\n\n\nfirstName\nShopper's first name.\n\n\nlastName\nShopper's last name.\n\n\nshopperEmail\nShopper's email address.\n\n\n\n\nWe provide logos for the different payment method types which you can use in your payment form. For more information, refer to Downloading logos.\n\nYou can also get the required fields from the  \/paymentMethods response as explained in our API-only integration guide.\nIn your  \/paymentMethods request, specify the following combination of  countryCode and  amount.currency&#58;\n\n\n\nCountry\/region\ncountryCode\namount.currency\n\n\n\n\nIndonesia\nID\nIDR\n\n\n\nThe required fields for different Doku payments are included in the object with the type that you want to integrate with.\n\n\n\nname\ntype\nKind of payment method\n\n\n\n\nAlfamart\ndoku_alfamart\nConvenience store\n\n\nBank Transfer (Permata)\ndoku_permata_lite_atm\nBank transfer\n\n\nBCA Bank Transfer\ndoku_bca_va (only available with a local entity)\nBank transfer\n\n\nBNI VA\ndoku_bni_va\nBank transfer\n\n\nBRI VA\ndoku_bri_va (only available with a local entity)\nBank transfer\n\n\nCIMB VA\ndoku_cimb_va\nBank transfer\n\n\nDanamon VA\ndoku_danamon_va\nBank transfer\n\n\nIndomaret\ndoku_indomaret\nConvenience store\n\n\nMandiri VA\ndoku_mandiri_va\nBank transfer\n\n\n\nMake a payment\nFrom your server, make a  \/payments request, specifying:\n\npaymentMethod.type: The type of payment method, for example, doku_alfamart.\npaymentMethod.firstName:  The shopper's first name.\npaymentMethod.lastName: The shopper's last name.\npaymentMethod.shopperEmail: The shopper's email address.\namount.value: The amount of the transaction, in minor units without decimals. For example, submit a value of 10000 IDR as 10000.\n\n\n    \n\nThe  \/payments response contains:\n\nresultCode: PresentToShopper\n\naction: Object containing information about the voucher.\n\n\n\n\n\nPresent the payment result\nBecause the voucher is an offline payment method, there is no need to handle the redirect back from the acquirer. We send you a webhook informing you about the payment status.\nThe eventCode values you receive with your notification are:\n\n\n\neventCode\nsuccess field\nDescription\nAction to take\nresultCode\n\n\n\n\nPENDING\ntrue\nThe voucher reference is successfully created and the transaction is pending.\nPresent the shopper with the voucher and wait for the payment.\nPresentToShopper\n\n\nAUTHORISATION\nfalse\nThe voucher reference is not successfully generated and the transaction failed.\nCancel the order and inform the shopper that the payment failed.\nError\n\n\nAUTHORISATION\ntrue\nThe shopper successfully completed the payment.\nInform the shopper that the payment has been successful and proceed with the order.\nPresentToShopper\n\n\nOFFER_CLOSED\ntrue\nThe shopper did not complete the payment before the voucher expired.\nCancel the order and inform the shopper that the payment timed out.\nPresentToShopper\n\n\n\nCustomization\nYou can customize the expiry date of the virtual bank account (for bank transfers) or the voucher (for convenience store payments). By default, the validity period is 48 hours. To change the validity period, contact the Support Team.\nTest and go live\nUse our test vouchers and card numbers to simulate the payments.\n\nCheck the status of the test payments in your Customer Area, under Transactions &gt; Payments.\n \nBefore you can accept live payments, you need to submit a request for one or more Indonesian DOKU online banking or convenience store payment methods in your live Customer Area.\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":"Bank transfers and convenience store payments in Indonesia","lvl3":"API only integration"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/doku","lvl3":"\/pt\/payment-methods\/doku\/doku-api-only"},"levels":4,"category":"Payment method","category_color":"green","tags":["integration"]},"articleFiles":{"doku-payments.js":"<p alt=\"\">doku-payments.js<\/p>"}}
