Skip to main content

ECR Connection

1. Activate the ECR terminal device

1.1 Open and log in to the Wonder App, and switch to the relevant business.

1.2 Start the ECR terminal device, a QR code associated with the business will be presented on the device's screen. binding business store

1.3 Bind the ECR terminal device with the business using the Wonder App's barcode scanner.

1.4 Once the binding is successful, the device application will automatically redirect you to the device pairing page. Terminal device pairing

The data format of the QR code
{
"deviceId":"NEXGO-N62-N620W318000",
"ip":"172.16.91.29",
"pairCode":"672633",
"port":8443,
"businessId":"411d6207-1470-4d35-a557-54852463844d"
}

2. ECR terminal device pairing

2.1 Via Cloud

  1. Obtain a six-digit terminal device pairing code.

  2. Enter the pairing code into the customer's pairing page, which is similar to the following flow:

  3. Generate an AES256 Key using the pairing code

  4. Use the ECR terminal Device synchronization interface to obtain the Device SN of the ECR terminal device

  5. After obtaining the Device SN, pair the device using the pairing and confirmation pairing interfaces

Terminal device pairing

2.2 Via RS232

  1. Obtain a six-digit terminal device pairing code

  2. Enter the Pairing Code into the Customer's Pairing Page, which is similar to the following flow:

  3. Generate an AES256 Key using the pairing code

  4. After obtaining the device SN, pair the device using the pairing and confirmation pairing interfaces.

Terminal device pairing

2.3 Via Local Area Network

  1. Obtain a six-digit terminal device pairing code

  2. Enter the pairing code into the customer's pairing page, which is similar to the following flow:

  3. Generate an AES256 Key using the pairing code

  4. Enter the IP address and port

  5. After obtaining the device SN, pair the device using the pairing and confirmation pairing interfaces.

Terminal device pairing

3. Interface Protocol Specification

3.1 Cloud Interface Protocol

1. Request header

VariableTypeRequiredDescription
x-p-business-idStringYThe current business ID, Specify the ECR device to receive orders for a certain Business
x-device-snStringYThe serial number of the ecr terminal payment device
x-request-idStringYEvery time communication takes place, it is crucial to ensure that the Request ID is a unique UUID.

2. Request body

VariableTypeRequiredDescription
versionStringYCurrent communication protocol version number
actionenumYActions: Pair, DeviceInfo, Sale, ...
dataStringYEncrypted data, It is necessary to distinguish the encryption keys of this data: pinCode1 and pinCode2

3. Response body

VariableTypeRequiredDescription
codeNumberYCurrent communication protocol version number
messageStringYActions: Pair, DeviceInfo, Sale, ...
dataObjectYThis data object is an ECR response data structure
data.versionStringYPlease refer to the version description of the ECR response data structure
data.actionenumYPlease refer to the action description of the ECR response data structure
data.dataStringYPlease refer to the data description of the ECR response data structure

3.2 LAN Interface Protocol

1. Request url

http://<ECR terminal device IP address>:<ECR terminal device port>/v2/wonder/payment/ecr

2. Request body

Please refer to the Request data structure of the ECR interface protocol

3. Response body

Please refer to the Response data structure of the ECR interface protocol

3.3 Serial port RS232 protocol

Please refer to the communication protocol of the ECR serial port RS232

4. Other interface request protocols

4.1 Obtain device pairing information

After you obtain the 6-digit pair Pin Code(pinCode1) generated by the ECR terminal device, you generate the AES Key through a certain algorithm. Through this secret key, you can obtain the current configuration information of the ECR terminal Device, such as: Device SN, IP address, port.

URL(Staging): https://gateway-stg.wonder.today/svc/payment/public/api/v1/openapi/terminal/info

URL(Production): https://gateway.wonder.today/svc/payment/public/api/v1/openapi/terminal/info

Request body

Please refer to the Request body

Request "data.body" structure

VariableTypeRequiredDescription
businessIDUUIDYThe current business ID, Specify the ECR device to receive orders for a certain Business
Example:

/*
Pin Code: pinCode1
Encrypt the original data:
{
"header": {
"requestID": "2c7f32e1-b9e4-4b34-96cc-15c51289f69b",
"clientDeviceSN": "126498561093",
"timestamp": "2025-11-12T10:11:04+00:00"
},
"body": {
"businessID": "ff467f02-5b69-45f3-81aa-bffcca55fe8f"
}
}
*/

{
"version": "2.0",
"action": "ConnectionInfo",
"data": "Etg9NaHEenzNUdFnhCxOcrDhelsYG2fZOlswYS76Oz123dNN1Ez/5F8ZLRk4RyXf3UYBKGGHntKCsR1duJq3gBHrpvfXLKqosEE1CuWn+xAH6scKYc7ixT9quPfuEGB8a74MQrz0UPPs7sOmOhsPLrMwsLM3yFY6u1QIErr7pAcIMc/KlGsCQMghwSTlgpfawm7KMdj7w4kRTbXooRORP1cNCrKC8D4EcuxJnLlWxP/kEEqpAj26upn4hd2uLRBu4PreoZ1/yLvZPGjWxVxFBkVqnsMNKZT7sUKqyruU7zrON9aDsfVs6YTEQiMU99dQ"
}

Response body

Please refer to the Response body

Response "data.body" structure

VariableTypeRequiredDescription
deviceSnStringYThe serial number of the payment device
ipStringNThe IP address of the payment device
portStringNThe port number of the payment device
Example:

/*
Pin Code: pinCode1
Encrypt the original data:
{
"header": {
"responseID": "2c7f32e1-b9e4-4b34-96cc-15c51289f69b",
"serverDeviceSN": "NEXGO-N96-1170270945",
"timestamp": "2025-11-12T10:12:04+00:00"
},
"body": {
"deviceSn": "NEXGO-N96-1170270945",
"ip": "192.168.1.100",
"port": "8858"
}
}
*/

{
"version": "2.0",
"action": "DeviceInfo",
"data": "ag9NSrXjd3VqY06nKGUqau+kvbX+9zoe6PobaEZ0QEapubfZj0hnscLC87Ytx3BWbryAxLvhT7p5I9r01/ftH3Z3VkyDZxvwvCNGh0XWVnRdTpc3qtkz/62fHslcMHBebfIOeaAs7eeXbAJu/bvqM1qE8zlJuBrXeIeQGLnIQL9Jozu+jANuiTI1wg9iuhHkNv0m9SiFdfL3R7lVDtgBgIgstp/WfvozSTt0qtnaMawBNDgEY9197NoVWECx2EdXmLpxC5imkoV2UfG8q0bLLk0mbqslZjmV4MKb3eBlhMQGD/p+CVMRIwZl9n9socV2eEDR4l7cc7IwAMqT6aXTqPIQD/9cyJXguBXAvdyaejmzL30ad3U1Ag6d2YfQlt+QG5y1VPMspRsRqyh/GEVLGslX+s4K9Iy7oABZv/8zYgk="
}