What it is for
Your business charges the full parking fee at its own checkout (POS, ticket office, front desk, app) and tells CloudPark that the ticket has been paid. The customer does not go through the parking lot's checkout or kiosk: they drive straight to the exit.
- Who uses it: parks, tourist attractions, clubs, events, stores and ticketing systems that sell parking together with the admission ticket or the purchase.
- How much to charge: the API itself calculates the amount, using the parking lot's price table (contract). See What
valuemeans for which amount it is. - If the store only gives a free-time discount based on the purchase amount, use Store Integration. The two can be used together: first the discount, then charging whatever is left.
Flow
There are two calls: a lookup (how much the customer owes) and a validation (the customer has paid).
- Read the ticket. From the barcode number, the QR Code or the vehicle's license plate.
- Look up the amount with
GET /agreementvalidation. The response has the entry time, the license plate and thevalueto charge. - Charge the customer in your system.
- Report the payment with
POST /agreementvalidation, sending the amount charged. The response says until when the customer can leave (expiration_date).
The contract_id
The contract is the price table used in the calculation. The parking lot creates a contract for your integration in the CloudPark Dashboard and gives you the code. On the sandbox, use 221137600.
In production the contract code can have up to 19 digits. Treat it as a string and send it as a string (e.g. "221137600"), as explained in Large IDs.
If the ticket already has a contract linked to it (for example, an agreement applied at the entrance), that contract takes precedence over the contract_id you send.
Look up the ticket amount
By ticket number or license plate
/api/v1/integration/agreementvalidation/{ticket_id}?contract_id={contract_id}| Field | Type | Description |
|---|---|---|
ticket_idrequired |
string (path) | Ticket number, as printed in the barcode (with or without the final check digit) or the license plate of a vehicle that is in the parking lot (e.g. ABC1234 or ABC-1234). Digits only = ticket; with letters = license plate. |
contract_idrequired |
string (query) | Contract code (numeric ID). Sandbox: 221137600. |
# By ticket number
curl "https://sandbox.cloudpark.com.br/api/v1/integration/agreementvalidation/400045265?contract_id=221137600" \
-H "Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
# By license plate
curl "https://sandbox.cloudpark.com.br/api/v1/integration/agreementvalidation/ABC1234?contract_id=221137600" \
-H "Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
import requests
BASE_URL = "https://sandbox.cloudpark.com.br/api/v1/integration"
HEADERS = {"Authorization": "Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"}
response = requests.get(
f"{BASE_URL}/agreementvalidation/400045265",
params={"contract_id": "221137600"},
headers=HEADERS,
timeout=15,
)
ticket = response.json()
print(response.status_code, ticket)
const BASE_URL = "https://sandbox.cloudpark.com.br/api/v1/integration";
const headers = { "Authorization": "Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b" };
const response = await fetch(`${BASE_URL}/agreementvalidation/400045265?contract_id=221137600`, { headers });
const ticket = await response.json();
console.log(response.status, ticket);
By QR Code
/api/v1/integration/agreementvalidation?qr_code={qr_code}&contract_id={contract_id}| Field | Type | Description |
|---|---|---|
qr_coderequired |
string (query) | Full content of the ticket's QR Code, exactly as read. URL-encode the value: it may contain +, /, =, & and *. Only text with 14 or more characters is treated as a QR Code. |
contract_idrequired |
string (query) | Contract code (numeric ID). Sandbox: 221137600. |
# --data-urlencode URL-encodes the QR Code
curl -G "https://sandbox.cloudpark.com.br/api/v1/integration/agreementvalidation" \
-H "Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b" \
--data-urlencode "qr_code=6m6cwh*fj7kmr*rehzzw*ABC1234*0*15.35*0*rei02j*rei2r7*e1" \
--data-urlencode "contract_id=221137600"
# requests encodes the parameters automatically
response = requests.get(
f"{BASE_URL}/agreementvalidation",
params={"qr_code": "6m6cwh*fj7kmr*rehzzw*ABC1234*0*15.35*0*rei02j*rei2r7*e1", "contract_id": "221137600"},
headers=HEADERS,
timeout=15,
)
// URLSearchParams URL-encodes the QR Code
const params = new URLSearchParams({
qr_code: "6m6cwh*fj7kmr*rehzzw*ABC1234*0*15.35*0*rei02j*rei2r7*e1",
contract_id: "221137600",
});
const response = await fetch(`${BASE_URL}/agreementvalidation?${params}`, { headers });
Lookup response (200)
{
"id": 400045265,
"entry_date": "2026-11-23T10:07:31Z",
"plate": "ABC1234",
"value": 15.35
}
| Field | Type | Description |
|---|---|---|
id |
integer | Internal ticket code. Use it as the validation's ticket_id when you looked up by license plate or QR Code. |
entry_date |
date/time | When the vehicle entered the parking lot, in UTC (ending in Z). |
plate |
string | Vehicle license plate, when recognized. |
value |
number | Amount, in reais, if the customer leaves now. See below which amount it is. |
What value means
The amount depends on how the parking lot configured the integration:
- Default: it is the contract's agreement amount, calculated with the agreement prices of the price table. If the contract has no agreement prices,
valueis0. - Integration configured to record the payment as the customer's (in a parking lot cash register), or ticket that already has a contract linked: it is the amount the customer must pay, minus what they already paid.
If value is 0 for a ticket that has been parked for a while, check with the parking lot whether the contract has agreement prices.
Lookup errors
| HTTP | When it happens | Response |
|---|---|---|
| 400 | The ticket or the contract_id is missing. |
{"message": "Devem ser informados os campos: 'ticket_id' e 'contract_id'"} |
| 400 | The vehicle has already left the parking lot. | {"message": "O movimento com o código 384745455 já foi dado saída", "code": 7} |
| 400 | The ticket was deleted by the parking lot. | {"message": "O movimento com o código 379924820 já foi excluído", "code": 8} |
| 401 | Token missing or invalid. | {"detail": "Token inválido."} |
| 404 | Ticket not found. | {"message": "Código 403045263 não encontrado"} |
| 404 | No vehicle with this license plate is in the parking lot. | {"message": "Código ticket não encontrado, XYZ9876."} |
| 404 | The QR Code could not be decoded (wrong check digit, incomplete or cut off). Other defects (e.g. text that is not a CloudPark QR Code) also return 404, but with a technical message in message: decide by the HTTP status code. |
{"message": "Não foi possível decodificar o QRCode para identificar o movimento"} |
| 404 | Contract not found. | {"message": "Contrato não encontrado"} |
A QR Code that decodes always identifies the ticket: if the ticket is not on the server yet (e.g. the entry has not synced), CloudPark creates it from the QR Code data.
Validate the ticket (report the payment)
/api/v1/integration/agreementvalidationRecords the payment on the ticket and releases the exit.
| Field | Type | Description |
|---|---|---|
ticket_idrequired |
integer | Ticket to validate. Use the same ticket number as in the lookup; if you looked up by license plate or QR Code, use the id returned by the lookup. |
contract_idrequired |
string (numeric ID) | Contract code, sent as a string (e.g. "221137600"). Sandbox: "221137600". |
paid_valuerequired |
number | Amount you charged the customer, in reais (usually the lookup's value). Must be greater than or equal to zero. |
curl -X POST https://sandbox.cloudpark.com.br/api/v1/integration/agreementvalidation \
-H "Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b" \
-H "Content-Type: application/json" \
-d '{"ticket_id": 400045265, "contract_id": "221137600", "paid_value": 15.35}'
response = requests.post(
f"{BASE_URL}/agreementvalidation",
json={"ticket_id": ticket["id"], "contract_id": "221137600", "paid_value": ticket["value"]},
headers=HEADERS,
timeout=15,
)
if response.status_code == 200:
print("Exit released until", response.json()["expiration_date"])
else:
print("Not validated:", response.json().get("message"))
const validation = await fetch(`${BASE_URL}/agreementvalidation`, {
method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ ticket_id: ticket.id, contract_id: "221137600", paid_value: ticket.value }),
});
const result = await validation.json();
console.log(validation.ok ? `Exit released until ${result.expiration_date}` : `Not validated: ${result.message}`);
Validation response (200)
{
"expiration_date": "2026-11-23T18:42:10Z",
"message": "Ticket validado com sucesso"
}
| Field | Type | Description |
|---|---|---|
expiration_date |
date/time | Until when the customer can leave, in UTC (ending in Z). After that, the extra time is charged again. |
message |
string | Description of what happened. |
The amount you report is recorded in the parking lot's financial records. By default it is recorded as a payment by the business (agreement); the parking lot can also configure the integration to record the amount as a payment by the customer, in a specific cash register.
Validation errors
| HTTP | When it happens | Response |
|---|---|---|
| 400 | A field is missing. | {"message": "Devem ser informados os campos: 'ticket_id', 'contract_id' e 'paid_value'"} |
| 400 | Negative paid_value. |
{"message": "Valor deve ser maior ou igual a zero"} |
| 400 | The vehicle has already left the parking lot. | {"message": "O movimento com o código 384745455 já foi dado saída", "code": 7} |
| 400 | The ticket was deleted by the parking lot. | {"message": "O movimento com o código 379924820 já foi excluído", "code": 8} |
| 400 | The integration records into a parking lot cash register and that register is closed. | {"message": "Caixa da integração não está aberto"} |
| 401 | Token missing or invalid. | {"detail": "Token inválido."} |
| 404 | Ticket not found. | {"message": "Código 403045263 não encontrado"} |
| 404 | Contract not found. | {"message": "Contrato não encontrado"} |
Test data (sandbox)
In every call use contract_id 221137600. Any other value returns 404 (contract not found).
| Ticket / license plate / QR Code | Result |
|---|---|
400045265 | Lookup: 200, amount R$ 15.35. Validation: 200. |
license plate ABC1234 | Lookup: 200 (ticket 400045265). |
QR 6m6cwh*fj7kmr*rehzzw*ABC1234*0*15.35*0*rei02j*rei2r7*e1 | Lookup: 200 (ticket 400045265). |
QR /p0SunTYkHmyHciP4IAeFvy3Uf+savkvd5MchQDDdWK2KqD/Lgs6yUMG72n7lfDY6RY+EPn+7xYqJlnuaZytDkkygz0Vm5rAirVHGtGCiPU= | Lookup: 200 (QR Code in the old format). |
403045263 | 404: ticket not found. |
384745455 | 400: vehicle has already left. |
379924820 | 400: ticket deleted. |
QR CIqI+M3hE6SdOQ0E+njsoj0GycwF0pMrIqB4pJMi9Oz7nYnMHYiO3/8qOgXfy/uUYUdhXhOFstWAu+SCW6R6ra+sSaie1qp/Qp2cjvS25eE= | Lookup: 400, vehicle already left (ticket 384745455, QR Code in the old format). |
QR MMxSyocbKl3jnZojuGvRqvVkIloyOH3bkXHzmi1WA5SyuoxX2t38Uuqaf2SKlIwBcP3TEo7qMdbFcl8gh+Exj/oiTRuCP3v/dNrSt7AVygc= | Lookup: 400, ticket deleted (ticket 379924820, QR Code in the old format). |
QR 3MtCBsqnHkGs5P0Z7q+vwbn1CycVfKCCKgg6A78u9WEdSlAekn3S5XquK9yZw4Sma7PM5/qTvC2ud4x14JKENei6MYVUprrY6zAcHYDxEnY= | Lookup: 200 (ticket 403045263). In production, a valid QR Code for a ticket that is not on the server yet creates the ticket. |
QR 6m6cwh*fj7kmr*rehzzw*ABC1234*0*15.35*0*rei02j*rei2r7*e2 | 404: the QR Code could not be decoded. |
negative paid_value | Validation: 400. |
FAQ
Do I need to look up before validating?
It is recommended: the lookup confirms the ticket exists, that the vehicle is still in the parking lot, and tells you how much to charge. The validation accepts any paid_value greater than or equal to zero, so your system is responsible for charging the right amount.
Can I validate with a zero amount?
Yes. This releases the exit without recording an amount (for example, when parking is a courtesy of your business). Agree on this rule with the parking lot.
The customer looked up the amount but took a while to pay. Does the amount change?
Yes: the value is calculated for the moment of the lookup. Look it up again before charging if a lot of time has passed.
How long does the customer have to leave after the validation?
Whatever comes in expiration_date. The grace period is configured by the parking lot.
Why does the QR Code return "Não foi possível decodificar o QRCode" (could not decode the QR Code)?
Because the QR Code arrived incomplete: most often the value was not URL-encoded and the & cuts off the parameter (CloudPark already fixes a + that became a space). It also happens with a partial read of the code. Use your HTTP library's encoding (see the examples above).
I also use Store Integration. How do I combine them?
First call Store Integration to apply the purchase discount. If minutes_to_exit comes back as 0, look up the remaining amount here, charge it and validate.
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/agreementvalidation/{ticket_id}
Same call in cURL
/api/v1/integration/agreementvalidation
Same call in cURL
/api/v1/integration/agreementvalidation
Same call in cURL