MyGate

Entry Approval Request

Delivery EAR APIs are the most important set of APIs which are necessary to trigger and fulfill mygate Express Entry flow. Every incoming request to mygate Platform is labelled as an 'EAR' - Entry Approval Request and all status transitions for the respective EAR are notified to the partner by registered callbacks.

Ecom Express Flow Diagram

Base URLs

For cab type

For other types

API Endpoints & Summary

TypeEndpointDescription
POST/approvalrequest/createTrigger delivery or cab EAR.
GET/approvalrequest/statusFetch delivery or cab EAR status.
POST/approvalrequest/cancelCancel delivery or cab EAR.

'x-api-key' is visible on Express Entry Dashboard.

Create EAR

Sample cURL

curl --location --request POST 'https://ecom.kappa.mgmaglev.xyz/delivery/devops-intg/approvalrequest/create' \
--header 'Content-Type: application/json' \
--header 'x-api-key: XxXxXx' \
--data-raw '{
"delivery_requests": [
{
"transport_details": {
"riders": [
{
"pic": "String",
"name": "String",
"mobile": "String",
"is_verified": "Boolean"
}
],
"vehicle_number": "String",
"arrive_by" : "Long",
},
"deliveries": [
{
"delivery_type": "Enum",
"delivery_id": "String",
"source_company": "String",
"customer": {
"address": "String",
"name": "String",
"mobile": "String",
"location": {
"latitude": "String",
"longitude": "String"
}
}
}
],
"callback_url": "String"
}
]
}'

Request Headers

NameValueMandatoryDescription
Content-Typeapplication/jsonYesData transfer format.
x-api-keyXxXxXxYesPartner access API key.

Request Attributes

NameTypeMandatoryDescription
delivery_requestsArrayYesDelivery requests array which contains EARs and currently supports only one element.
callback_urlStringNoURL shared by partner to receive and consume registered callback events.
transport_detailsObjectYesObject which contains partner executive details.
ridersArrayYesArray which contains details for a particular partner executive and currently supports
only one element.
is_verifiedBooleanNoDenotes whether the executive has been verified by the partner or not.
picStringNoPicture of the executive. Character length should not exceed more than 255.
name (rider)StringYesName of the executive.
mobile (rider)StringYesMobile number of the executive. This will be utilized to enter a mygate community.
vehicle_numberStringNoVehicle number of the executive.
deliveriesArrayYesDeliveries array contains the details of the partner and user. Currently supports only one element.
delivery_typeEnumYesDelivery type can either be a drop or a pick up.
delivery_idStringYesUnique identifier for each EAR as shared by partner.
source_companyStringYesName of the partner triggering EAR.
customerObjectYesObject containing details of the user by whom the order has been placed.
addressStringYesAddress of the user.
name (customer)StringYesName of the user.
mobile (customer)StringYesMobile number of the user.
locationObjectYesLocation of the customer's address.
latitudeStringYesLatitude as part of location object.
longitudeStringYesLongitude as part of location object.

Response

{
"success_count": "Integer",
"failure_count": "Integer",
"delivery_status_list": [
{
"es": "Integer",
"message": "String",
"delivery_id": "String",
"request_id": "String",
"status": "Enum",
"status_code": "Integer",
"time": "Long"
}
]
}

Response Attributes

NameTypeDescription
success_countIntegerDenotes success of EAR trigger process.
failure_countIntegerDenotes failure of EAR trigger process.
delivery_status_listArrayContains list of details for the triggered EAR.
esIntegerDenotes error status.
messageStringSuccess or failure message.
delivery_idStringDelivery identifier for EAR as shared by partner.
request_idStringUnique identifier for each EAR generated by mygate.
statusEnumCurrent status of EAR.
status_codeIntegerHTTP status code.
timeLongCurrent EPOCH time.

Possible Combinations of Error State, Message and Status Code

esmessage
1Resource access denied.
delivery_status_list.esdelivery_status_list.messagedelivery_status_list.statusdelivery_status_list.status_code
0Request Successfully ReceivedRequest successfully received20

Fetch EAR Status

Sample cURL

curl --location --request GET 'https://ecom.kappa.mgmaglev.xyz/delivery/devops-intg/approvalrequest/status?request_id=XxXxXx' \
--header 'x-api-key: XxXxXx'

Request Headers

NameValueMandatoryDescription
x-api-keyXxXxXxYesPartner access API key.

Query Parameters

NameTypeMandatoryDescription
request_idStringYesUnique identifier for each EAR generated by mygate.

Response

{
"es": "Integer",
"message": "String",
"delivery_id": "String",
"request_id": "String",
"status": "Enum",
"status_code": "Integer",
"time": "Long",
"passcode": "Integer"
}

