{"title":"Titres-restaurant for API only","category":"default","creationDate":1671541020,"content":"<p>Accept Titres-restaurant 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<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: <ul><li markdown=\"1\"><a href=\"\/pt\/payment-methods\/titres-restaurant#activate\">Activate Titres-Restaurant<\/a> to get your <em>Carte de domiciliation CONECS<\/em>.<\/li><li markdown=\"1\"><a href=\"\/pt\/payment-methods\/add-payment-methods\">Add the meal voucher payment method in your Customer Area<\/a>, providing your SIRET (your business registration ID) and the Conecs MID from your <em>Carte de domiciliation CONECS<\/em>.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Build your payment form for Titres-restaurant<\/h2>\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; <span translate=\"no\"><strong>FR<\/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; <span translate=\"no\"><strong>EUR<\/strong><\/span><\/li>\n<\/ul>\n<p>In the response, you receive the meal vouchers available to your shopper as elements in the <code>paymentMethods<\/code> array, for example:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'API response'\" :id=\"''\" :code-data='[{\"language\":\"bash\",\"tabTitle\":\"\",\"content\":\"{\\n    {\\n        \\\"name\\\": \\\"Up Titre-Restaurant\\\",\\n        \\\"type\\\": \\\"mealVoucher_FR_groupeup\\\"\\n    },\\n    {\\n        \\\"name\\\": \\\"Apetiz Titre-Restaurant\\\",\\n        \\\"type\\\": \\\"mealVoucher_FR_natixis\\\"\\n    },\\n    {\\n        \\\"name\\\": \\\"Sodexo Titre-Restaurant\\\",\\n        \\\"type\\\": \\\"mealVoucher_FR_sodexo\\\"\\n    }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<div class=\"notices green\">\n<p><strong>Apetiz<\/strong> and <strong>mealVoucher_FR_natixis<\/strong> refer to Bimpli, the commercial brand for Natixis.<\/p>\n<\/div>\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 meal voucher, show the payment form.<\/p>\n<h2>Check the balance<\/h2>\n<p>After the shopper enters the meal voucher 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><span translate=\"no\"><strong>mealVoucher_FR<\/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 meal voucher number.<\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethod.expiryMonth<\/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>Expiry month of the meal voucher.<\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethod.expiryYear<\/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>Expiry year of the meal voucher.<\/td>\n<\/tr>\n<tr>\n<td><code>reference<\/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 reference to uniquely identify the transaction. To provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.<\/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-9556171051'\" :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;mealVoucher_FR\\&quot;,\\n    \\&quot;number\\&quot;:\\&quot;4242420100058007\\&quot;,\\n    \\&quot;expiryMonth\\&quot;: \\&quot;06\\&quot;,\\n    \\&quot;expiryYear\\&quot;: \\&quot;2023\\&quot;\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_REFERENCE\\&quot;,\\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  .reference(\\&quot;YOUR_REFERENCE\\&quot;)\\n  .merchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  .paymentMethod(new HashMap&lt;String, String&gt;(Map.of(\\n    \\&quot;number\\&quot;, \\&quot;4242420100058007\\&quot;,\\n    \\&quot;expiryMonth\\&quot;, \\&quot;06\\&quot;,\\n    \\&quot;expiryYear\\&quot;, \\&quot;2023\\&quot;,\\n    \\&quot;type\\&quot;, \\&quot;mealVoucher_FR\\&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;setReference(\\&quot;YOUR_REFERENCE\\&quot;)\\n  -&gt;setMerchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  -&gt;setPaymentMethod(\\n    array(\\n      \\&quot;number\\&quot; =&gt; \\&quot;4242420100058007\\&quot;,\\n      \\&quot;expiryMonth\\&quot; =&gt; \\&quot;06\\&quot;,\\n      \\&quot;expiryYear\\&quot; =&gt; \\&quot;2023\\&quot;,\\n      \\&quot;type\\&quot; =&gt; \\&quot;mealVoucher_FR\\&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  Reference = \\&quot;YOUR_REFERENCE\\&quot;,\\n  MerchantAccount = \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  PaymentMethod = new Dictionary&lt;string, string&gt;\\n  {\\n\\n    { \\&quot;number\\&quot;, \\&quot;4242420100058007\\&quot; },\\n    { \\&quot;expiryMonth\\&quot;, \\&quot;06\\&quot; },\\n    { \\&quot;expiryYear\\&quot;, \\&quot;2023\\&quot; },\\n    { \\&quot;type\\&quot;, \\&quot;mealVoucher_FR\\&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;mealVoucher_FR\\&quot;,\\n    number: \\&quot;4242420100058007\\&quot;,\\n    expiryMonth: \\&quot;06\\&quot;,\\n    expiryYear: \\&quot;2023\\&quot;\\n  },\\n  reference: \\&quot;YOUR_REFERENCE\\&quot;,\\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  Reference: common.PtrString(\\&quot;YOUR_REFERENCE\\&quot;),\\n  MerchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  PaymentMethod: &amp;map[string]string{\\n    \\&quot;number\\&quot;: \\&quot;4242420100058007\\&quot;,\\n    \\&quot;expiryMonth\\&quot;: \\&quot;06\\&quot;,\\n    \\&quot;expiryYear\\&quot;: \\&quot;2023\\&quot;,\\n    \\&quot;type\\&quot;: \\&quot;mealVoucher_FR\\&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;mealVoucher_FR\\&quot;,\\n    \\&quot;number\\&quot;: \\&quot;4242420100058007\\&quot;,\\n    \\&quot;expiryMonth\\&quot;: \\&quot;06\\&quot;,\\n    \\&quot;expiryYear\\&quot;: \\&quot;2023\\&quot;\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_REFERENCE\\&quot;,\\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; 'mealVoucher_FR',\\n    :number =&gt; '4242420100058007',\\n    :expiryMonth =&gt; '06',\\n    :expiryYear =&gt; '2023'\\n  },\\n  :reference =&gt; 'YOUR_REFERENCE',\\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  reference: \\&quot;YOUR_REFERENCE\\&quot;,\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  paymentMethod: {\\n    \\&quot;number\\&quot;: \\&quot;4242420100058007\\&quot;,\\n    \\&quot;expiryMonth\\&quot;: \\&quot;06\\&quot;,\\n    \\&quot;expiryYear\\&quot;: \\&quot;2023\\&quot;,\\n    \\&quot;type\\&quot;: \\&quot;mealVoucher_FR\\&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 meal voucher.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/paymentMethods\/balance response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n  \\\"balance\\\": {\\n     \\\"currency\\\": \\\"EUR\\\",\\n     \\\"value\\\": 2500\\n },\\n  \\\"pspReference\\\": \\\"ZQXDPCQ8HXSKGK82\\\",\\n  \\\"resultCode\\\": \\\"Success\\\"\\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, <a href=\"\/pt\/online-payments\/partial-payments\">create an order<\/a> and ask the shopper to make partial payments with the meal voucher and 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>mealVoucher_FR<\/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 meal voucher number without separators.<\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethod.expiryMonth<\/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 expiry month of the meal voucher.<\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethod.expiryYear<\/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 expiry year of the meal voucher.<\/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 CVC of the meal voucher.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"''\" :id=\"'mealvoucher_FR'\" :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;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;mealVoucher_FR\\&quot;,\\n     \\&quot;number\\&quot;:\\&quot;2345678910111213\\&quot;,\\n     \\&quot;expiryMonth\\&quot;: \\&quot;06\\&quot;,\\n     \\&quot;expiryYear\\&quot;: \\&quot;2023\\&quot;,\\n     \\&quot;cvc\\&quot;: \\&quot;123\\&quot;\\n   },\\n  \\&quot;merchantAccount\\&quot;:\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v16.1.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\n\\\/\\\/ Initialize the client object\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object\\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;mealVoucher_FR\\&quot;,\\n    number: \\&quot;2345678910111213\\&quot;,\\n    expiryMonth: \\&quot;06\\&quot;,\\n    expiryYear: \\&quot;2023\\&quot;,\\n    cvc: \\&quot;123\\&quot;\\n  },\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}\\n\\n\\\/\\\/ Make the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v12.0.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\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;mealVoucher_FR\\&quot;,\\n    \\&quot;number\\&quot;: \\&quot;2345678910111213\\&quot;,\\n    \\&quot;expiryMonth\\&quot;: \\&quot;06\\&quot;,\\n    \\&quot;expiryYear\\&quot;: \\&quot;2023\\&quot;,\\n    \\&quot;cvc\\&quot;: \\&quot;123\\&quot;\\n  },\\n  \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}\\n\\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.1.0\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\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; 'mealVoucher_FR',\\n    :number =&gt; '2345678910111213',\\n    :expiryMonth =&gt; '06',\\n    :expiryYear =&gt; '2023',\\n    :cvc =&gt; '123'\\n  },\\n  :merchantAccount =&gt; 'ADYEN_MERCHANT_ACCOUNT'\\n}\\n\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&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>Present the payment result<\/h2>\n<p>Use the  <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 present 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 Titres-restaurant 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><span translate=\"no\"><strong>Authorised<\/strong><\/span><\/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><span translate=\"no\"><strong>Cancelled<\/strong><\/span><\/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><span translate=\"no\"><strong>Error<\/strong><\/span><\/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><span translate=\"no\"><strong>Refused<\/strong><\/span><\/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>To test Titres-restaurant payments, you must get test credentials directly from the meal voucher issuer (Bimpli, Sodexo, or Up D\u00e9jeuner).<\/p>\n<p><\/p>\n<p>Before you can accept live payments, you must 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 activate Titres-restaurant in your live environment.<\/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\/build-your-integration\/advanced-flow?platform=Web&amp;integration=API%20only\"\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\/titres-restaurant\/api-only","articleFields":{"description":"Add Titres-restaurant payments to an existing API-only integration.","status":"current","parameters":{"integration":"API-only","platform":"Web","integration_guide_url":"build-your-integration\/advanced-flow?platform=Web&integration=API%20Only","payment_method":"Titres-Restaurant"},"feedback_component":true,"last_edit_on":"20-12-2022 13:57"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/titres-restaurant\/api-only","title":"Titres-restaurant for API only","content":"Accept Titres-restaurant payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\n Make sure that you have built an API-only integration.  \n\n\nSetup steps\nBefore you begin: Activate Titres-Restaurant to get your Carte de domiciliation CONECS.Add the meal voucher payment method in your Customer Area, providing your SIRET (your business registration ID) and the Conecs MID from your Carte de domiciliation CONECS.\n\n\n\nBuild your payment form for Titres-restaurant\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; FR\n amount.currency&#58; EUR\n\nIn the response, you receive the meal vouchers available to your shopper as elements in the paymentMethods array, for example:\n\n    \n\n\nApetiz and mealVoucher_FR_natixis refer to Bimpli, the commercial brand for Natixis.\n\nRender logos and names of the available brands for the shopper to choose. When the shopper selects a type of meal voucher, show the payment form.\nCheck the balance\nAfter the shopper enters the meal voucher 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\nmealVoucher_FR\n\n\npaymentMethod.number\n\nThe meal voucher number.\n\n\npaymentMethod.expiryMonth\n\nExpiry month of the meal voucher.\n\n\npaymentMethod.expiryYear\n\nExpiry year of the meal voucher.\n\n\nreference\n\nYour reference to uniquely identify the transaction. To provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.\n\n\n\n\n\n\nThe response includes the balance of the meal voucher.\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, create an order and ask the shopper to make partial payments with the meal voucher and 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\nmealVoucher_FR.\n\n\npaymentMethod.number\n\nThe meal voucher number without separators.\n\n\npaymentMethod.expiryMonth\n\nThe expiry month of the meal voucher.\n\n\npaymentMethod.expiryYear\n\nThe expiry year of the meal voucher.\n\n\npaymentMethod.cvc\n\nThe CVC of the meal voucher.\n\n\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\nPresent the payment result\nUse the  resultCode from the  \/payments response to present the payment result to your shopper.\nYou will also receive the outcome of the payment asynchronously in a webhook. For Titres-restaurant 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\nTo test Titres-restaurant payments, you must get test credentials directly from the meal voucher issuer (Bimpli, Sodexo, or Up D\u00e9jeuner).\n\nBefore you can accept live payments, you must contact our Support Team to activate Titres-restaurant in your live environment.\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":"Titres-restaurant","lvl3":"Titres-restaurant 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\/titres-restaurant","lvl3":"\/pt\/payment-methods\/titres-restaurant\/api-only"},"levels":4,"category":"Payment method","category_color":"green","tags":["Titres-restaurant"]},"articleFiles":{"mealvoucher_FR.js":"<p alt=\"\">mealvoucher_FR.js<\/p>","paymentmethods-balance-request-9556171051.js":"<p alt=\"\">paymentmethods-balance-request-9556171051.js<\/p>"}}
