Skip to main content

Ticket

info

ticket is things for delivery

Every tickets api must have ACCESS_TOKEN what you got when login and APPLICATION_ID that manager by application service

All APIs endpoints

The ticket object

  • status:

api tickets for customer

Get list of tickets for customer

Request

curl --location --request GET 'https://api-v1-stg.lumyri.com/tickets/customer?page=1&limit=50' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \

Response

{
"error": null,
"data": {
"total": 1,
"per_page": 5,
"current_page": 1,
"last_page": 1,
"data": [
{
"id": "7d805b6a-6cde-4e88-8b25-11f327c4b921",
"scheduled_date": "2022-09-11",
"app_id": "213eeda8-f113-40fd-80a1-ce273f4d00f7",
"description": "IPhone 14prm",
"address": {
"name": "Paradise Road, Adventure, Negro Bay, Saint Croix District, United States Virgin Islands, 00840, United States",
"geo": [-64.81686, 17.72533]
},
"status": "Delivered",
"ticket_number": "123456",
"customer_id": "67eade53-3316-4c85-9b5a-ba54f6bdf2b3",
"eta": "2022-11-09T08:09:15.873628Z",
"geo": "POINT(-64.81686, 17.72533)",
"created_at": "2022-11-09T08:09:15.873628Z",
"updated_at": "2022-11-09T08:09:15.873628Z",
"deleted_at": null,
"customer": {
"id": "6b15c46e-1b98-404c-a4d1-378a06d33b0b",
"first_name": "join",
"last_name": "witch",
"phone": "097333333",
"avatar": ""
},
"route": "48c7a967-a0d4-4e3c-aeb2-b44a36ed4ba5",
"labels": null
}
]
}
}

Customer confirm receiving ticket

Example request

curl --location --request POST 'https://api-v1-stg.lumyri.com/tickets/customer/confirm/$TICKET_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"received": true
}'

Response

{
"error": null,
"data": {
"message": "OK"
}
}

Customer upload image

curl --location --request POST 'http://localhost:9081/tickets/upload-image' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--form 'ticket_id="$TICKET_ID"' \
--form 'upload=@"_filePath/1.jpeg"'
{
"error": null,
"data": {
"url": "c8be9cac-ed56-49a8-9b4f-54dacae290ce/3cc448e0-9384-4038-bde6-daf37a0c50f8-1.jpeg"
}
}

APIs ticket for the admin

Get a list of tickets

Parameter

  • page: optional
    • default: 1
    • description: the current page
  • limit: optional
    • default: 10
    • description: the number of threads in each page
  • status: optional
    • description: status of a ticket
    • option: Un_Assigned or Assigned
  • scheduled_date: optional
    • description: delivery date of tickets

Example request

curl --location --request GET 'https://api-v1-stg.lumyri.com/tickets?page=1&limit=10&status=Un_Assigned' \
--header 'x-app-id: $APPLICATION_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \

Response

{
"error": null,
"data": {
"total": 1,
"per_page": 10,
"current_page": 1,
"last_page": 1,
"data": [
{
"id": "93d088b5-2155-47fd-a082-0b2a872103b7",
"scheduled_date": "",
"app_id": "694a8345-5f10-4924-b438-5a038a3884a5",
"description": "",
"company_id": "805afbb9-c721-4d1b-845b-aed6ec5a0cb2",
"status": "Un Assigned",
"ticket_number": "e4cf5ec6-5f4c-45db-a2e5-edbc2c8e8718",
"invoice_number": "",
"customer": {
"id": "169b6430-337d-4ba7-b2b4-26f47aabaad1",
"name": "thong nc ",
"phone": "12345678",
"avatar": "",
"address": {
"category": "Office",
"location": {
"name": "Hanoi, HI, Vietnam",
"geo": [21.0245, 105.84117]
}
}
},
"customer_email": "tester@gmail.com",
"eta": 0,
"distance": 0,
"start_time": null,
"origin": "",
"geo": "POINT(21.0245 105.84117)",
"route_id": "",
"agent_id": "",
"notification": false,
"delivered": {
"success": {
"parcel": "",
"comment": "",
"signature": ""
},
"failed": {
"reason": ""
},
"timestamp": ""
},
"created_at": "2023-02-22T07:37:14.080821Z",
"updated_at": "2023-02-22T07:37:14.080821Z",
"deleted_at": null,
"company_name": "",
"route": null,
"labels": [
{
"id": "95705a58-d989-4b22-968e-14b7179773a0",
"name": "fast food",
"color": "#bd10e0"
}
]
}
]
}
}

Get ticket detail

curl --location --request GET 'https://api-v1-stg.lumyri.com/tickets/93d088b5-2155-47fd-a082-0b2a872103b7' \
--header 'Content-Type: application/json' \
--header 'x-app-id: $APPLICATION_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \

Response

