External Result
Send a request to provide an external discount approval result to a PAX POS device after a discount or loyalty card is read.
approved
Whether the external discount was approved.
responseCode
Response code from the external system.
callbackUrl
The URL that CloudLinkApi will use to return information to the caller.
deviceToken
The token of a PAX POS device.
correlationId
An ID provided by the caller. Returned in the callback for message matching.
timeToLive
The maximum time, in seconds, for a request to reach the physical terminal. The default value is 5 seconds.
terminalId
If terminal has more than one merchant, this field is used to identify the merchant. To get a list of merchants, use the requestMerchantConfig request. Value can be null.
type
Example: https://tools.ietf.org/html/rfc7231#section-6.5.1
title
Bad Request
status
400
detail
DeviceId not registered
message
Unauthorized
message
Server Error
/discount/externalresult
202 Accepted External Result
curl -X post https://CloudLinkApi/discount/externalresult -H 'X-API-KEY: your-access-key-here' -d ' { "approved": true, "responseCode": "00", "callbackUrl": "http://example.com/webhook-endpoint", "deviceToken": "b16526c3447ba6cea4818d", "correlationId": "5d1d4ea-8229-44d7-b517-26a5ae6c2fda", "timeToLive": 5, "terminalId": null } '{ "message": "Accepted" }
400 Bad Request
curl -X post https://CloudLinkApi/discount/externalresult -H 'X-API-KEY: your-access-key-here' -d ' { "approved": true, "responseCode": "00", "callbackUrl": "http://example.com/webhook-endpoint", "deviceToken": "b16526c3447ba6cea4818d", "correlationId": "5d1d4ea-8229-44d7-b517-26a5ae6c2fda", "timeToLive": 5, "terminalId": null } '{ "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1", "title": "Bad Request", "status": 400, "detail": "DeviceId not registered" }
401 Unauthorized
curl -X post https://CloudLinkApi/discount/externalresult -H 'X-API-KEY: your-access-key-here' -d ' { "approved": true, "responseCode": "00", "callbackUrl": "http://example.com/webhook-endpoint", "deviceToken": "b16526c3447ba6cea4818d", "correlationId": "5d1d4ea-8229-44d7-b517-26a5ae6c2fda", "timeToLive": 5, "terminalId": null } '{ "message": "Unauthorized" }
500 Server Error
curl -X post https://CloudLinkApi/discount/externalresult -H 'X-API-KEY: your-access-key-here' -d ' { "approved": true, "responseCode": "00", "callbackUrl": "http://example.com/webhook-endpoint", "deviceToken": "b16526c3447ba6cea4818d", "correlationId": "5d1d4ea-8229-44d7-b517-26a5ae6c2fda", "timeToLive": 5, "terminalId": null } '{ "message": "Server Error" }