# Register device POST https://api-sandbox.payabli.com/api/Cloud/register/{entry} Content-Type: application/json Register a cloud device to an entrypoint. See [Devices Quickstart](/developers/developer-guides/devices-quickstart#devices-quickstart) for a complete guide. Reference: https://docs.payabli.com/developers/api-reference/cloud/register-cloud-device ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Register cloud device version: endpoint_cloud.addDevice paths: /Cloud/register/{entry}: post: operationId: add-device summary: Register cloud device description: >- Register a cloud device to an entrypoint. See [Devices Quickstart](/developers/developer-guides/devices-quickstart#devices-quickstart) for a complete guide. tags: - - subpackage_cloud parameters: - name: entry in: path description: >- The paypoint's entrypoint identifier. [Learn more](/developers/api-reference/api-overview#entrypoint-vs-entry) required: true schema: type: string - name: requestToken in: header required: true schema: type: string - name: idempotencyKey in: header required: false schema: $ref: '#/components/schemas/type_:IdempotencyKey' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_cloud:AddDeviceResponse' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: type: object properties: description: type: string description: >- Description or name for the device. This can be anything, but Payabli recommends entering the name of the paypoint, or some other easy to identify descriptor. If you have several devices for one paypoint, you can give them descriptions like "Cashier 1" and "Cashier 2", or "Front Desk" and "Back Office" registrationCode: type: string description: >- The device registration code or serial number, depending on the model. - Ingenico devices: This is the activation code that's displayed on the device screen during setup. - PAX A920 device: This code is the serial number on the back of the device. components: schemas: type_:IdempotencyKey: type: string type_:IsSuccess: type: boolean type_:ResponseText: type: string type_:PageIdentifier: type: string type_cloud:AddDeviceResponse: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseText: $ref: '#/components/schemas/type_:ResponseText' pageIdentifier: $ref: '#/components/schemas/type_:PageIdentifier' responseData: type: string description: |- If `isSuccess` = true, this contains the device identifier. If `isSuccess` = false, this contains the reason for the error. required: - responseText ``` ## SDK Code Examples ```python Register from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.cloud.add_device( entry="8cfec329267", registration_code="YS7DS5", description="Front Desk POS", ) ``` ```typescript Register import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.cloud.addDevice("8cfec329267", { registrationCode: "YS7DS5", description: "Front Desk POS" }); ``` ```go Register import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Cloud.AddDevice( context.TODO(), "8cfec329267", &sdkgo.DeviceEntry{ RegistrationCode: sdkgo.String( "YS7DS5", ), Description: sdkgo.String( "Front Desk POS", ), }, ) ``` ```csharp Register using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Cloud.AddDeviceAsync( "8cfec329267", new DeviceEntry { RegistrationCode = "YS7DS5", Description = "Front Desk POS" } ); ``` ```ruby Register require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Cloud/register/8cfec329267") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"description\": \"Front Desk POS\",\n \"registrationCode\": \"YS7DS5\"\n}" response = http.request(request) puts response.read_body ``` ```java Register HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/Cloud/register/8cfec329267") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"description\": \"Front Desk POS\",\n \"registrationCode\": \"YS7DS5\"\n}") .asString(); ``` ```php Register request('POST', 'https://api-sandbox.payabli.com/api/Cloud/register/8cfec329267', [ 'body' => '{ "description": "Front Desk POS", "registrationCode": "YS7DS5" }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift Register import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = [ "description": "Front Desk POS", "registrationCode": "YS7DS5" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Cloud/register/8cfec329267")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```