CloudPark CloudPark Integration API

You call CloudPark

Prepaid PrePaid

Check the balance and top up customers on a prepaid plan, by license plate, card or customer code.

What it is for

On a prepaid plan the customer has a balance in reais, and each use of the parking lot is deducted from that balance. This API lets your system (app, website, kiosk, point of sale) check the balance and top it up for the customer.

  • The customer is found by license plate, by card (fixed_id) or by customer code (customer_id).
  • The customer must have an active prepaid plan. The registration and the plan are set up by the parking lot in the CloudPark Dashboard (or through the Customers API).
  • The top-up payment is received by your system. CloudPark records the top-up in the parking lot's financial records as cash and does not issue an invoice (RPS) for it: the invoice for the sale is the responsibility of whoever received the payment.

Top-up flow

Identify the customerby license plate, card or code.
Check the balancewith GET /prepaid and confirm the name with the customer.
Receive the paymentin your system (PIX, card, etc.).
Top upwith POST /prepaid; the response has the new balance.

Look up the customer and the balance

GET/api/v1/integration/prepaid?plate={placa}
FieldTypeDescription
plate string (query) Vehicle license plate, without a dash (e.g. ABC1234).
fixed_id string (query) The customer's card or tag number.
customer_id string (query) Customer code at CloudPark (numeric ID).

Send at least one. If you send more than one, the search uses only the first one in this order: customer_id, plate, fixed_id.

curl "https://sandbox.cloudpark.com.br/api/v1/integration/prepaid?plate=ABC1235" \
  -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}/prepaid", params={"plate": "ABC1235"}, headers=HEADERS, timeout=15)
data = response.json()
if response.status_code == 200:
    print(f"{data['name']}: balance R$ {data['balance']:.2f}")
else:
    print("Cannot top up:", data["message"])
// npm install json-bigint: reads customer_id as a string, without losing digits
import JSONbig from "json-bigint";
const JSONbigString = JSONbig({ storeAsString: true });

const BASE_URL = "https://sandbox.cloudpark.com.br/api/v1/integration";
const headers = { "Authorization": "Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b" };

const response = await fetch(`${BASE_URL}/prepaid?plate=ABC1235`, { headers });
const data = JSONbigString.parse(await response.text());
console.log(response.ok ? `${data.name}: balance R$ ${data.balance}` : data.message);
Response 200
{
  "customer_id": 37,
  "name": "João da Silva",
  "plate": "ABC1235",
  "is_prepaid": true,
  "fixed_id": "4094124292",
  "balance": 60.0
}
FieldTypeDescription
customer_id integer Customer code. It can have up to 19 digits: store it as a string and, in JavaScript, read the response without losing precision (see Large IDs).
name string Customer name.
plate string License plate of the vehicle found (or of the first vehicle, when searching by code).
fixed_id string Card of the vehicle found.
is_prepaid boolean Whether the customer has an active prepaid plan.
balance number Current balance, in reais. Only present when is_prepaid is true.

Lookup responses

HTTPWhen it happensResponse
200 Prepaid customer found.
400 No search parameter given. {"message": "É necessário informar placa, código do cartão ou customer_id."}
400 Customer found, but without a prepaid plan. The body has the customer data, is_prepaid: false and the message. {"customer_id": 38, "name": "Ana Lima", "plate": "DEF5678", "fixed_id": "4094124293", "is_prepaid": false, "message": "O cliente informado não possui plano Pré-Pago ativo."}
401 Token missing or invalid. {"detail": "Token inválido."}
404 No customer found. {"message": "Cliente não encontrado."}
409 More than one customer with this license plate or card. Ask for another piece of data (e.g. the customer code). {"message": "Múltiplos clientes encontrados para os parâmetros informados."}

Top up the balance

POST/api/v1/integration/prepaid
FieldTypeDescription
valuerequired number Top-up amount, in reais. A JSON number greater than zero (e.g. 10.0); a string such as "10" is rejected.
customer_id string (numeric ID) Customer code, sent as a string (e.g. "37"). See Large IDs.
plate string Vehicle license plate.
fixed_id string The customer's card.

Send value and at least one identifier. For top-ups, if more than one is sent, the first one in this order wins: fixed_id, plate, customer_id.

curl -X POST https://sandbox.cloudpark.com.br/api/v1/integration/prepaid \
  -H "Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b" \
  -H "Content-Type: application/json" \
  -d '{"customer_id": "37", "value": 10.0}'
response = requests.post(
    f"{BASE_URL}/prepaid",
    json={"customer_id": str(data["customer_id"]), "value": 10.0},
    headers=HEADERS,
    timeout=15,
)
print(response.status_code, response.json())
const topUp = await fetch(`${BASE_URL}/prepaid`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({ customer_id: data.customer_id, value: 10.0 }), // customer_id is already a string
});
console.log(topUp.status, await topUp.json());
Response 200
{
  "customer_id": 37,
  "previous_balance": 60.0,
  "current_balance": 70.0,
  "plate": "ABC1235",
  "fixed_id": "4094124292",
  "message": "Saldo adicionado com sucesso."
}

The top-up also unblocks a customer who was blocked for lack of balance, and it is recorded in their transaction history in the CloudPark Dashboard.

Top-up responses

HTTPWhen it happensResponse
200 Top-up done.
400 No identifier given. {"message": "É necessário informar plate, fixed_id ou customer_id."}
400 value missing, not numeric, zero or negative. {"message": "O valor deve ser numérico e maior que zero."}
400 The customer does not have a prepaid plan. {"message": "Recarga permitida apenas para clientes pré-pagos."}
401 Token missing or invalid. {"detail": "Token inválido."}
404 Customer not found. {"message": "Cliente não encontrado."}
500 Error saving the top-up. Nothing was changed; try again. {"message": "Erro interno ao adicionar saldo."}

Test data (sandbox)

CustomerLicense plateCard (fixed_id)Result
37 João da SilvaABC12354094124292Prepaid with a balance of R$ 60.00. Top-up: 200.
38 Ana LimaDEF56784094124293No prepaid plan: 400 on lookup and top-up.
39 and 40XYZ99994094124294 / 4094124295Same license plate on two customers: 409 when looking up by license plate.
any other404: customer not found.

FAQ

Can the customer enter with a zero balance?

It depends on the prepaid plan configured by the parking lot ("can enter with zero balance" option). You can check it at GET /customerplan, field can_enter_without_balance.

How do I register a new prepaid customer?

The prepaid plan is applied by the parking lot in the CloudPark Dashboard. After that, top-ups can be made through this API.

Does CloudPark issue the invoice for the top-up?

No. Since the payment was received by your system, the invoice is issued by whoever received it.

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.

GET
Look up the customer and balance/api/v1/integration/prepaid
POST
Top up/api/v1/integration/prepaid