Response Attributes

NameTypeDescription
esIntegerDenotes error status.
messageStringSuccess or failure message.
delivery_idStringDelivery identifier for EAR as shared by partner.
request_idStringUnique identifier for each EAR generated by mygate.
statusEnumCurrent status of EAR.
status_codeIntegerHTTP status code.
timeLongCurrent EPOCH time.
passcodeIntegerUnique 6 digit code generated by mygate. Partner executive can use this to gain entry into the mygate community.

Possible Combinations of Error State, Message and Status Code

esmessagestatus_code
1Resource access denied.
1No Request found for the given id
0Status Fetched SuccessfullyCode from Entry Approval Status table

Cancel EAR

An Early Approval Request can only be cancelled till the delivery executive checks into the society.

Sample cURL

curl --location --request POST 'https://ecom.kappa.mgmaglev.xyz/delivery/devops-intg/approvalrequest/cancel' \
--header 'Content-Type: application/json' \
--header 'x-api-key: XxXxXx' \
--data-raw '{
"request_id": "String"
}'

Request Headers

NameValueMandatoryDescription
Content-Typeapplication/jsonYesData transfer format.
x-api-keyXxXxXxYesPartner access API key.

Request Attributes

NameTypeMandatoryDescription
request_idStringYesUnique identifier for each EAR generated by mygate.

Response

{
"es": "Integer",
"message": "String",
"delivery_id": "String",
"request_id": "String",
"status": "Enum",
"status_code": "Integer",
"time": "Long"
}

Response Attributes

NameTypeDescription
esIntegerDenotes error status.
messageStringSuccess or failure message.
delivery_idStringDelivery identifier for EAR as shared by partner.
request_idStringUnique identifier for each EAR generated by mygate.
statusEnumCurrent status of EAR.
status_codeIntegerHTTP status code.
timeLongCurrent EPOCH time.

Possible Combinations of Error State, Message and Status Code

esmessagestatus_code
1Resource access denied.
1Invalid request id.
1No Request found for the given id
0Entry Approval Request Cancelled SuccessfullyCode from Entry Approval Status table
0Entry Approval Request Cannot be cancelled.Code from Entry Approval Status table

Create EAR (for cab type)

Sample cURL

curl --location 'https://ecom.kappa.mgmaglev.xyz/cab/devops-intg/approvalrequest/create' \
--header 'Content-Type: application/json' \
--header 'x-api-key: XxXxXx' \
--data '{
"cab_approval_requests": [
{
"ride_id": "String",
"source_company": "String",
"callback_url": "String",
"num_passengers": "Integer",
"ride_type": "String",
"eta": "Long",
"driver": {
"name": "String",
"mobile": "String",
"vehicle_number": "String",
"pic": "String",
"vehicle_type": "String",
"is_verified": "Boolean"
},
"customer": {
"name": "String",
"mobile": "String",
"address": "String",
"location": {
"latitude": "String",
"longitude": "String"
}
}
}
]
}'

Request Headers

NameValueMandatoryDescription
Content-Typeapplication/jsonYesData transfer format.
x-api-keyXxXxXxYesPartner access API key.

Request Attributes

NameTypeMandatoryDescription
cab_approval_requestsArrayYesRequests array which contains cab EARs and currently supports only one element.
ride_idStringYesUnique identifier for each cab EAR as shared by partner.
source_companyStringYesName of the partner triggering cab EAR.
callback_urlStringNoURL shared by partner to receive and consume registered callback events.
num_passengersIntegerNoDenotes the number of passengers taking the given ride.
ride_typeStringNoRide type can either be a DROP or a PICKUP.
etaLongNoDenotes the start time of the cab EAR.
driverObjectYesCab driver details.
name (driver)StringYesName of the cab driver.
mobile (rider)StringYesMobile number of the cab driver. This will be utilized to enter a mygate community.
vehicle_numberStringYesVehicle number of the cab driver.
picStringNoPicture of the cab driver. Character length should not exceed more than 255.
vehicle_typeStringNoDenotes whether the cab is 2W, 3W or 4W.
is_verifiedBooleanNoDenotes whether the cab driver has been verified by the partner or not.
customerObjectYesObject containing details of the user by whom the order has been placed.
name (customer)StringYesName of the user.
mobile (customer)StringYesMobile number of the user.
addressStringYesAddress of the user.
locationObjectYesLocation of the customer's address.
latitudeStringYesLatitude as part of location object.
longitudeStringYesLongitude as part of location object.

Response

