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
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Request Body
{
"email": "string",
"phone": "string",
"name": "string",
"lastname": "string",
"isUnlimited": true,
"refId": "string",
"tags": [
{
"code": "string",
"plate": "string"
}
]
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | The email address of the customer | |
| phone | string | Yes | The phone number of the customer |
| name | string | No | The first name of the customer |
| lastname | string | No | The last name of the customer |
| isUnlimited | boolean | Yes | Indicates whether the customer has unlimited access |
| refId | string | Yes | The reference ID for the customer |
| tags | array | No | Array of tags associated with the customer |
| tags[].code | string | Yes | The code for the tag |
| tags[].plate | string | Yes | The plate associated with the tag |
Response
{
"customer": 0,
"tags": [
{
"tag": "string",
"status": true
}
]
}
| Field | Type | Description |
|---|---|---|
| customer | number | The ID of the newly added customer |
| tags | array | Array of tags associated with the customer |
| tags[].tag | string | The tag associated with the customer |
| tags[].status | boolean | The 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
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Request Body
{
"customerId": 0,
"refId": "string"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| customerId | number | No | The ID of the customer |
| refId | string | Yes | The reference ID of the customer |
Response
[
{
"id": 0,
"code": "string",
"plate": "string"
}
]
| Field | Type | Description |
|---|---|---|
| id | number | The ID of the tag |
| code | string | The code of the tag |
| plate | string | The 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
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Request Body
{
"customer": {
"refId": "string",
"id": 0
},
"tags": [
{
"code": "string",
"plate": "string"
}
]
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer.refId | string | Yes | The reference ID of the customer |
| customer.id | number | No | The ID of the customer |
| tags | array | Yes | Array of tags to be added |
| tags[].code | string | Yes | The code of the tag |
| tags[].plate | string | Yes | The plate associated with the tag |
Response
{
"customer": 0,
"tagsCreate": [
{
"tag": "string",
"status": true
}
]
}
| Field | Type | Description |
|---|---|---|
| customer | number | The ID of the customer |
| tagsCreate | array | Array of created tags |
| tagsCreate[].tag | string | The created tag |
| tagsCreate[].status | boolean | The 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
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Request Body
{
"customer": {
"id": 0,
"refId": "string"
},
"tags": [
{
"code": "string",
"plate": "string"
}
]
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer.id | number | No | The ID of the customer |
| customer.refId | string | Yes | The reference ID of the customer |
| tags | array | Yes | Array of tags to be cancelled |
| tags[].code | string | Yes | The code of the tag |
| tags[].plate | string | Yes | The plate associated with the tag |
Response
{
"customer": 0,
"tagsCancell": [
{
"tag": "string",
"cancell": true
}
]
}
| Field | Type | Description |
|---|---|---|
| customer | number | The ID of the customer |
| tagsCancell | array | Array of cancelled tags |
| tagsCancell[].tag | string | The cancelled tag |
| tagsCancell[].cancell | boolean | The 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