mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-25 23:44:14 +00:00
945 lines
15 KiB
PHP
945 lines
15 KiB
PHP
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "Shipping Portal to manage parcel",
|
|
"version": "1.0.0",
|
|
"title": "Shipping Portal"
|
|
},
|
|
"host": "{{request()->getHttpHost()}}",
|
|
"basePath": "/api/v1",
|
|
"tags": [
|
|
{
|
|
"name": "Account",
|
|
"description": "Endpoints related to user module, e.g. login, register."
|
|
},
|
|
{
|
|
"name": "Address",
|
|
"description": "Endpoints related to address module, e.g. create, district."
|
|
},
|
|
{
|
|
"name": "Company",
|
|
"description": "Endpoints related to company module."
|
|
},
|
|
{
|
|
"name": "Order",
|
|
"description": "Endpoints related to order module."
|
|
},
|
|
{
|
|
"name": "Flow - Registration",
|
|
"description": "Endpoints related to registration flow."
|
|
}
|
|
],
|
|
"schemes": [
|
|
"http",
|
|
"https"
|
|
],
|
|
"paths": {
|
|
"/order/create": {
|
|
"post": {
|
|
"tags": [
|
|
"Order"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "createOrder",
|
|
"summary": "Create order",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "company_module_id",
|
|
"in": "query",
|
|
"description": "Company Module ID",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "reference",
|
|
"in": "query",
|
|
"description": "Internal reference id",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "reference_contract",
|
|
"in": "query",
|
|
"description": "Unity contract reference id",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/order/confirm/{id}": {
|
|
"put": {
|
|
"tags": [
|
|
"Order"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "confirmOrder",
|
|
"summary": "Admin confirms order",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"description": "Order ID",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/order/{id}/step/completes": {
|
|
"post": {
|
|
"tags": [
|
|
"Order"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "createOrder",
|
|
"summary": "Completes order step",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"description": "Order Id",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "reference",
|
|
"in": "query",
|
|
"description": "Order step reference",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/address/create": {
|
|
"post": {
|
|
"tags": [
|
|
"Address"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "createAddress",
|
|
"summary": "Create address",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "district_id",
|
|
"in": "query",
|
|
"description": "District id",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "street_one",
|
|
"in": "query",
|
|
"description": "Address line 1",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "street_two",
|
|
"in": "query",
|
|
"description": "Address line 2",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "post_code",
|
|
"in": "query",
|
|
"description": "Postcode of the address",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/address/delete/{id}": {
|
|
"delete": {
|
|
"tags": [
|
|
"Address"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "deleteAddress",
|
|
"summary": "Delete address",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"description": "District id",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/address/district/list": {
|
|
"get": {
|
|
"tags": [
|
|
"Address"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "listDistrictAddress",
|
|
"summary": "List districts",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"description": "Filters",
|
|
"required": false,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/address/list": {
|
|
"get": {
|
|
"tags": [
|
|
"Address"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "listAddress",
|
|
"summary": "List addresses of logged in user",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "filter",
|
|
"in": "query",
|
|
"description": "Filters",
|
|
"required": false,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/address/{id}/show": {
|
|
"get": {
|
|
"tags": [
|
|
"Address"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "showAddress",
|
|
"summary": "List addresses of logged in user",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"description": "Address id",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/address/{id}/default": {
|
|
"put": {
|
|
"tags": [
|
|
"Address"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "setDefaultAddress",
|
|
"summary": "Set default address",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"description": "Address id",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "district_id",
|
|
"in": "query",
|
|
"description": "District id",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "street_one",
|
|
"in": "query",
|
|
"description": "Address line 1",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "street_two",
|
|
"in": "query",
|
|
"description": "Address line 2",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "post_code",
|
|
"in": "query",
|
|
"description": "Postcode of the address",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/address/update/{id}": {
|
|
"put": {
|
|
"tags": [
|
|
"Address"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"operationId": "setDefaultAddress",
|
|
"summary": "Set default address",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"description": "Address id",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Invalid input supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/account/authentication/login/check_email": {
|
|
"post": {
|
|
"tags": [
|
|
"Account",
|
|
"Flow - Registration"
|
|
],
|
|
"summary": "Check if email registered",
|
|
"description": "",
|
|
"operationId": "userList",
|
|
"produces": [
|
|
"application/json",
|
|
"application/xml"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "email",
|
|
"in": "query",
|
|
"description": "email",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "successful operation"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/account/registration/registration": {
|
|
"post": {
|
|
"tags": [
|
|
"Account",
|
|
"Flow - Registration"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"summary": "Register user into the system",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "query",
|
|
"description": "The name of user",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "email",
|
|
"in": "query",
|
|
"description": "The email for login",
|
|
"required": true,
|
|
"type": "string",
|
|
"format": "email"
|
|
},
|
|
{
|
|
"name": "password",
|
|
"in": "query",
|
|
"description": "The password for login",
|
|
"required": true,
|
|
"type": "string",
|
|
"format": "password"
|
|
},
|
|
{
|
|
"name": "password_confirmation",
|
|
"in": "query",
|
|
"description": "The confirmation password for login",
|
|
"required": true,
|
|
"type": "string",
|
|
"format": "password"
|
|
},
|
|
{
|
|
"name": "type",
|
|
"in": "query",
|
|
"description": "Company Type - PERSONAL_BUSINESS:0 , COMPANY_BUSINESS:1",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "phone",
|
|
"in": "query",
|
|
"description": "Contact phone number",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "contact_email",
|
|
"in": "query",
|
|
"description": "Contact email",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "company_name",
|
|
"in": "query",
|
|
"description": "The company name - if not defined , name of user will save as the company name",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "business_type",
|
|
"in": "query",
|
|
"description": "Business Type - FREIGHT_FORWARDER:1, IMPORTER:2, CURRENCY_VENDOR:3, WAREHOUSE:4",
|
|
"required": false,
|
|
"default": 2,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "wechat_id",
|
|
"in": "query",
|
|
"description": "Contact Wechat id",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "files[0]",
|
|
"in": "query",
|
|
"description": "File need to convert to base64 example : 'data:application/pdf;base64,{Base64}';",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "identification_no",
|
|
"in": "query",
|
|
"description": "Personal identification no or company registration no",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid username/password supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/account/authentication/login/attempt": {
|
|
"post": {
|
|
"tags": [
|
|
"Account"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"summary": "Logs user into the system",
|
|
"operationId": "aaa",
|
|
"description": "",
|
|
"parameters": [
|
|
{
|
|
"name": "email",
|
|
"in": "query",
|
|
"description": "The user name for login",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "password",
|
|
"in": "query",
|
|
"description": "The password for login in clear text",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"headers": {
|
|
"X-Expires-After": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "date in UTC when token expires"
|
|
},
|
|
"X-Rate-Limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "calls per hour allowed by the user"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid username/password supplied"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/account/authentication/logout": {
|
|
"get": {
|
|
"tags": [
|
|
"Account"
|
|
],
|
|
"summary": "Logs out current logged in user session",
|
|
"description": "",
|
|
"operationId": "logoutUser",
|
|
"produces": [
|
|
"application/json",
|
|
"application/xml"
|
|
],
|
|
"parameters": [],
|
|
"responses": {
|
|
"default": {
|
|
"description": "successful operation"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/account/user/list": {
|
|
"get": {
|
|
"tags": [
|
|
"Account"
|
|
],
|
|
"summary": "Logs out current logged in user session",
|
|
"description": "",
|
|
"operationId": "userList",
|
|
"produces": [
|
|
"application/json",
|
|
"application/xml"
|
|
],
|
|
"parameters": [],
|
|
"responses": {
|
|
"default": {
|
|
"description": "successful operation"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/company/list": {
|
|
"get": {
|
|
"tags": [
|
|
"Company"
|
|
],
|
|
"summary": "List of Companies",
|
|
"description": "example filters={\"WithCompanyModuleType\":4,\"order_by\":{\"column\":\"id\",\"DESC\":true}} | to get list of company with company_module.Type(business type) = 4(Warehouse)",
|
|
"operationId": "companyList",
|
|
"produces": [
|
|
"application/json",
|
|
"application/xml"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "filters",
|
|
"in": "query",
|
|
"description": "Eloquent Filter",
|
|
"required": false,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "successful operation"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/company/create": {
|
|
"post": {
|
|
"tags": [
|
|
"Company"
|
|
],
|
|
"summary": "Create company",
|
|
"description": "",
|
|
"operationId": "companyCreate",
|
|
"produces": [
|
|
"application/json",
|
|
"application/xml"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "type",
|
|
"in": "query",
|
|
"description": "Company Type - PERSONAL_BUSINESS:0 , COMPANY_BUSINESS:1",
|
|
"required": true,
|
|
"type": "integer",
|
|
"enum": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"name": "business_type",
|
|
"in": "query",
|
|
"description": "Business Type - FREIGHT_FORWARDER:1, IMPORTER:2, CURRENCY_VENDOR:3, WAREHOUSE:4",
|
|
"required": true,
|
|
"type": "integer",
|
|
"enum": [
|
|
1,
|
|
2,
|
|
3,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"name": "name",
|
|
"in": "query",
|
|
"description": "Fill in name if type = 0",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"in": "query",
|
|
"description": "Fill in name if type = 0",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "company_name",
|
|
"in": "query",
|
|
"description": "Fill in company_name if type = 1",
|
|
"required": false,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "successful operation"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"Authorization": {
|
|
"type": "apiKey",
|
|
"name": "api_key",
|
|
"in": "header"
|
|
},
|
|
"petstore_auth": {
|
|
"type": "oauth2",
|
|
"authorizationUrl": "https://petstore.swagger.io/oauth/authorize",
|
|
"flow": "implicit",
|
|
"scopes": {
|
|
"read:pets": "read your pets",
|
|
"write:pets": "modify pets in your account"
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"ApiResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"payload": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|