{"title":"Bluetooth beacons","category":"default","creationDate":1556285460,"content":"<p>Our Bluetooth terminals use the <a href=\"https:\/\/developer.apple.com\/ibeacon\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">iBeacon protocol<\/a> to advertise their presence to other nearby Bluetooth devices, such as a mobile POS app. You can use the advertised data to make sure that the POS app discovers the closest terminal and uses its unique identifiers to correctly route Terminal API requests.<\/p>\n<h2>Requirements<\/h2>\n<p>Before you begin, take into account the following requirements, limitations, and preparations.<\/p>\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;\">A <a href=\"\/point-of-sale\/basic-tapi-integration\/\">Terminal API integration<\/a> with payment terminals.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Limitations<\/strong><\/td>\n<td style=\"text-align: left;\">The beacon functionality is not supported for Android terminals and unattended non-Android terminals.<\/td>\n<\/tr>\n<tr>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Advertised values and integration types<\/h2>\n<p>The terminal advertises values using the <a href=\"https:\/\/developer.apple.com\/ibeacon\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">iBeacon protocol<\/a> so your mobile POS app can recognize the closest terminal. You define the following values when you <a href=\"#set-up-beacons-in-your-customer-area\">set up beacons in your Customer Area<\/a>:<\/p>\n<ul>\n<li><strong>UUID<\/strong>: a Universally Unique Identifier consisting of 32 hexadecimal digits.<\/li>\n<li><strong>Major<\/strong>: a decimal value between 0 and 65535.<\/li>\n<li><strong>Minor<\/strong>: a decimal value between 0 and 65535.<\/li>\n<\/ul>\n<p>The <a href=\"#placeholders-for-the-major-and-minor\">Major and Minor values<\/a> are set up to encode the terminal data needed for routing: the <strong>serial number<\/strong> for cloud-based communication, or the <strong>IP address<\/strong> for local communication.<\/p>\n<p>After you set up beacons, the specific terminal detail you need to retrieve from the advertised Major and Minor values depends on your <a href=\"\/point-of-sale\/design-your-integration\/choose-your-architecture#local-communications\">integration architecture<\/a>:<\/p>\n<ul>\n<li><a href=\"#cloud-based-communication\">Cloud communications<\/a><\/li>\n<li><a href=\"#local-communication\">Local communications<\/a><\/li>\n<\/ul>\n<h2 id=\"set-up-beacons-in-your-customer-area\">Set up beacons in your Customer Area<\/h2>\n<p>To enable the beacon functionality and set your values for the <strong>UUID<\/strong>, <strong>Major<\/strong>, and <strong>Minor<\/strong>:<\/p>\n<ol>\n<li>\n<p>Log in to your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>.<\/p>\n<\/li>\n<li>\n<p>Go to <strong>In-person payments<\/strong>\u00a0&gt;\u00a0<strong>Terminal settings<\/strong>, or first go to the merchant account, store, or individual terminal where you want to set up beacons and then go to the terminal settings.<\/p>\n<\/li>\n<li>\n<p>Go to the <strong>Connectivity<\/strong> tab.<\/p>\n<\/li>\n<li>\n<p>In the <strong>Beacon<\/strong> section:<\/p>\n<ol>\n<li>For <strong>Enable beacons<\/strong> select <strong>Enabled<\/strong>.<\/li>\n<li>Set <strong>UUID<\/strong> to the Universally Unique Identifier that you want to use. You can generate a UUID using an online tool, for example <a href=\"https:\/\/www.uuidgenerator.net\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">uuidgenerator<\/a>.<\/li>\n<li>Set <strong>Major<\/strong> and <strong>Minor<\/strong> to the values that you want to use. You are free to choose your own values, or <a href=\"#placeholders-for-the-major-and-minor\">use our placeholders<\/a>.<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>Select <strong>Save<\/strong> at the bottom of the page.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"placeholders-for-the-major-and-minor\">Placeholders for the Major and Minor<\/h3>\n<p>You can use our placeholders to dynamically encode either the serial number or the IP address of the terminal into the Major and Minor, depending on whether you are using cloud or local communications.<\/p>\n<ul>\n<li>\n<p>Encode the <strong>serial number<\/strong> of the terminal if you are using <a href=\"#cloud-based-communication\">cloud communications<\/a>:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\"><\/th>\n<th style=\"text-align: left;\"><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Major<\/strong><\/td>\n<td style=\"text-align: left;\">${SERIALH}<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Minor<\/strong><\/td>\n<td style=\"text-align: left;\">${SERIALL}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>To learn how to decode the advertised data, see <a href=\"#get-the-serial-number\">Get the serial number<\/a>.<\/p>\n<\/li>\n<li>\n<p>Encode the <strong>IP address<\/strong> of the terminal if you are using <a href=\"#local-communication\">local communications<\/a>. Here, the placeholder also depends on your network interface. For example, if you are using the first Ethernet interface, set <strong>Major<\/strong> to <span translate=\"no\"><strong>${IPH:ETH0}<\/strong><\/span>, and <strong>Minor<\/strong> to <span translate=\"no\"><strong>${IPL:ETH0}<\/strong><\/span>.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\"><\/th>\n<th style=\"text-align: left;\"><\/th>\n<th style=\"text-align: left;\"><\/th>\n<th style=\"text-align: left;\"><\/th>\n<th style=\"text-align: left;\"><\/th>\n<th style=\"text-align: left;\"><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Major<\/strong><\/td>\n<td style=\"text-align: left;\">${IPH:ETH0}<\/td>\n<td style=\"text-align: left;\">${IPH:ETH1}<\/td>\n<td style=\"text-align: left;\">${IPH:WLAN0}<\/td>\n<td style=\"text-align: left;\">${IPH:WLAN1}<\/td>\n<td style=\"text-align: left;\">${IPH:GPRS0}<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Minor<\/strong><\/td>\n<td style=\"text-align: left;\">${IPL:ETH0}<\/td>\n<td style=\"text-align: left;\">${IPL:ETH1}<\/td>\n<td style=\"text-align: left;\">${IPL:WLAN0}<\/td>\n<td style=\"text-align: left;\">${IPL:WLAN1}<\/td>\n<td style=\"text-align: left;\">${IPL:GPRS0}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>To learn how to decode the advertised data, see <a href=\"#get-the-ip-address\">Get the IP address<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"cloud-based-communication\">Use beacons with cloud communications<\/h2>\n<p>With <a href=\"\/point-of-sale\/design-your-integration\/choose-your-architecture#cloud-communications\">cloud communications<\/a>, a Terminal API request is routed to the correct terminal based on the unique terminal ID, the <code>POIID<\/code>, which you pass in the request.<\/p>\n<div class=\"sc-notice info\"><div>\n<p><code>POIID<\/code> = <em>[Terminal model] - [Serial number]<\/em>, for example <strong>P400Plus-324688179<\/strong>.<\/p>\n<\/div><\/div>\n<p>After you have <a href=\"#set-up-beacons-in-your-customer-area\">set up beacons in your Customer Area<\/a>, route your Terminal API requests as follows:<\/p>\n<ol>\n<li><a href=\"#get-the-serial-number\">Get the serial number from the Major and Minor<\/a>. You can use <a href=\"#placeholders-for-the-major-and-minor\">our placeholders<\/a> to have the terminal advertise its serial number, encoded into the Major and Minor.<\/li>\n<li>Get the full <code>POIID<\/code>:\n<ol>\n<li>Make a POST <a href=\"\/point-of-sale\/diagnostics\/check-cloud-connection#use-an-api-call\">\n  <code>\/connectedTerminals<\/code>\n<\/a> request to find the terminals under a company account, merchant account, or store.<br \/>\nThe response lists the POIIDs.<\/li>\n<li>In the response, look up the <code>POIID<\/code> by searching for the serial number you retrieved in Step 1.<\/li>\n<\/ol><\/li>\n<li>Send your Terminal API request using the correct <code>POIID<\/code> retrieved in Step 2.<\/li>\n<\/ol>\n<h3 id=\"get-the-serial-number\">Get the serial number<\/h3>\n<p>If you set <strong>Major<\/strong> to <span translate=\"no\"><strong>${SERIALH}<\/strong><\/span> and <strong>Minor<\/strong> to <span translate=\"no\"><strong>${SERIALL}<\/strong><\/span>, the terminal advertises its serial number, encoded in the Major and Minor. For example, the serial number 324688179 is advertised as:<\/p>\n<ul>\n<li><strong>Major<\/strong>: 4954<\/li>\n<li><strong>Minor<\/strong>: 22835<\/li>\n<\/ul>\n<p>To get the serial number from the advertised values:<\/p>\n<ol>\n<li>Convert the Major and the Minor into hexadecimal:\n<ul>\n<li>hex (4954) = 135A<\/li>\n<li>hex (22835) = 5933<\/li>\n<\/ul><\/li>\n<li>Concatenate the values, with the Major corresponding to the high bits, and the Minor corresponding to the low bits:\n<ul>\n<li>135A5933<\/li>\n<\/ul><\/li>\n<li>Convert the resulting value into decimal:\n<ul>\n<li>dec(135A5933) = 324688179<\/li>\n<\/ul><\/li>\n<\/ol>\n<h2 id=\"local-communication\">Use beacons with local communications<\/h2>\n<p>With <a href=\"\/point-of-sale\/design-your-integration\/choose-your-architecture#local-communications\">local communications<\/a>, a Terminal API request is routed to the correct terminal based on:<\/p>\n<ul>\n<li>The unique terminal ID, the <code>POIID<\/code>, which you pass in the request message.<\/li>\n<li>The IP address of the terminal.<\/li>\n<\/ul>\n<p>After you have <a href=\"#set-up-beacons-in-your-customer-area\">set up beacons in your Customer Area<\/a>, route your Terminal API requests as follows:<\/p>\n<ol>\n<li><a href=\"#get-the-ip-address\">Get the IP address from the Major and Minor<\/a>. You can use <a href=\"#placeholders-for-the-major-and-minor\">our placeholders<\/a> to have the terminal advertise its IP address, encoded into the Major and Minor.<\/li>\n<li>Get the <code>POIID<\/code>. For this, you should use your own mapping from the IP address to the <code>POIID<\/code>. To populate this mapping dynamically:\n<ol>\n<li><a href=\"\/point-of-sale\/diagnostics\/request-diagnosis\">Make a diagnosis request<\/a> with a dummy <code>POIID<\/code> (for example, <code>V400m-123456789<\/code>).<\/li>\n<li>Extract the actual <code>POIID<\/code> of the terminal from the response and update your mapping.<\/li>\n<\/ol><\/li>\n<li>Send your Terminal API request using the correct <code>POIID<\/code> to the IP selected in step 1.<\/li>\n<\/ol>\n<h3 id=\"get-the-ip-address\">Get the IP address<\/h3>\n<p>You can use our placeholders to have the terminal advertise its IP address, encoded in the Major and Minor.<\/p>\n<p>For example, the IP address 192.168.47.95 is advertised as:<\/p>\n<ul>\n<li><strong>Major<\/strong>: 49320<\/li>\n<li><strong>Minor<\/strong>: 12127<\/li>\n<\/ul>\n<p>To get the IP address from the advertised values:<\/p>\n<ol>\n<li>\n<p>Get the high 16 bits of the IP address from the Major:<\/p>\n<ol>\n<li>Convert the Major to hexadecimal:\n<ul>\n<li>hex (49320) = C0A8<\/li>\n<\/ul><\/li>\n<li>Convert the high bits of the result to decimal:\n<ul>\n<li>dec(C0) = 192<\/li>\n<\/ul><\/li>\n<li>Convert the low bits of the result to decimal:\n<ul>\n<li>dec (A8) = 168<\/li>\n<\/ul><\/li>\n<li>Combine the results of steps b. and c. to get the high 16 bits of the IP address:\n<ul>\n<li>192.168<\/li>\n<\/ul><\/li>\n<\/ol>\n<\/li>\n<li>\n<p>Get the low 16 bits of the IP address from the Minor:<\/p>\n<ol>\n<li>Convert the Minor to hexadecimal:\n<ul>\n<li>hex (12127) = 2F5F<\/li>\n<\/ul><\/li>\n<li>Convert the high bits of the result to decimal:\n<ul>\n<li>dec(2F) = 47<\/li>\n<\/ul><\/li>\n<li>Convert the low bits of the result to decimal:\n<ul>\n<li>dec (5F) = 95<\/li>\n<\/ul><\/li>\n<li>Combine the results of steps b. and c. to get the low 16 bits of the IP address:\n<ul>\n<li>47.95<\/li>\n<\/ul><\/li>\n<\/ol>\n<\/li>\n<li>\n<p>Combine the results of steps 1. and 2. to get the high 16 bits of the IP address:<\/p>\n<ul>\n<li>192.168.47.95<\/li>\n<\/ul>\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=\"\/point-of-sale\/design-your-integration\/terminal-api\"\n                        target=\"_self\"\n                        >\n                    Terminal API overview\n                <\/a><\/li><li><a href=\"https:\/\/developer.apple.com\/ibeacon\/\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    Apple's iBeacon documentation\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/point-of-sale\/design-your-integration\/network-and-connectivity\/set-up-beacons","articleFields":{"description":"Use beacons to have your mobile POS app automatically connect to the nearest terminal. ","last_edit_on":"07-10-2020 09:04"},"algolia":{"url":"https:\/\/docs.adyen.com\/point-of-sale\/design-your-integration\/network-and-connectivity\/set-up-beacons","title":"Bluetooth beacons","content":"Our Bluetooth terminals use the iBeacon protocol to advertise their presence to other nearby Bluetooth devices, such as a mobile POS app. You can use the advertised data to make sure that the POS app discovers the closest terminal and uses its unique identifiers to correctly route Terminal API requests.\nRequirements\nBefore you begin, take into account the following requirements, limitations, and preparations.\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nA Terminal API integration with payment terminals.\n\n\nLimitations\nThe beacon functionality is not supported for Android terminals and unattended non-Android terminals.\n\n\n\n\n\nAdvertised values and integration types\nThe terminal advertises values using the iBeacon protocol so your mobile POS app can recognize the closest terminal. You define the following values when you set up beacons in your Customer Area:\n\nUUID: a Universally Unique Identifier consisting of 32 hexadecimal digits.\nMajor: a decimal value between 0 and 65535.\nMinor: a decimal value between 0 and 65535.\n\nThe Major and Minor values are set up to encode the terminal data needed for routing: the serial number for cloud-based communication, or the IP address for local communication.\nAfter you set up beacons, the specific terminal detail you need to retrieve from the advertised Major and Minor values depends on your integration architecture:\n\nCloud communications\nLocal communications\n\nSet up beacons in your Customer Area\nTo enable the beacon functionality and set your values for the UUID, Major, and Minor:\n\n\nLog in to your Customer Area.\n\n\nGo to In-person payments\u00a0&gt;\u00a0Terminal settings, or first go to the merchant account, store, or individual terminal where you want to set up beacons and then go to the terminal settings.\n\n\nGo to the Connectivity tab.\n\n\nIn the Beacon section:\n\nFor Enable beacons select Enabled.\nSet UUID to the Universally Unique Identifier that you want to use. You can generate a UUID using an online tool, for example uuidgenerator.\nSet Major and Minor to the values that you want to use. You are free to choose your own values, or use our placeholders.\n\n\n\nSelect Save at the bottom of the page.\n\n\nPlaceholders for the Major and Minor\nYou can use our placeholders to dynamically encode either the serial number or the IP address of the terminal into the Major and Minor, depending on whether you are using cloud or local communications.\n\n\nEncode the serial number of the terminal if you are using cloud communications:\n\n\n\n\n\n\n\n\n\nMajor\n${SERIALH}\n\n\nMinor\n${SERIALL}\n\n\n\nTo learn how to decode the advertised data, see Get the serial number.\n\n\nEncode the IP address of the terminal if you are using local communications. Here, the placeholder also depends on your network interface. For example, if you are using the first Ethernet interface, set Major to ${IPH:ETH0}, and Minor to ${IPL:ETH0}.\n\n\n\n\n\n\n\n\n\n\n\n\n\nMajor\n${IPH:ETH0}\n${IPH:ETH1}\n${IPH:WLAN0}\n${IPH:WLAN1}\n${IPH:GPRS0}\n\n\nMinor\n${IPL:ETH0}\n${IPL:ETH1}\n${IPL:WLAN0}\n${IPL:WLAN1}\n${IPL:GPRS0}\n\n\n\nTo learn how to decode the advertised data, see Get the IP address.\n\n\nUse beacons with cloud communications\nWith cloud communications, a Terminal API request is routed to the correct terminal based on the unique terminal ID, the POIID, which you pass in the request.\n\nPOIID = [Terminal model] - [Serial number], for example P400Plus-324688179.\n\nAfter you have set up beacons in your Customer Area, route your Terminal API requests as follows:\n\nGet the serial number from the Major and Minor. You can use our placeholders to have the terminal advertise its serial number, encoded into the Major and Minor.\nGet the full POIID:\n\nMake a POST \n  \/connectedTerminals\n request to find the terminals under a company account, merchant account, or store.\nThe response lists the POIIDs.\nIn the response, look up the POIID by searching for the serial number you retrieved in Step 1.\n\nSend your Terminal API request using the correct POIID retrieved in Step 2.\n\nGet the serial number\nIf you set Major to ${SERIALH} and Minor to ${SERIALL}, the terminal advertises its serial number, encoded in the Major and Minor. For example, the serial number 324688179 is advertised as:\n\nMajor: 4954\nMinor: 22835\n\nTo get the serial number from the advertised values:\n\nConvert the Major and the Minor into hexadecimal:\n\nhex (4954) = 135A\nhex (22835) = 5933\n\nConcatenate the values, with the Major corresponding to the high bits, and the Minor corresponding to the low bits:\n\n135A5933\n\nConvert the resulting value into decimal:\n\ndec(135A5933) = 324688179\n\n\nUse beacons with local communications\nWith local communications, a Terminal API request is routed to the correct terminal based on:\n\nThe unique terminal ID, the POIID, which you pass in the request message.\nThe IP address of the terminal.\n\nAfter you have set up beacons in your Customer Area, route your Terminal API requests as follows:\n\nGet the IP address from the Major and Minor. You can use our placeholders to have the terminal advertise its IP address, encoded into the Major and Minor.\nGet the POIID. For this, you should use your own mapping from the IP address to the POIID. To populate this mapping dynamically:\n\nMake a diagnosis request with a dummy POIID (for example, V400m-123456789).\nExtract the actual POIID of the terminal from the response and update your mapping.\n\nSend your Terminal API request using the correct POIID to the IP selected in step 1.\n\nGet the IP address\nYou can use our placeholders to have the terminal advertise its IP address, encoded in the Major and Minor.\nFor example, the IP address 192.168.47.95 is advertised as:\n\nMajor: 49320\nMinor: 12127\n\nTo get the IP address from the advertised values:\n\n\nGet the high 16 bits of the IP address from the Major:\n\nConvert the Major to hexadecimal:\n\nhex (49320) = C0A8\n\nConvert the high bits of the result to decimal:\n\ndec(C0) = 192\n\nConvert the low bits of the result to decimal:\n\ndec (A8) = 168\n\nCombine the results of steps b. and c. to get the high 16 bits of the IP address:\n\n192.168\n\n\n\n\nGet the low 16 bits of the IP address from the Minor:\n\nConvert the Minor to hexadecimal:\n\nhex (12127) = 2F5F\n\nConvert the high bits of the result to decimal:\n\ndec(2F) = 47\n\nConvert the low bits of the result to decimal:\n\ndec (5F) = 95\n\nCombine the results of steps b. and c. to get the low 16 bits of the IP address:\n\n47.95\n\n\n\n\nCombine the results of steps 1. and 2. to get the high 16 bits of the IP address:\n\n192.168.47.95\n\n\n\nSee also\n\n\n                    Terminal API overview\n                \n                    Apple's iBeacon documentation\n                \n","type":"page","locale":"en","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"In-person payments","lvl2":"Design your integration","lvl3":"Network and connectivity","lvl4":"Bluetooth beacons"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/point-of-sale","lvl2":"https:\/\/docs.adyen.com\/point-of-sale\/design-your-integration","lvl3":"https:\/\/docs.adyen.com\/point-of-sale\/design-your-integration\/network-and-connectivity","lvl4":"\/point-of-sale\/design-your-integration\/network-and-connectivity\/set-up-beacons"},"levels":5,"category":"In-person payments","category_color":"green","tags":["Bluetooth","beacons"]}}
