How it works at the checkout
The TOTVS POS already has the CloudPark integration through the Ticket de Estacionamento no Final da Venda feature (parking ticket at the end of the sale): there is nothing to develop. At the end of the sale, the POS talks to CloudPark in steps and shows each question to the operator:
If the ticket is not found, the POS asks whether to read it again. For other errors, it shows the message with an OK button and the sale continues normally.
Set up the POS
Enable the Ticket de Estacionamento no Final da Venda feature as described in the TOTVS documentation and enter the CloudPark service URL:
| Service URL | |
|---|---|
| Sandbox (testing) | https://sandbox.cloudpark.com.br/api/v1/integration/pdvtotvs |
| Production | Provided by CloudPark for each parking lot, in the format https://<parking-lot>.cloudpark.com.br/api/v1/integration/pdvtotvs |
- Authentication: none. The call does not use a token; keep the URL restricted to the store.
- Network: the POS terminals must reach the URL over HTTPS (port 443).
- Reader: the ticket field accepts up to 14 characters. Send the code as printed on the ticket, including the final check digit.
The dialog, step by step
This part is handled by the POS; it is a reference for checking the logs. Every call is a JSON POST to the URL above, and the operator's answer goes in the Response field.
| Step | The POS sends | CloudPark returns |
|---|---|---|
| 1. End of the sale | Empty Response | Message with the Sim ("1") and Não ("2") buttons. |
| 2. Operator answers | Response = "1", with the sale ID and Sale.Total | Request to read the ticket (cctGetValue, up to 14 characters). With "2", it ends (cetCompleted). |
| 3. Ticket read | Response = code read, with the same ID | Receipt in vouchersPrint and cetCompleted; or an error message. |
{
"version": 1,
"execution": "cetCompleted",
"vouchersPrint": [
{"text": " RECIBO TICKET ESTACIONAMENTO \nTICKET 400045265 LIBERADO ATE: 24/11 - 15:30"}
]
}
The messages come without accents, because some terminals cannot display them.
Messages shown on the POS
| Message | What to do |
|---|---|
| Receipt "TICKET ... LIBERADO ATE" (ticket released until) | Nothing: the customer can leave until the printed time. |
| Codigo X nao encontrado. Deseja tentar novamente? (code not found, try again?) | Read the barcode again (Sim) or continue without the discount (Não). |
| Valor da compra nao da abono ao estacionamento (purchase amount does not qualify for a parking discount) | The purchase does not reach the lowest tier. The customer pays for parking normally. |
| Esse ticket ja foi validado (ticket already validated) | The ticket has already received the discount. Reading it again does not apply the discount twice. |
| Valor pendente, valide no estacionamento (amount pending, validate at the parking lot) | The discount does not cover the whole stay; the customer pays the difference at the parking lot's checkout or kiosk. |
Test on the sandbox
With the POS pointing to the sandbox, make test sales with these tickets (the sandbox gives a discount for sales from R$ 50.00):
| Ticket | Result with a sale of R$ 50.00 or more |
|---|---|
400045265 | Discount applied; prints the receipt. |
379924820 | "Valor pendente, valide no estacionamento" (amount pending). |
384745455 | "Esse ticket já foi validado" (ticket already validated). |
403045263 | Not found; offers to read it again. |
To simulate the POS from the browser, send the scenarios below in order (1, 2 and 3):
Try it on the sandbox
Send the real request to the sandbox and see the response right here. Pick a test scenario or edit the fields; the test token is already filled in.
/api/v1/integration/pdvtotvs
Same call in cURL
Going to production
- Agree on the discount tiers with the parking lot; CloudPark sets them up.
- Ask CloudPark for the parking lot's URL and set it on the POS terminals.
- Make a real test sale with a parking ticket and check the discount at the exit kiosk.