{
"error": null,
"data": {
"id": "93d088b5-2155-47fd-a082-0b2a872103b7",
"scheduled_date": "",
"app_id": "694a8345-5f10-4924-b438-5a038a3884a5",
"description": "",
"company_id": "805afbb9-c721-4d1b-845b-aed6ec5a0cb2",
"status": "Un Assigned",
"ticket_number": "e4cf5ec6-5f4c-45db-a2e5-edbc2c8e8718",
"invoice_number": "",
"customer": {
"id": "169b6430-337d-4ba7-b2b4-26f47aabaad1",
"name": "thong nc ",
"phone": "12345678",
"avatar": "",
"address": {
"category": "Office",
"location": {
"name": "Hanoi, HI, Vietnam",
"geo": [21.0245, 105.84117]
}
}
},
"customer_email": "tester@gmail.com",
"eta": 0,
"distance": 0,
"start_time": null,
"origin": "",
"geo": "POINT(21.0245 105.84117)",
"route_id": "",
"agent_id": "",
"notification": false,
"delivered": {
"success": {
"parcel": "",
"comment": "",
"signature": ""
},
"failed": {
"reason": ""
},
"timestamp": ""
},
"created_at": "2023-02-22T07:37:14.080821Z",
"updated_at": "2023-02-22T07:37:14.080821Z",
"deleted_at": null,
"company_name": "",
"route": {
"id": "",
"name": "",
"color": "",
"app_id": "",
"status": "",
"scheduled_date": "",
"agent_id": "",
"company_id": "",
"origin": {
"name": "",
"geo": [0, 0]
},
"destination": {
"name": "",
"geo": [0, 0]
},
"routes": {
"distance": 0,
"duration": 0,
"legs": null
},
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"deleted_at": null,
"labels": null,
"tickets": null,
"agent": {
"id": "",
"first_name": "",
"last_name": "",
"phone": "",
"avatar": ""
},
"total_tickets": 0
},
"labels": [
{
"id": "95705a58-d989-4b22-968e-14b7179773a0",
"name": "fast food",
"color": "#bd10e0"
}
]
}
}

Create ticket

Parameters

  • scheduled_date: optional
  • ticket_number: require
    • description: a unique id to manage ticket
  • invoice_number: optional
  • customer: require
  • label_ids: optional
  • route_id: optional
  • description: optional

Example request

curl --location --request POST 'https://api-v1-stg.lumyri.com//tickets' \
--header 'x-app-id: $APPLICATION_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"scheduled_date": "2023-02-22",
"notification": false,
"ticket_number": "71ca55ab-6799-493d-b667-f5f7e201983c",
"invoice_number": "",
"customer": {
"name": "thong nc ",
"id": "169b6430-337d-4ba7-b2b4-26f47aabaad1",
"phone": "12345678",
"avatar": "",
"address": {
"category": "Office",
"location": {
"name": "Hanoi, HI, Vietnam",
"geo": [
21.0245,
105.84117
]
}
},
"email": "tester@gmail.com"
},
"label_ids": [
"95705a58-d989-4b22-968e-14b7179773a0"
],
"description": "",
"route_id": "ccc569f6-84c6-48c7-9c40-c3fce4fe8067"
}'

Response when success

{
"error": null,
"data": {
"message": "OK"
}
}

Update ticket

Example request

curl --location --request PUT 'https://api-v1-stg.lumyri.com/tickets/1bdd4eba-58e6-4bd4-9378-fba1429fe836' \
--header 'x-app-id: $APPLICATION_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"scheduled_date": "2022-12-13",
"ticket_number": "12345481203",
"invoice_number": "121345555",
"notification": true,
"customer": {
"id": "d5396d91-f095-4d54-a0ed-fd7278a13739",
"name": "ticket2",
"phone": "0987654321",
"avatar": "",
"address": {
"category": "Home",
"location": {
"name": "Groupe Pronature",
"geo": [ 46.807641537431174, -71.2918555250339 ]
}
},
"email": "customer@example.com"
},
"label_ids": [
"b9a8f981-44e9-424c-89b5-79cde82a5fad",
"f69e2923-1a85-4d28-8a05-d2e9ec684b61"
],
"description": "Ticket 233444 ",
"route_id": "2ef1ee26-60f5-4879-b2ca-94e2e12545f0"
}'

response

{
"error": null,
"data": {
"message": "OK"
}
}

Delete tickets

Parameter

  • ticket_ids: require
    • description: a list of ticket ids
  • status: require
    • description: this is status of list tickets
    • option: Failed, Un_Assigned or Assigned

Example request

curl --location --request DELETE 'http://localhost:9081/tickets' \
--header 'x-app-id: $APPLICATION_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"ticket_ids": [
"29458a6b-584f-4726-84c2-c3adf96af7d1"
],
"status": "Failed"
}'

Response

{
"error": null,
"data": {
"message": "OK"
}
}

APIs tickets for an agent

Get a list of tickets

