{"title":"Secure communication for agentic payments","category":"default","creationDate":1786704993,"content":"<p>To improve the security of your API request for agentic commerce, add message-level encryption (MLE). For the request to share the shopper's payment credentials with Adyen, you sign the JSON payload with <a href=\"https:\/\/en.wikipedia.org\/wiki\/JSON_Web_Signature\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">JSON Web Signature (JWS)<\/a> and encrypt the payload with <a href=\"https:\/\/en.wikipedia.org\/wiki\/JSON_Web_Encryption\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">JSON Web Encryption (JWE)<\/a>.<\/p>\n<div class=\"notices green\">\n<p>If your integration uses the Agentic Commerce Protocol (ACP), we recommend that you use <a href=\"https:\/\/en.wikipedia.org\/wiki\/HMAC\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">HMAC-SHA256 signatures<\/a> (sign the <code>Timestamp<\/code> and the payload) instead. ACP supports this natively. <br><br> If you do this, the instructions for JWS and JWE do not apply to you.<\/p>\n<\/div>\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 one of the following agent platform integrations with Adyen: <ul><li markdown=\"1\">Agentic carts for agents:<ul><li markdown=\"1\"><a href=\"\/online-payments\/agentic-commerce\/agent-platform\/ai-agent-integration-acp\">AI agent integration with ACP<\/a><\/li><li markdown=\"1\"><a href=\"\/online-payments\/agentic-commerce\/agent-platform\/ai-agent-integration-ucp\">AI agent integration with UCP<\/a><\/li><\/ul><li markdown=\"1\">Agentic payments:<ul><li markdown=\"1\"><a href=\"\/online-payments\/agentic-commerce\/agent-platform\/agentic-payments-acp\">Agentic Payments integration with ACP checkout flow<\/a><\/li><li markdown=\"1\"><a href=\"\/online-payments\/agentic-commerce\/agent-platform\/agentic-payments-ucp\">Agentic Payments integration with UCP<\/a><\/li><\/ul><\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>User role<\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that your Adyen credential (API key) has the following user role: <ul><li markdown=\"1\"><strong>Agentic Commerce<\/strong><\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Key pairs<\/strong><\/td>\n<td style=\"text-align: left;\">An RSA key pair for JWS signing (<code>PS512<\/code>). Keep the private key secure on your platform. Adyen provides the encryption certificate (X.509). Do not reuse keys across integrations.<\/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, reach out to your Adyen Account Manager or 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> for the following: <ul><li markdown=\"1\">Enable message-level encryption for your account.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>How it works<\/h2>\n<p>MLE provides additional security when your agent platform makes an API request to share payment credentials with Adyen. You sign and encrypt the request payload before sending it to Adyen. Adyen decrypts and verifies the payload, then processes the request.<\/p>\n<p>You must do the following when you make the request to share payment credentials:<\/p>\n<ol>\n<li>Sign the raw JSON payload with your private key to create a JWS token.<\/li>\n<li>Encrypt the JWS token with the Adyen public key to create a JWE token.<\/li>\n<li>Send the JWE token as the request body with <code>Content-Type: application\/jose<\/code>.<\/li>\n<li>Adyen decrypts the JWE token, verifies the JWS signature, and processes the request.<\/li>\n<\/ol>\n<p>The response format is the same as for standard requests to the endpoint.<\/p>\n<h2>Configure your keys<\/h2>\n<p>Configure the cryptographic keys that you use for signing and encryption:<\/p>\n<ol>\n<li>In your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>, go to <strong>Developers<\/strong> &gt; <strong>API credentials<\/strong>.<\/li>\n<li>Select the API credential for your agentic commerce integration.<\/li>\n<li>In the <strong>JWS public key<\/strong> field, paste your public signing key. Adyen uses this key to verify your request signatures.<\/li>\n<li>\n<p>In the <strong>Client side encryption<\/strong> section, select <strong>download X509 Certificate<\/strong>. You use this certificate to encrypt the payload.<\/p>\n<div class=\"notices yellow\">\n<p>Do not reuse this certificate for other integrations.<\/p>\n<\/div>\n<\/li>\n<\/ol>\n<h2>Implement MLE in your request<\/h2>\n<div class=\"notices green\">\n<p>The maximum request body size is 1 MB. Using unsupported algorithms results in an HTTP <strong>401 Unauthorized<\/strong> error.<\/p>\n<\/div>\n<p>The endpoint for the request to share the shopper's payment creditials depends on the protocol your integration uses:<\/p>\n<table>\n<thead>\n<tr>\n<th>Protocol<\/th>\n<th>Endpoint<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>UCP<\/td>\n<td><code>https:\/\/commerce-suite-test.adyen.com\/commerce-suite\/ucp\/v1\/handler\/tokenize<\/code><\/td>\n<\/tr>\n<tr>\n<td>ACP<\/td>\n<td><code>https:\/\/pal-test.adyen.com\/paltokenization\/servlet\/Recurring\/Agentic\/acp\/v1\/agentic_commerce\/delegate_payment<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>To share payment credentials with MLE, do the following:<\/p>\n<ol>\n<li>\n<p>Sign the JSON payload.<\/p>\n<p>Create a JWS with the <code>PS512<\/code> (<code>RSA_PSS_USING_SHA512<\/code>) algorithm and your private signing key. The input is your raw JSON request body.<\/p>\n<p>You get a string that represents the JWS. This is your signed payload.<\/p>\n<\/li>\n<li>\n<p>Encrypt the signed payload.<\/p>\n<p>Create a JWE with the Adyen CSE public key from the X.509 certificate that you downloaded. Use the following:<\/p>\n<ul>\n<li>Key encryption: <code>RSA-OAEP-256<\/code> <\/li>\n<li>Content encryption: <code>A256GCM<\/code> <\/li>\n<\/ul>\n<p>You get an encrypted JWE payload.<\/p>\n<\/li>\n<li>\n<p>In the request to tokenize (UCP) or delegate payment (ACP), include the following:<\/p>\n<p>Header:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>Content-Type<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\"><code>application\/jose<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>Authorization<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\"><code>Bearer &lt;YOUR_AGENTIC_TOKEN&gt;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Body:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Body<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">Request body<\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The encrypted JWE payload.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Example request for UCP tokenization with MLE'\" :id=\"'mle-tokenize-request'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/commerce-suite-test.adyen.com\\\/commerce-suite\\\/ucp\\\/v1\\\/handler\\\/tokenize \\\\\\n-H 'Authorization: Bearer YOUR_AGENTIC_TOKEN' \\\\\\n-H 'Content-Type: application\\\/jose' \\\\\\n-H 'Idempotency-Key: YOUR_IDEMPOTENCY_KEY' \\\\\\n-X POST \\\\\\n-d 'eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0...'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>","url":"https:\/\/docs.adyen.com\/online-payments\/agentic-commerce\/agent-platform\/secure-communication","articleFields":{"description":"Secure your API requests for agentic payments with JSON Web Signature (JWS) and JSON Web Encryption (JWE).","robots":"noindex,nofollow","feedback_component":true,"filters_component":false,"decision_tree":"[]"},"algolia":{"url":"https:\/\/docs.adyen.com\/online-payments\/agentic-commerce\/agent-platform\/secure-communication","title":"Secure communication for agentic payments","content":"To improve the security of your API request for agentic commerce, add message-level encryption (MLE). For the request to share the shopper's payment credentials with Adyen, you sign the JSON payload with JSON Web Signature (JWS) and encrypt the payload with JSON Web Encryption (JWE).\n\nIf your integration uses the Agentic Commerce Protocol (ACP), we recommend that you use HMAC-SHA256 signatures (sign the Timestamp and the payload) instead. ACP supports this natively.  If you do this, the instructions for JWS and JWE do not apply to you.\n\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have one of the following agent platform integrations with Adyen: Agentic carts for agents:AI agent integration with ACPAI agent integration with UCPAgentic payments:Agentic Payments integration with ACP checkout flowAgentic Payments integration with UCP\n\n\nUser role\nMake sure that your Adyen credential (API key) has the following user role: Agentic Commerce\n\n\nKey pairs\nAn RSA key pair for JWS signing (PS512). Keep the private key secure on your platform. Adyen provides the encryption certificate (X.509). Do not reuse keys across integrations.\n\n\nSetup steps\nBefore you begin, reach out to your Adyen Account Manager or our Support Team for the following: Enable message-level encryption for your account.\n\n\n\nHow it works\nMLE provides additional security when your agent platform makes an API request to share payment credentials with Adyen. You sign and encrypt the request payload before sending it to Adyen. Adyen decrypts and verifies the payload, then processes the request.\nYou must do the following when you make the request to share payment credentials:\n\nSign the raw JSON payload with your private key to create a JWS token.\nEncrypt the JWS token with the Adyen public key to create a JWE token.\nSend the JWE token as the request body with Content-Type: application\/jose.\nAdyen decrypts the JWE token, verifies the JWS signature, and processes the request.\n\nThe response format is the same as for standard requests to the endpoint.\nConfigure your keys\nConfigure the cryptographic keys that you use for signing and encryption:\n\nIn your Customer Area, go to Developers &gt; API credentials.\nSelect the API credential for your agentic commerce integration.\nIn the JWS public key field, paste your public signing key. Adyen uses this key to verify your request signatures.\n\nIn the Client side encryption section, select download X509 Certificate. You use this certificate to encrypt the payload.\n\nDo not reuse this certificate for other integrations.\n\n\n\nImplement MLE in your request\n\nThe maximum request body size is 1 MB. Using unsupported algorithms results in an HTTP 401 Unauthorized error.\n\nThe endpoint for the request to share the shopper's payment creditials depends on the protocol your integration uses:\n\n\n\nProtocol\nEndpoint\n\n\n\n\nUCP\nhttps:\/\/commerce-suite-test.adyen.com\/commerce-suite\/ucp\/v1\/handler\/tokenize\n\n\nACP\nhttps:\/\/pal-test.adyen.com\/paltokenization\/servlet\/Recurring\/Agentic\/acp\/v1\/agentic_commerce\/delegate_payment\n\n\n\nTo share payment credentials with MLE, do the following:\n\n\nSign the JSON payload.\nCreate a JWS with the PS512 (RSA_PSS_USING_SHA512) algorithm and your private signing key. The input is your raw JSON request body.\nYou get a string that represents the JWS. This is your signed payload.\n\n\nEncrypt the signed payload.\nCreate a JWE with the Adyen CSE public key from the X.509 certificate that you downloaded. Use the following:\n\nKey encryption: RSA-OAEP-256 \nContent encryption: A256GCM \n\nYou get an encrypted JWE payload.\n\n\nIn the request to tokenize (UCP) or delegate payment (ACP), include the following:\nHeader:\n\n\n\nParameter\nRequired\nValue\n\n\n\n\nContent-Type\n\napplication\/jose\n\n\nAuthorization\n\nBearer &lt;YOUR_AGENTIC_TOKEN&gt;\n\n\n\nBody:\n\n\n\nBody\nRequired\nValue\n\n\n\n\nRequest body\n\nThe encrypted JWE payload.\n\n\n\n\n\n\n\n","type":"page","locale":"en","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Online payments","lvl2":"Adyen Agentic","lvl3":"Agent platform","lvl4":"Secure communication for agentic payments"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/online-payments","lvl2":"https:\/\/docs.adyen.com\/online-payments\/agentic-commerce","lvl3":"https:\/\/docs.adyen.com\/online-payments\/agentic-commerce\/agent-platform","lvl4":"\/online-payments\/agentic-commerce\/agent-platform\/secure-communication"},"levels":5,"category":"Online Payments","category_color":"green","tags":["Secure","communication","agentic","payments"]}}