{
"success_count": "Integer",
"failure_count": "Integer",
"cab_approval_status_list": [
{
"es": "Integer",
"message": "String",
"ride_id": "String",
"request_id": "String",
"status": "Enum",
"status_code": "Integer",
"time": "Long"
}
]
}

Response Attributes

NameTypeDescription
success_countIntegerDenotes success of cab EAR trigger process.
failure_countIntegerDenotes failure of cab EAR trigger process.
cab_approval_status_listArrayContains list of details for the triggered cab EAR.
esIntegerDenotes error status.
messageStringSuccess or failure message.
ride_idStringUnique identifier for cab EAR as shared by partner.
request_idStringUnique identifier for each cab EAR generated by mygate.
statusEnumCurrent status of EAR.
status_codeIntegerHTTP status code.
timeLongCurrent EPOCH time.

Possible Combinations of Error State, Message and Status Code

esmessage
1Resource access denied.
cab_approval_status_list.escab_approval_status_list.messagecab_approval_status_list.statuscab_approval_status_list.status_code
0Request Successfully ReceivedRequest successfully received20
1Missing/Invalid parameters in requestRequest is Invalid. Please check message for details40

Fetch EAR Status (for cab type)

Sample cURL

curl --location --request GET 'https://ecom.kappa.mgmaglev.xyz/cab/devops-intg/approvalrequest/status?request_id=XxXxXx' \
--header 'x-api-key: XxXxXx'

Request Headers

NameValueMandatoryDescription
x-api-keyXxXxXxYesPartner access API key.

Query Parameters

NameTypeMandatoryDescription
request_idStringYesUnique identifier for each cab EAR generated by mygate.

Response

{
"es": "Integer",
"message": "String",
"ride_id": "String",
"request_id": "String",
"status": "Enum",
"status_code": "Integer",
"time": "Long"
}

Response Attributes

NameTypeDescription
esIntegerDenotes error status.
messageStringSuccess or failure message.
ride_idStringUnique identifier for cab EAR as shared by partner.
request_idStringUnique identifier for each cab EAR generated by mygate.
statusEnumCurrent status of EAR.
status_codeIntegerHTTP status code.
timeLongCurrent EPOCH time.

Possible Combinations of Error State, Message and Status Code

esmessagestatus_code
1No Request found for the given id
0Status Fetched SuccessfullyCode from Entry Approval Status table

Cancel EAR (for cab type)

A Cab Early Approval Request can only be cancelled till the driver checks into the society.

Sample cURL

curl --location --request POST 'https://ecom.kappa.mgmaglev.xyz/cab/devops-intg/approvalrequest/cancel' \
--header 'Content-Type: application/json' \
--header 'x-api-key: XxXxXx' \
--data-raw '{
"request_id": "String"
}'

Request Headers

NameValueMandatoryDescription
Content-Typeapplication/jsonYesData transfer format.
x-api-keyXxXxXxYesPartner access API key.

Request Attributes

NameTypeMandatoryDescription
request_idStringYesUnique identifier for each cab EAR generated by mygate.

Response

{
"es": "Integer",
"message": "String",
"ride_id": "String",
"request_id": "String",
"status": "Enum",
"status_code": "Integer",
"time": "Long"
}

Response Attributes

NameTypeDescription
esIntegerDenotes error status.
messageStringSuccess or failure message.
ride_idStringUnique identifier for cab EAR as shared by partner.
request_idStringUnique identifier for each cab EAR generated by mygate.
statusEnumCurrent status of EAR.
status_codeIntegerHTTP status code.
timeLongCurrent EPOCH time.

Possible Combinations of Error State, Message and Status Code

esmessagestatus_code
1No Request found for the given id
0Entry Approval Request Cancelled SuccessfullyCode from Entry Approval Status table
0Entry Approval Request Cannot be cancelled.Code from Entry Approval Status table

Entry Approval Status

CodeStatus Message
20Request successfully received
42Duplicate request received
21Entry approval validation process started
50There was a problem with processing the request. Please check the request body
22Address matched to a user
23We were not able to find a matching user record in our system
24Entry approved by user
25Request cancelled
26Entry request denied by user
27Delivery executive/cab has checked in
28Delivery executive/cab has checked out
51Internal error encountered. Please try the request again
41Given ETA is already elapsed
29Request completed successfully
40Request is Invalid. Please check message for details
52Request expired
43This feature is disabled
31Entry asked to deliver at gate by user
32Parcel accepted by Security
33Parcel collected by User
34Parcel Declined by security
34Parcel Declined by delivery executive
35Temporary Disabled
36The flat has opted out
Suggestions, contact, support and error reporting: [email protected]