---
# System prepended metadata

title: Jumppoint Api alpha

---

---
title: 'Jumppoint Api alpha'
disqus: hackmd
---

Jumppoint Api alpha
===
![downloads](https://img.shields.io/github/downloads/atom/atom/total.svg)
![build](https://img.shields.io/appveyor/ci/:user/:repo.svg)
![chat](https://img.shields.io/discord/:serverId.svg)

## Table of Contents

[TOC]

<!-- ## Beginners Guide

If you are a total beginner to this, start here!

1. Visit hackmd.io
2. Click "Sign in"
3. Choose a way to sign in
4. Start writing note! -->

Overview
---

```gherkin=
Feature: simple with basic functionality for internal use. 

Base_url:  http://devone.jumppoint.io

```

Datatypes
---

```gherkin=
remarks: All string type cannot be empty unless otherwise specified.

address: {
    "name": {string},
    "phone": {string},
    "companyName"?: {string},
    "email"?: {string},
    "line1": {string && str.length < 35},
    "line2"?: {string},
    "city": {string},
    "state": {string},
    "postalCode": {string},
    "countryCodeAlpha2": {string && str.length == 2}
};

item: {
    "description": {string},
    "sku": {string},
    "category":
    | "mobiles" | "tablets" | "computer_laptops" | "cameras" | "accessory_no_battary"
    | "accessory_battary" | "health_beauty" | "fashion" | "watches" | "home_appliances" 
    | "home_decor" | "toys" | "sport" | "luggage" | "audio_video" | "documents" | "jewelry" 
    | "dry_food_sypplements" | "books_collectionables" | "pet_accessory" | "gaming",

    "actualWeight": {number},
    "length": {number},
    "height": {number},
    "width": {number},
    "declaredCurrency": | "HKD",
    "declaredCustomsValue": {number},
    "quantity": {number > 0}
};

userId: {string && str.length == 36 && uuidv4};
courierId: {string && str.length == 36 && uuidv4};
shipmentId: {string && str.length == 36 && uuidv4};
checkpointId: {string && str.length == 36 && uuidv4};
addressId: {string && str.length == 36 && uuidv4};
externalAddressId: {string && str.length == 36 && uuidv4 | null};
itemId: {string && str.length == 36 && uuidv4};
externalItemId: {string && str.length == 36 && uuidv4};
type: "destination" | "origin";

LocalDate: {yyyy-mm-ddThh:mm:ss};

supportedChars = {~!@#$%^&*()_+`-=}



```

Users
---
> create new user 
```gherkin=
// request
axios.request({
    "method": "POST",
    "url": "/users",
    "data":{
        "name": {string},
        "defaultAddress":{address},
        "userAuth":{
            "userName": {string, length(8-30 inclusive), CaseInsensitive, alphanumerics},
            "authenticationText": {string, length(8-30 inclusive), CaseSensitive, alphanumerics, supporedChars}
        }
    }
});

// return 
{
    "status": |"success" | "failed",
    "message": {string},
    "data": {
        "userId": {userId},
    };
}

// example
axios.request({
    "method": "POST",
    "url": "/users",
    "data": {
        "name": "test",
        "defaultAddress":{
            "name": "test name",
            "phone": "12345678",
            "email": "_@gamil.com",
            "companyName": "happy company",
            "line1": "flat 501 fake tower TKO",
            "line2": "",
            "postalCode": "0",
            "state": "HK",
            "city": "HK",
            "countryCodeAlpha2": "HK"
        },
        "userAuth": {
            "userName": "login name",
            "authenticationText": "pw"
        }
    }
})


response.data: {
    "status": "success",
    "message": "create a user proceed sucessfully",
    "data": {
        "userId": "f85b898d-07ac-4259-a66c-6136ac1c39d4"
    }
}

```
---

> get user info
```gherkin=
// request
axios.request({
    "method": "GET"
    "url": "/users/{"userName": {string},"authenticationText": {string}}"
});

// return 
{
    "status": |"success" | "failed",
    "message": {string},
    "data": {
        "id": {userId},
        "name": {string},
        "name_alias": {string | null},
        "easyship_support": {boolean},
        "account_balance": {number},
        "created_at": {LocalDate},
        "updated_at": {LocalDate | null},
    }
}

// example
axios.request({
    "method": "GET",
    "url": "/users/{"userName":"falcon@aigniter.com","authenticationText":"password"}"
})

data.response: {
    "status": "success",
    "message": "get user Info proceed sucessfully",
    "data": {
        "id": "c73783f1-49b1-44b2-af64-b91b9ce420a3",
        "name": "falcon",
        "nameAlias": null,
        "easyshipSupport": true,
        "accountBalance": 136,
        "createdAt": "2020-03-04T08:22:42.000Z",
        "updatedAt": "2020-03-04T08:50:19.000Z",
        "deletedAt": null
    }
}
```
---

> get user's saved address
```gherkin=
// request
axios.request({
    "method": "GET"
    "url": "/users/:userId/addresses/:type"
});

// return 
{
    "status": |"success" | "failed",
    "message": {string},
    "data": {
        "addresses": [
            "id": {addressId},
            "externalAddressId": {externalAddressId},
            "addressLine1": {string},
            "addressLine2": {string | null},
            "addressLine3": {string | null},
            "postalCode": {string | null},
            "city": {string | null},
            "state": {string | null},
            "countryCodeAlpha2": {string && str.length == 2},
            "contactEmail": {string | null},
            "companyName": {string | null},
            "contactName": {string},
            "contactPhone": {string | null},
            "name": {string},
            "type": {string},
            "createdAt": {datetime},
            "updatedAt": {datetime},
            "isDeleted": 0 | 1,
            "deletedAt": {datetime | null},
            "currency":  | "HKD"
        ]
    }
}

// example
axios.request({
    "method": "GET",
    "url": "/users/69223620-f188-4a93-b83c-a96c7a9fce9c/addresses/destination
})

data.response: {
    "status": "success",
    "message": "get user saved addresses proceed sucessfully",
    "data": {
        "addresses": [
            {
                "id": "ccd2fa77-b6eb-45b5-a243-1dece6d59fed",
                "externalAddressId": null,
                "addressLine1": "aawer1",
                "addressLine2": "ergsdfg1",
                "addressLine3": null,
                "postalCode": "0",
                "city": "Hong Kong",
                "state": "Hong Kong",
                "countryCodeAlpha2": "HK",
                "contactEmail": null,
                "companyName": null,
                "contactName": "test1",
                "contactPhone": "9874563211",
                "name": "default",
                "type": "destination",
                "createdAt": "2020-04-17T09:54:45.000Z",
                "updatedAt": "2020-04-17T09:54:45.000Z",
                "isDeleted": 0,
                "deletedAt": null,
                "currency": "HKD"
            },
            {
                "id": "008c69b4-6ed5-4079-8c68-ba006c6f8dbf",
                "externalAddressId": null,
                "addressLine1": "aawer1",
                "addressLine2": "ergsdfg1",
                "addressLine3": null,
                "postalCode": "0",
                "city": "Hong Kong",
                "state": "Hong Kong",
                "countryCodeAlpha2": "HK",
                "contactEmail": null,
                "companyName": null,
                "contactName": "test11",
                "contactPhone": "9874563211",
                "name": "default",
                "type": "destination",
                "createdAt": "2020-04-17T09:58:46.000Z",
                "updatedAt": "2020-04-17T09:58:46.000Z",
                "isDeleted": 0,
                "deletedAt": null,
                "currency": "HKD"
            }
        ]
    }
}
```
---

> get user's saved items
```gherkin=
// request
axios.request({
    "method": "GET"
    "url": "/users/:userId/items"
});

// return 
{
    "status": {"success" | "failed"},
    "message": {string},
    "data": {
        "items": [
            "id": {itemId},
            "shipmentOrderId": {shipmentId},
            "externalItemId": {externalItemId | null},
            "description": {string | null},
            "sku": {string | null},
            "weight": {number},
            "height": {number},
            "width": {number},
            "length": {number},
            "category": {"mobiles" | "tablets" | "computer_laptops" | "cameras" | "accessory_no_battary" | "accessory_battary" | "health_beauty" | "fashion" | "watches" | "home_appliances" | "home_decor" | "toys" | "sport" | "luggage" | "audio_video" | "documents" | "jewelry" | "dry_food_sypplements" | "books_collectionables" | "pet_accessory" | "gaming"},
            "declaredCustomsValue": {number},
            "quantity": {number},
            "createdAt": {datetime},
            "updatedAt": {datetime},
            "deletedAt": {datetime | null}
        ]
    }
}

// example
axios.request({
    "method": "GET",
    "url": "/users/69223620-f188-4a93-b83c-a96c7a9fce9c/items
})

data.response: {
    "status": "success",
    "message": "get user saved items proceed sucessfully",
    "data": {
        "items": [
            {
                "id": "162d4c7f-b103-4084-a03c-7bf7f06e5ce1",
                "shipmentOrderId": "5abb2bc9-12b9-40e8-a673-fe2a7754d73d",
                "externalItemId": "0d9ccd36-dfdd-4009-a292-d9289a17cbfd",
                "description": "af",
                "sku": "asdfasdf",
                "weight": 34,
                "height": 54,
                "width": 23,
                "length": 41,
                "category": "mobile_phones",
                "declaredCustomsValue": 45,
                "quantity": 1,
                "createdAt": "2020-04-17T09:58:46.000Z",
                "updatedAt": "2020-04-17T09:58:46.000Z",
                "deletedAt": null
            },
            {
                "id": "2b878c31-413e-4a89-8233-80e155623889",
                "shipmentOrderId": "6c93f5ee-252e-4687-b020-73f639e02ab2",
                "externalItemId": "e5666b27-1018-4932-a24a-22eca99383e2",
                "description": "af",
                "sku": "asdfasdf",
                "weight": 34,
                "height": 54,
                "width": 23,
                "length": 41,
                "category": "mobile_phones",
                "declaredCustomsValue": 45,
                "quantity": 1,
                "createdAt": "2020-04-16T10:22:36.000Z",
                "updatedAt": "2020-04-16T10:22:36.000Z",
                "deletedAt": null
            }
        ]
    }
}
```

Rates
---
> get available couriers
```gherkin=
// request
axios.request({
    "method": "POST"
    "url": "logistics/rate/v1/rates",
    "data": {
        "originPostalCode": {string},
        "destinationPostalCode": {string},
        "destinationCountryAlpha2": {string && str.length == 2},
        "isInsured"?: {boolean, default false},
        "taxesDutiesPaidBy"?: | "Sender" | "Receiver"
        "items": [{item}, ]
    }
});

// return 
{
    "status": |"success" | "failed",
    "message": {string},
    "data": [
        {
            "courier": {
                "id": {courierId},
                "name": {string},
            },
            "courierDoesPickup": {boolean},
            "minDeliveryDay": {number},
            "maxDelivertDay": {number},
            "costRank": {number},
            "isInsured": {boolean},
            "exstimatedImportTax": {number},
            "estimatedImportDuty": {number},
            "totalCharge": {number},
            "availableHandoverOptions": {string},
            "fullDescription": {string | null},
        },
    ]
}

// example 
axios.request({
    "method": "POST"
    "url": "logistics/rate/v1/rates",
    data: {
        "originPostalCode": "0",
        "destinationPostalCode": "0",
        "destinationCountryAlpha2": "HK",
        "isInsured": true,
        "items": [{
            "description": "paper",
            "category": "luggage",
            "sku": "no",
            "actualWeight": 10,
            "length": 20,
            "height": 20,
            "width": 20,
            "declaredCurrency": "HKD",
            "declaredCustomsValue": 100,
            "quantity": 1
    }]
}
})

response.data= {
    "status": "success",
    "message": "request for avaliable couriers proceed sucessfully",
    "data": [
        {
            "courier": {
                "id": "a94a9ba0-43e7-4c77-9319-4eac1c257c64",
                "name": "UPS - Worldwide Saver"
            },
            "minDeliveryDay": 4,
            "maxDeliveryDay": 5,
            "costRank": 1,
            "isInsured": true,
            "exstimatedImportTax": 177.242375856,
            "estimatedImportDuty": 199.18,
            "totalCharge": 1028.83,
            "courierDoesPickup": true,
            "availableHandoverOptions": "dropoff,paid_pickup",
            "fullDescription": "UPS - Worldwide Saver (4-5 working days) HKD 531.42 of taxes & duties are INCLUDED in the cost"
        },
    ]
}
```

Shipments
---
> create a new shipment
```gherkin=
// request 
axios.request({
    "method": "POST"
    "url": "logistics/shipment/v1/shipments",
    data:{
        "originAddress":{ address },
        "destinationAddress":{ address },
        "userId": {userId},
        "isInsured": {boolean},
        "taxesDutiesPaidBy"?: | "Sender" | "Receiver"
        "selectedCourierId": {courierId},
        "items":[{item}, ]
    }    
});

// return 
{
    "status": |"success" | "failed",
    "message": {string},
    "data": {
        "shipmentId": "902f47e3-b0b1-4e72-89eb-d67e3628f192",
        "originAddress": {address},
        "destinationAddress": {address},
        "orderNote": {stirng | null},
        "isInsured": {boolean},
        "importTax": {number},
        "importDuty": {number},
        "totalCharge": {number},
        "paymentRecipient": | "Jumppoint" | "Courier",
        "availableHandoverOptions": {string},
        "shipmentState": {string},
        "items": [{item}, ],
        "selectedCourier": {
            "id": {courierId},
            "name": {string},
        }
    }
}



// example
axios.request({
    "method": "POST",
    "url": "logistics/shipment/v1/shipments",
    "data": {
    "userId": "c73783f1-49b1-44b2-af64-b91b9ce420a3",
	"isInsured": false,
	"selectedCourierId": "e6c4c64f-5054-4c98-bd66-10bda71465bf",
	"originAddress":{
		"name": "faker",
		"companyName": "faker.com",
		"email": "faker@gmail.com",
		"phone": "22463844",
		"line1": "Hong Kong ar mxxher fxxker",
		"city": "Hong Kong",
		"state": "Hong Kong",
		"postalCode": null,
		"countryCodeAlpha2": "HK"
	},
	"destinationAddress":{
		"name": "falcon",
		"phone": "56002063",
		"companyName": "faker.com",
		"email": "faker@gmail.com",
		"line1": "TKO",
		"city": "HK",
		"state": "HK",
		"postalCode": null,
		"countryCodeAlpha2": "HK"
	},
	"items":[{
        "description": "paper",
        "category": "luggage",
        "sku": "no",
        "actualWeight": 10,
        "length": 20,
        "height": 20,
        "width": 20,
        "declaredCurrency": "HKD",
        "declaredCustomsValue": 100,
        "quantity": 1
    }]
}
})


response.data = {
    "status": "success",
    "message": "create shipment proceed sucessfully",
    "data": {
        "shipmentId": "d313dbb3-c0c7-4237-a95b-26e607b2bdf6",
        "originAddress": {
            "companyName": "faker.com",
            "contactName": "faker",
            "contactEmail": "faker@gmail.com",
            "contactPhone": "22463844",
            "addressLine1": "Hong Kong ar mxxher fxxker",
            "addressLine2": "",
            "postalCode": "0",
            "city": "Hong Kong",
            "state": "Hong Kong",
            "countryCodeAlpha2": "HK"
        },
        "destinationAddress": {
            "companyName": null,
            "contactName": "falcon",
            "contactEmail": null,
            "contactPhone": "56002063",
            "addressLine1": "TKO",
            "addressLine2": null,
            "postalCode": "0",
            "city": "Hong Kong",
            "state": "Hong Kong",
            "countryCodeAlpha2": "HK"
        },
        "orderNotes": "delivery from Falcon in Hong Kong",
        "isInsured": true,
        "importTax": 177.24,
        "importDuty": 199.18,
        "totalCharge": 1028.83,
        "paymentRecipient": "Jumppoint",
        "availableHandoverOptions": "dropoff,paid_pickup",
        "shipmentState": "created",
        "items": [
            {
                "externalId": "eacf7ea3-d692-4690-8d61-1ef85f06c706",
                "description": "paper",
                "sku": "no",
                "actualWeight": 10,
                "length": 20,
                "height": 20,
                "width": 20,
                "category": "bags_luggages",
                "quantity": 1,
                "declaredCurrency": "HKD",
                "declaredCustomsValue": 100
            }
        ],
        "selectedCourier": {
            "id": "e6c4c64f-5054-4c98-bd66-10bda71465bf",
            "name": "SF Express - Local"
        }
    }
}
```



---
> List all shipments
```gherkin=
// request 
axios.request({
    "method": "GET"
    "url": "logistics/shipment/v1/shipments/{userId}",  
});

// return 
{
    "status": |"success" | "failed",
    "message": {string},
    "data": [
        {
            "id": {shipmentId},
            "userId": {userId},
            "shipmentState": {string},
            "deliveryState": {string},
            "selectedCourier": {
                "id": {string},
                "name": {string}
            }
        },
    ]
}

// example
axios.request({
    "method": "POST",
    "url": "/logistics/shipment/v1/shipments/{"userId":"c73783f1-49b1-44b2-af64-b91b9ce420a3"}"
});

response.data = {
    "status": "success",
    "message": "get all shipments proceed sucessfully",
    "data": [
        {
            "id": "141341ba-b2f2-4374-b2c2-023a3f47e29e",
            "userId": "c73783f1-49b1-44b2-af64-b91b9ce420a3",
            "shipmentState": "created",
            "deliveryState": "not_created",
            "selectedCourier": {
                "id": "e6c4c64f-5054-4c98-bd66-10bda71465bf",
                "name": "SF Express - Local"
            }
        },
    ]
}
```

---
> Get a shipment details
```gherkin=
// request 
axios.request({
    "method": "GET",
    "url": "logistics/shipment/v1/shipments/{shipmentId}"
});

// return 
{
    "status": "success",
    "message": "get shipments by ids proceed sucessfully",
    "data": {
        "id": {shipmentId},
        "userId": {userId},
        "shipmentState": {string},
        "deliveryState": {string},
        "orderNotes": {string},
        "totalCustomsValue": {number},
        "totalActualWeight": {number},
        "isInsured": {boolean},
        "currency": | "HKD",
        "paymentRecipient": | "Jumppoint" | "Courier",
        "importTax": {number},
        "importDuty": {number},
        "totalCharge": {number},
        "selectedCourier": {
            "id": {courierId},
            "name": {string}
        },
        "originAddress": { address },
        "destinationAddress": {address},
        "items": [{item},],
        "labels": [],
        "pickups": []
    }
}


// example
axios.request({
    "method": "GET",
    "url": "/logistics/shipment/v1/shipments/{"userId":"c73783f1-49b1-44b2-af64-b91b9ce420a3", "shipmentOrderId": "141341ba-b2f2-4374-b2c2-023a3f47e29e"}"
})


repsone.data = {
    "status": "success",
    "message": "get shipments by ids proceed sucessfully",
    "data": {
        "id": "141341ba-b2f2-4374-b2c2-023a3f47e29e",
        "userId": "c73783f1-49b1-44b2-af64-b91b9ce420a3",
        "shipmentState": "created",
        "deliveryState": "not_created",
        "orderNotes": "delivery from Falcon in Hong Kong",
        "totalCustomsValue": 866,
        "totalActualWeight": 2.51,
        "isInsured": true,
        "currency": "HKD",
        "paymentRecipient": "Jumppoint",
        "importTax": 177.24,
        "importDuty": 199.18,
        "totalCharge": 1028.83,
        "selectedCourier": {
            "id": "e6c4c64f-5054-4c98-bd66-10bda71465bf",
            "name": "SF Express - Local"
        },
        "originAddress": {
            "id": "e51dcc78-0690-4c2e-86b0-26d8b48bba43",
            "addressLine1": "Hong Kong ar mxxher fxxker",
            "addressLine2": null,
            "addressLine3": null,
            "postalCode": "0",
            "city": "Hong Kong",
            "state": "Hong Kong",
            "countryCodeAlpha2": "HK",
            "contactEmail": "faker@gmail.com",
            "companyName": "faker.com",
            "contactName": "faker",
            "contactPhone": "22463844",
            "name": "default",
            "createdAt": "2020-03-04T08:23:17.000Z",
            "updatedAt": "2020-03-04T08:23:17.000Z",
            "isDeleted": 0,
            "deletedAt": null
        },
        "destinationAddress": {
            "id": "c8956127-59b7-4a62-b1e3-d266dc0f28ce",
            "addressLine1": "TKO",
            "addressLine2": null,
            "addressLine3": null,
            "postalCode": "0",
            "city": "Hong Kong",
            "state": "Hong Kong",
            "countryCodeAlpha2": "HK",
            "contactEmail": null,
            "companyName": null,
            "contactName": "falcon",
            "contactPhone": "56002063",
            "name": "default",
            "createdAt": "2020-03-04T08:23:18.000Z",
            "updatedAt": "2020-03-04T08:23:18.000Z",
            "isDeleted": 0,
            "deletedAt": null
        },
        "items": [
            {
                "id": "d260a619-41ea-47a5-a5b3-e46b2b1e4d65",
                "shipmentOrderId": "141341ba-b2f2-4374-b2c2-023a3f47e29e",
                "description": "paper",
                "sku": "no",
                "weight": 10,
                "height": 20,
                "width": 20,
                "length": 20,
                "category": "bags_luggages",
                "declaredCustomsValue": 100,
                "quantity": 1,
                "createdAt": "2020-03-05T03:33:13.000Z",
                "updatedAt": "2020-03-05T03:33:13.000Z",
                "deletedAt": null
            }
        ],
        "labels": [],
        "pickups": []
    }
}
```

---
> Delete A shipment

one can delete a shipment before it is paid for label.

```gherkin=
// request 
axios.request({
    "method": "DELETE",
    "url": "shipment/v1/shipments/{shipmentId}"
});

// return 
{
    "status": | "success" | "deleted",
    "message": {string}
    "data": {
        "isDeleted": {boolean},
        "message": {string}
    },
}

// example
axios.request({
    "method": "DELETE",
    "url": "logistics/shipment/v1/shipments/{"userId":"c73783f1-49b1-44b2-af64-b91b9ce420a3", "shipmentOrderId": "141341ba-b2f2-4374-b2c2-023a3f47e29e"}",
})

response.data = {
    "status": "success",
    "message": "delete a shipment by id proceed sucessfully",
    "data": {
        "isDeleted": true,
        "message": "Shipment successfully deleted"
    }
}

```


Labels
---
> confirm a shipment and buy label

will return an error if user does not have enough deposit.

```gherkin=
// request
axios.request({
    "method": "POST",
    "url": "logistics/label/v1/labels/",
    "data": {
	"userId": {userId},
	"shipmentId": {shipmentId}
    }  
})

// return 

{
    "status": | "success" | "failed",
    "message": {string},
    "data": {
        "id": {labelId},
        "userId": {userId},
        "shipmentId": {shipmentId},
        "labelStatus": {string},
        "labelState": {string},
        "labelUrl": {string | null},
        "trackingNumber": {string | null},
        "trackingPageUrl": {string | null},
        "cost": {number},
        "availableBalance": {number},
        "errors": {string[]},
        "paymentRecipient": {string | null}
    }
}

// example
axios.request({
    "method": "POST",
    "url": "/logistics/label/v1/labels/",
    "data":{
	    "userId": "c73783f1-49b1-44b2-af64-b91b9ce420a3",
	    "shipmentId": "aed324ca-8a64-48eb-b992-d240721325fc"
    }
});

response.data = {
    "status": "success",
    "message": "confirm and buy label proceed sucessfully",
    "data": {
        "id": "8170d1be-e8c5-4a78-b18e-dc4a69f621a9",
        "userId": "c73783f1-49b1-44b2-af64-b91b9ce420a3",
        "shipmentId": "aed324ca-8a64-48eb-b992-d240721325fc",
        "lbaelStatus": "success",
        "labelState": "pending",
        "labelUrl": null,
        "trackingNumber": null,
        "trackingPageUrl": "https://www.trackmyshipment.co/shipment-tracking/ESHK10022548",
        "cost": 64,
        "availableBalance": 8,
        "errors": [],
        "paymentRecipient": null
    }
}

```
After buying labels, user can user get a shipment detail again to obtain label and tracking information.


Pickups
---
> retrieve available pickup slots in the coming 7 days.

```gherkin=
// request
axios.request({
    "method": "GET",
    "url": "/logistics/pickup/v1/pickup_slots/{courierId}"
});

// return
{
    "status": | "sucess" | "failed",
    "message": {string},
    "data": {
        "courierId": {coureriId},
        "courierName": {string},
        "message": {string},
        "timeSlots": [
            {
                "minTime": {LocalDate},
                "maxTime": {LocalDate}
            }
        ]
    }
}

// example

axios.request({
    "method": "GET",
    "url": "logistics/pickup/v1/pickup_slots/{"userId":"c73783f1-49b1-44b2-af64-b91b9ce420a3", "courierId": "e6c4c64f-5054-4c98-bd66-10bda71465bf"}"
})

response.data = {
    "status": "success",
    "message": "get available pickup slots proceed sucessfully",
    "data": {
        "courierId": "e6c4c64f-5054-4c98-bd66-10bda71465bf",
        "courierName": "SF Express - Local",
        "message": "This Courier provides a pickup service. The available time slots are shown in local time, for the coming 7 days.",
        "timeSlots": [
            {
                "minTime": "2020-03-06T09:00:00",
                "maxTime": "2020-03-06T11:00:00"
            },
            {
                "minTime": "2020-03-06T11:00:00",
                "maxTime": "2020-03-06T13:00:00"
            },
            {
                "minTime": "2020-03-06T13:00:00",
                "maxTime": "2020-03-06T15:00:00"
            },
            {
                "minTime": "2020-03-06T15:00:00",
                "maxTime": "2020-03-06T17:00:00"
            },
            {
                "minTime": "2020-03-07T09:00:00",
                "maxTime": "2020-03-07T11:00:00"
            },
            {
                "minTime": "2020-03-07T11:00:00",
                "maxTime": "2020-03-07T13:00:00"
            },
            {
                "minTime": "2020-03-07T13:00:00",
                "maxTime": "2020-03-07T15:00:00"
            },
            {
                "minTime": "2020-03-09T09:00:00",
                "maxTime": "2020-03-09T11:00:00"
            },
            {
                "minTime": "2020-03-09T11:00:00",
                "maxTime": "2020-03-09T13:00:00"
            },
            {
                "minTime": "2020-03-09T13:00:00",
                "maxTime": "2020-03-09T15:00:00"
            },
            {
                "minTime": "2020-03-09T15:00:00",
                "maxTime": "2020-03-09T17:00:00"
            },
            {
                "minTime": "2020-03-10T09:00:00",
                "maxTime": "2020-03-10T11:00:00"
            },
            {
                "minTime": "2020-03-10T11:00:00",
                "maxTime": "2020-03-10T13:00:00"
            },
            {
                "minTime": "2020-03-10T13:00:00",
                "maxTime": "2020-03-10T15:00:00"
            },
            {
                "minTime": "2020-03-10T15:00:00",
                "maxTime": "2020-03-10T17:00:00"
            },
            {
                "minTime": "2020-03-11T09:00:00",
                "maxTime": "2020-03-11T11:00:00"
            },
            {
                "minTime": "2020-03-11T11:00:00",
                "maxTime": "2020-03-11T13:00:00"
            },
            {
                "minTime": "2020-03-11T13:00:00",
                "maxTime": "2020-03-11T15:00:00"
            },
            {
                "minTime": "2020-03-11T15:00:00",
                "maxTime": "2020-03-11T17:00:00"
            },
            {
                "minTime": "2020-03-12T09:00:00",
                "maxTime": "2020-03-12T11:00:00"
            },
            {
                "minTime": "2020-03-12T11:00:00",
                "maxTime": "2020-03-12T13:00:00"
            },
            {
                "minTime": "2020-03-12T13:00:00",
                "maxTime": "2020-03-12T15:00:00"
            },
            {
                "minTime": "2020-03-12T15:00:00",
                "maxTime": "2020-03-12T17:00:00"
            }
        ],
        "dropoffUrl": null
    }
}
```

___
> request a pickup with courier

```gherkin=
// request

axios.request({
    "method": "POST",
    "url": "/logistics/pickup/v1/pickups/",
    "data" : {
        "userId": {userId},
        "shipmentId": {shipemntId},
        "courierId": {courierId},
        "minTime": {LocalDate},
        "maxTime": {LocalDate}
    }
})

// return
{
    "status": | "success" | "failed",
    "message": { string },
    "data": {
        "pickupId": {pickupId},
        "selectedCourier": {
            "id": {courierId},
            "name": {string}
        },
        "timeSlots": {
            "minTime": {LocalDate},
            "maxTime": {LocalDate}
        },
        "pickupFee": {number},
        "providerName": {string},
        "providerCustomerServicePhone": {string | null},
        "totalActualWeight": {number},
        "pickupState": {string},
        "pickupAddress": {address}
    }
}

// example

response.data = {
    "status": "success",
    "message": "arrange a pick up proceed sucessfully",
    "data": {
        "pickupId": "76c2b595-13c3-4904-9c9d-63716f210691",
        "selectedCourier": {
            "id": "e6c4c64f-5054-4c98-bd66-10bda71465bf",
            "name": "SF Express - Local"
        },
        "timeSlots": {
            "minTime": "2020-03-06T11:00:00",
            "maxTime": "2020-03-06T13:00:00"
        },
        "pickupFee": 0,
        "providerName": "Standard Pickup",
        "providerCustomerServicePhone": null,
        "totalActualWeight": 10,
        "pickupState": "requested",
        "pickupAddress": {
            "contactName": "faker",
            "contactPhone": "22463844",
            "contactEmail": "faker@gmail.com",
            "companyName": "faker@gmail.com",
            "countryCodeAlpha2": "HK",
            "postalCode": "0",
            "city": "Hong Kong",
            "state": "Hong Kong",
            "addressLine1": "Hong Kong ar mxxher fxxker",
            "addressLine2": "",
            "addressLine3": null
        }
    }
}

```



Track (last update: Apr 17, 2020)
---
> get checkpoints of a specific shipment order

```gherkin=
// request
axios.request({
    "method": "GET",
    "url": "/logistics/track/v1/checkpoints/{userId, shipmentId}"
});

// return
{
    "status": {"sucess" | "failed"},
    "message": {string},
    "data": {
        "shipmentId": {shipmentId},
        "checkpoints": [
            {
                "id": {checkpointId},
                "orderNumber": {int},
                "handler": {string | null},
                "message": {string | null},
                "location": {string | null},
                "city": {string | null},
                "countryName": {string | null},
                "countryIso3": {string | null},
                "state": {string | null},
                "postalCode": {string | null},
                "checkpointTime": {LocalDate},
                "createdAt": {datetime},
                "updatedAt": {datetime},
                "deletedAt": {datetime | null}
            }
        ]
    }
}

// example

axios.request({
    "method": "GET",
    "url": "logistics/pickup/v1/pickup_slots/{"userId":"69223620-f188-4a93-b83c-a96c7a9fce9c", "shipmentId": "757c7778-7acc-48d0-ab7f-31187f8e7288"}"
})

response.data = {
    "status": "success",
    "message": "get checkpoints proceed sucessfully",
    "data": {
        "shipmentId": "757c7778-7acc-48d0-ab7f-31187f8e7288",
        "checkpoints": [
            {
                "id": "6e2666ca-07d0-44dd-8b70-38490a4e2e2b",
                "orderNumber": 3,
                "handler": "DHL",
                "message": "Your package is currently being scheduled to be picked up.",
                "location": null,
                "city": null,
                "countryName": "United States",
                "countryIso3": "USA",
                "state": null,
                "postalCode": null,
                "checkpointTime": "2019-04-24T06:19:35",
                "createdAt": "2020-04-16T10:38:49.000Z",
                "updatedAt": "2020-04-16T10:38:49.000Z",
                "deletedAt": null
            },
            {
                "id": "4fd9ead3-7516-438e-a608-8b88e2d01089",
                "orderNumber": 2,
                "handler": "DHL",
                "message": "Your package is currently being scheduled to be picked up.",
                "location": null,
                "city": null,
                "countryName": "United States",
                "countryIso3": "USA",
                "state": null,
                "postalCode": null,
                "checkpointTime": "2019-04-24T06:19:35",
                "createdAt": "2020-04-16T10:35:49.000Z",
                "updatedAt": "2020-04-16T10:35:49.000Z",
                "deletedAt": null
            },
            {
                "id": "48552a5a-2a94-45d0-a869-49f77bb0052a",
                "orderNumber": 1,
                "handler": "DHL",
                "message": "Your package is currently being scheduled to be picked up.",
                "location": null,
                "city": null,
                "countryName": "United States",
                "countryIso3": "USA",
                "state": null,
                "postalCode": null,
                "checkpointTime": "2019-04-24T06:19:35",
                "createdAt": "2020-04-16T06:54:34.000Z",
                "updatedAt": "2020-04-16T06:54:34.000Z",
                "deletedAt": null
            }
        ]
    }
}

```


___
> get checkpoints of undelivered shipments of a specific user

```gherkin=
// request
axios.request({
    "method": "GET",
    "url": "/logistics/track/v1/checkpoints/{userId}"
});

// return
{
    "status": {"sucess" | "failed"},
    "message": {string},
    "data": [
        {
            "shipmentOrderId": {shipmentId},
            "checkpoints": [
                {
                    "id": {checkpointId},
                    "orderNumber": {int},
                    "handler": {string | null},
                    "message": {string | null},
                    "location": {string | null},
                    "city": {string | null},
                    "countryName": {string | null},
                    "countryIso3": {string | null},
                    "state": {string | null},
                    "postalCode": {string | null},
                    "checkpointTime": {LocalDate},
                    "createdAt": {datetime},
                    "updatedAt": {datetime},
                    "deletedAt": {datetime | null}
                }
            ]
        }
    ]
}

// example

axios.request({
    "method": "GET",
    "url": "logistics/pickup/v1/pickup_slots/{"userId":"69223620-f188-4a93-b83c-a96c7a9fce9c"}"
})

response.data = {
    "status": "success",
    "message": "get all shipments proceed sucessfully",
    "data": [
        {
            "shipmentOrderId": "0cd750fd-5e05-4d34-80bf-56c9b35b5596",
            "checkpoints": [
                {
                    "id": "fe67b9c1-668b-410a-8318-8f656dfd6c1c",
                    "order_number": 7,
                    "handler": "DHL",
                    "message": "Your package is currently being scheduled to be picked up.",
                    "location": null,
                    "city": null,
                    "country_name": "United States",
                    "country_iso3": "USA",
                    "state": null,
                    "postal_code": null,
                    "checkpoint_time": "2019-04-24T06:19:35",
                    "created_at": "2020-04-17T02:44:13.000Z",
                    "updated_at": "2020-04-17T02:44:13.000Z",
                    "deleted_at": null
                },
                {
                    "id": "3c05a5b8-2df4-4c37-aabe-63768a04bb7e",
                    "order_number": 6,
                    "handler": "DHL",
                    "message": "Your package is currently being scheduled to be picked up.",
                    "location": null,
                    "city": null,
                    "country_name": "United States",
                    "country_iso3": "USA",
                    "state": null,
                    "postal_code": null,
                    "checkpoint_time": "2019-04-24T06:19:35",
                    "created_at": "2020-04-17T02:43:05.000Z",
                    "updated_at": "2020-04-17T02:43:05.000Z",
                    "deleted_at": null
                }
            ]
        },
        {
            "shipmentOrderId": "6c93f5ee-252e-4687-b020-73f639e02ab2",
            "checkpoints": [
                {
                    "id": "c83abf0f-da37-455a-8f11-f9fc98a06852",
                    "order_number": 5,
                    "handler": "DHL",
                    "message": "Your package is currently being scheduled to be picked up.",
                    "location": null,
                    "city": null,
                    "country_name": "United States",
                    "country_iso3": "USA",
                    "state": null,
                    "postal_code": null,
                    "checkpoint_time": "2019-04-24T06:19:35",
                    "created_at": "2020-04-17T02:26:31.000Z",
                    "updated_at": "2020-04-17T02:26:31.000Z",
                    "deleted_at": null
                },
                {
                    "id": "b6cf946d-37dd-48da-a286-84c0966f4566",
                    "order_number": 4,
                    "handler": "DHL",
                    "message": "Your package is currently being scheduled to be picked up.",
                    "location": null,
                    "city": null,
                    "country_name": "United States",
                    "country_iso3": "USA",
                    "state": null,
                    "postal_code": null,
                    "checkpoint_time": "2019-04-24T06:19:35",
                    "created_at": "2020-04-17T02:25:44.000Z",
                    "updated_at": "2020-04-17T02:25:44.000Z",
                    "deleted_at": null
                }
            ]
        }
    ]
}

```
