Saltar al contenido principal

Users API

The Users API provides endpoints for managing customers and their associated tags.

Create Client​

Creates a new customer in the system.

Endpoint​

POST /api/v3/business/customer/add

Headers​

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Request Body​

{
"email": "string",
"phone": "string",
"name": "string",
"lastname": "string",
"isUnlimited": true,
"refId": "string",
"tags": [
{
"code": "string",
"plate": "string"
}
]
}
ParameterTypeRequiredDescription
emailstringYesThe email address of the customer
phonestringYesThe phone number of the customer
namestringNoThe first name of the customer
lastnamestringNoThe last name of the customer
isUnlimitedbooleanYesIndicates whether the customer has unlimited access
refIdstringYesThe reference ID for the customer
tagsarrayNoArray of tags associated with the customer
tags[].codestringYesThe code for the tag
tags[].platestringYesThe plate associated with the tag

Response​

{
"customer": 0,
"tags": [
{
"tag": "string",
"status": true
}
]
}
FieldTypeDescription
customernumberThe ID of the newly added customer
tagsarrayArray of tags associated with the customer
tags[].tagstringThe tag associated with the customer
tags[].statusbooleanThe status of the tag

Example​

curl -X POST \
'https://api.parkup.cl/api/v3/business/customer/add' \
-H 'Authorization: Bearer \{your_access_token\}' \
-H 'Content-Type: application/json' \
-d '{
"email": "customer@example.com",
"phone": "+56975880800",
"name": "John",
"lastname": "Doe",
"isUnlimited": true,
"refId": "AAAABBB0001",
"tags": [
{
"code": "O202020",
"plate": "JPKJ21"
}
]
}'

Get All Tags​

Retrieves all tags associated with a customer.

Endpoint​

POST /api/v3/business/tag/list

Headers​

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Request Body​

{
"customerId": 0,
"refId": "string"
}
ParameterTypeRequiredDescription
customerIdnumberNoThe ID of the customer
refIdstringYesThe reference ID of the customer

Response​

[
{
"id": 0,
"code": "string",
"plate": "string"
}
]
FieldTypeDescription
idnumberThe ID of the tag
codestringThe code of the tag
platestringThe plate associated with the tag

Example​

curl -X POST \
'https://api.parkup.cl/api/v3/business/tag/list' \
-H 'Authorization: Bearer \{your_access_token\}' \
-H 'Content-Type: application/json' \
-d '{
"refId": "AAAABBB0001"
}'

Create Tags User​

Adds new tags to a customer.

Endpoint​

POST /api/v3/business/tag/add

Headers​

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Request Body​

{
"customer": {
"refId": "string",
"id": 0
},
"tags": [
{
"code": "string",
"plate": "string"
}
]
}
ParameterTypeRequiredDescription
customer.refIdstringYesThe reference ID of the customer
customer.idnumberNoThe ID of the customer
tagsarrayYesArray of tags to be added
tags[].codestringYesThe code of the tag
tags[].platestringYesThe plate associated with the tag

Response​

{
"customer": 0,
"tagsCreate": [
{
"tag": "string",
"status": true
}
]
}
FieldTypeDescription
customernumberThe ID of the customer
tagsCreatearrayArray of created tags
tagsCreate[].tagstringThe created tag
tagsCreate[].statusbooleanThe status of the tag creation

Example​

curl -X POST \
'https://api.parkup.cl/api/v3/business/tag/add' \
-H 'Authorization: Bearer \{your_access_token\}' \
-H 'Content-Type: application/json' \
-d '{
"customer": {
"refId": "AAAABBB0001"
},
"tags": [
{
"code": "J929292",
"plate": "JPKJ20"
}
]
}'

Cancel Tag​

Cancels tags associated with a customer.

Endpoint​

PUT /api/v3/business/tag/cancel

Headers​

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Request Body​

{
"customer": {
"id": 0,
"refId": "string"
},
"tags": [
{
"code": "string",
"plate": "string"
}
]
}
ParameterTypeRequiredDescription
customer.idnumberNoThe ID of the customer
customer.refIdstringYesThe reference ID of the customer
tagsarrayYesArray of tags to be cancelled
tags[].codestringYesThe code of the tag
tags[].platestringYesThe plate associated with the tag

Response​

{
"customer": 0,
"tagsCancell": [
{
"tag": "string",
"cancell": true
}
]
}
FieldTypeDescription
customernumberThe ID of the customer
tagsCancellarrayArray of cancelled tags
tagsCancell[].tagstringThe cancelled tag
tagsCancell[].cancellbooleanThe status of the tag cancellation

Example​

curl -X PUT \
'https://api.parkup.cl/api/v3/business/tag/cancel' \
-H 'Authorization: Bearer \{your_access_token\}' \
-H 'Content-Type: application/json' \
-d '{
"customer": {
"refId": "AAAABBB0001"
},
"tags": [
{
"code": "O202020",
"plate": "JPKJ21"
}
]
}'

Error Responses​

401 Unauthorized​

{
"statusCode": 401,
"message": "Unauthorized"
}

409 Conflict​

{
"statusCode": 409,
"message": "User with ID 1 sticket active",
"error": "Conflict"
}

This error occurs when:

  • The user already has an active sticker
  • The tag is already in use