curl --location --request GET 'https://api-v1-stg.lumyri.com/tickets/agent?scheduled_date=2022-08-27&page=1&limit=5&search=111' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
{
"error": null,
"data": {
"total": 10,
"per_page": 1,
"current_page": 1,
"last_page": 1,
"data": [
{
"id": "18a95ae7-0317-40d9-9751-96f05f94163c",
"scheduled_date": "2022-08-27",
"app_id": "14e43e28-7e6d-461e-b1c9-7c54736f4331",
"description": "This is the task for Sonph",
"company": "",
"status": "Un Assigned",
"ticket_number": "12345481203",
"customer": {
"id": "d5396d91-f095-4d54-a0ed-fd7278a13739",
"name": "customer test",
"phone": "0987654321",
"avatar": "",
"address": {
"name": "'F222",
"geo": [105.79831254565379, 22.997713230859155]
}
},
"customer_email": "customer@example.com",
"eta": "2022-11-22T07:36:01.157277Z",
"geo": "POINT(105.79831254565379 22.997713230859155)",
"delivered": {
"success": {
"parcel": "",
"comment": "",
"signature": ""
},
"failed": {
"reason": ""
},
"timestamp": ""
},
"created_at": "2022-11-22T07:36:01.157277Z",
"updated_at": "2022-11-22T07:36:01.157277Z",
"deleted_at": null,
"route": null,
"labels": null
}
]
}
}

Update status ticket fail

curl --location --request PUT 'http://localhost:9081/tickets/agent/failed/a1ed8e0a-4bee-4d46-bd95-ab3827cae0b0' \
--header 'Authorization: Bearer $ACCESS_TOKEN \
--header 'Content-Type: application/json' \
--data-raw '{
"reason": "test updated failed"
}'

Response

{
"error": null,
"data": {
"id": "a1ed8e0a-4bee-4d46-bd95-ab3827cae0b0",
"scheduled_date": "2022-08-27",
"app_id": "14e43e28-7e6d-461e-b1c9-7c54736f4331",
"description": "This is the task for Sonph",
"address": {
"name": "'F222",
"geo": [105.79831254565379, 22.997713230859155]
},
"status": "Failed",
"ticket_number": "1234548120",
"customer_id": "04c10c92-1111-4edf-a08a-7253ebd3459c",
"eta": "2022-11-15T10:40:08.608206Z",
"geo": "POINT(105.79831254565379 22.997713230859155)",
"delivered": {
"success": {
"parcel": "",
"comment": "",
"signature": ""
},
"failed": {
"reason": "test updated failed"
}
},
"created_at": "2022-11-15T10:40:08.608206Z",
"updated_at": "2022-11-16T02:44:28.678780298Z",
"deleted_at": null
}
}

Update status ticket success

curl --location --request PUT 'https://api-v1-stg.lumyri.com/tickets/agent/delivered/4ddcef0f-6787-460b-8fff-68331e6f0b6c' \
--header 'Authorization: Bearer $ASSESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"comment": "ticket delivered",
"parcel": "https://www.google.com/url?sa=i&url=https%3A%2F%2Fdictionary.cambridge.org%2Fvi%2Fdictionary%2Fenglish%2Fparcel&psig=AOvVaw3BLf_mVbNi5vjcfLHNWKv2&ust=1668651998028000&source=images&cd=vfe&ved=0CBAQjRxqFwoTCODurqDTsfsCFQAAAAAdAAAAABAD",
"signature": "https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.wisestamp.com%2Fhandwritten-signature-generator%2F&psig=AOvVaw0FmQP-msPlJxgE_EsxoLIk&ust=1668652020870000&source=images&cd=vfe&ved=0CBAQjRxqFwoTCJCsoarTsfsCFQAAAAAdAAAAABAD"
}'
{
"error": null,
"data": {
"id": "c8be9cac-ed56-49a8-9b4f-54dacae290ce",
"scheduled_date": "2022-08-27",
"app_id": "14e43e28-7e6d-461e-b1c9-7c54736f4331",
"description": "This is the task for Sonph",
"address": {
"name": "'F222",
"geo": [105.79831254565379, 22.997713230859155]
},
"status": "Delivered",
"ticket_number": "1234548120",
"customer_id": "04c10c92-1111-4edf-a08a-7253ebd3459c",
"eta": "2022-11-15T10:32:08.265798Z",
"geo": "POINT(105.79831254565379 22.997713230859155)",
"delivered": {
"success": {
"parcel": "https://www.google.com/url?sa=i&url=https%3A%2F%2Fdictionary.cambridge.org%2Fvi%2Fdictionary%2Fenglish%2Fparcel&psig=AOvVaw3BLf_mVbNi5vjcfLHNWKv2&ust=1668651998028000&source=images&cd=vfe&ved=0CBAQjRxqFwoTCODurqDTsfsCFQAAAAAdAAAAABAD",
"comment": "ticket delivered",
"signature": "https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.wisestamp.com%2Fhandwritten-signature-generator%2F&psig=AOvVaw0FmQP-msPlJxgE_EsxoLIk&ust=1668652020870000&source=images&cd=vfe&ved=0CBAQjRxqFwoTCJCsoarTsfsCFQAAAAAdAAAAABAD"
},
"failed": {
"reason": ""
}
},
"created_at": "2022-11-15T10:32:08.265798Z",
"updated_at": "2022-11-16T02:43:56.415879171Z",
"deleted_at": null
}
}