diff --git a/.gitignore b/.gitignore index 8040a17..669108c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ build/ -.idea \ No newline at end of file +.idea + +"https://miare-staging.s3.ir-thr-at1.arvanstorage.com/media/banners/4A2D26WMQS45KX06.png?AWSAccessKeyId=c3b038d4-1a21-47bf-aa38-6283b15fd91c&Signature=%2FyWbWOaXtZNuUeY%2F9GkTt3%2Fph4k%3D&Expires=1660478782 diff --git a/slate/source/Miare - Third Party API.postman_collection.json b/slate/source/Miare - Third Party API.postman_collection.json index a019716..4e3d113 100644 --- a/slate/source/Miare - Third Party API.postman_collection.json +++ b/slate/source/Miare - Third Party API.postman_collection.json @@ -28,7 +28,7 @@ } }, "url": { - "raw": "https://{{staging_prefix}}ws.mia.re/trip-management/third-party-api/v2/trips/", + "raw": "https://{{staging_prefix}}ws.miare.ir/trip-management/third-party-api/v2/trips/", "protocol": "https", "host": [ "{{staging_prefix}}ws", @@ -57,7 +57,7 @@ } ], "url": { - "raw": "https://{{staging_prefix}}ws.mia.re/trip-management/third-party-api/v2/trips/b3951922-4f3e-43dc-a051-a9b765b2cbe7/cancel/", + "raw": "https://{{staging_prefix}}ws.miare.ir/trip-management/third-party-api/v2/trips/b3951922-4f3e-43dc-a051-a9b765b2cbe7/cancel/", "protocol": "https", "host": [ "{{staging_prefix}}ws", @@ -97,7 +97,7 @@ } }, "url": { - "raw": "https://{{staging_prefix}}ws.mia.re/trip-management/third-party-api/v2/trips/c9f7c2e8-2e37-42e2-8982-b0d6fd868653/courses/", + "raw": "https://{{staging_prefix}}ws.miare.ir/trip-management/third-party-api/v2/trips/c9f7c2e8-2e37-42e2-8982-b0d6fd868653/courses/", "protocol": "https", "host": [ "{{staging_prefix}}ws", @@ -128,7 +128,7 @@ } ], "url": { - "raw": "https://{{staging_prefix}}ws.mia.re/trip-management/third-party-api/v2/courses/c9f7c2e8-2e37-42e2-8982-b0d6fd868653/", + "raw": "https://{{staging_prefix}}ws.miare.ir/trip-management/third-party-api/v2/courses/c9f7c2e8-2e37-42e2-8982-b0d6fd868653/", "protocol": "https", "host": [ "{{staging_prefix}}ws", @@ -158,7 +158,7 @@ } ], "url": { - "raw": "https://{{staging_prefix}}ws.mia.re/trip-management/third-party-api/v2/trips/?area_id=2&state=pickup&from_datetime=2020-11-02T14:48:18Z&to_datetime=2021-12-02T14:48:18Z&offset=0&limit=10", + "raw": "https://{{staging_prefix}}ws.miare.ir/trip-management/third-party-api/v2/trips/?area_id=2&state=pickup&from_datetime=2020-11-02T14:48:18Z&to_datetime=2021-12-02T14:48:18Z&offset=0&limit=10", "protocol": "https", "host": [ "{{staging_prefix}}ws", @@ -213,7 +213,7 @@ } ], "url": { - "raw": "https://{{staging_prefix}}ws.mia.re/area/third-party-api/v2/areas", + "raw": "https://{{staging_prefix}}ws.miare.ir/area/third-party-api/v2/areas", "protocol": "https", "host": [ "{{staging_prefix}}ws", @@ -241,7 +241,7 @@ } ], "url": { - "raw": "https://www.{{staging_prefix}}mia.re/api/accounting/estimate/price?source=35.764090,51.331956&destination=35.767832,51.335135", + "raw": "https://www.{{staging_prefix}}miare.ir/api/accounting/estimate/price?source=35.764090,51.331956&destination=35.767832,51.335135", "protocol": "https", "host": [ "www", @@ -284,7 +284,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"event\": \"added\",\n \"trip\": {\n \"area\": {\n \"id\": \"3\",\n \"name\": \"یوسف آباد\"\n },\n \"assigned_at\": null,\n \"courier\": null,\n \"courses\": [{\n \"address\": \"تهران، خیابان استاد معین، پلاک ۱۲\",\n \"bill_number\": \"DEL-119\",\n \"dropped_off_at\": null,\n \"id\": \"0f662083-284e-4729-b34d-2479bd7b558a\",\n \"location\": {\n \"latitude\": 35.737004,\n \"longitude\": 51.413569\n },\n \"manifest_items\": [{\n \"name\": \"پیتزا پپرونی خانواده\",\n \"quantity\": 2\n }],\n \"name\": \"علی علوی\",\n \"payment\": {\n \"payment_type\": \"cash\",\n \"price\": 0\n },\n \"phone_number\": \"09123456789\",\n \"tracking_url\": \"https://www.staging.mia.re/p/trip_watching/#!/0f66208328\",\n \"trip_id\": \"4f3d252a-ebbc-4147-b6e8-aba9b64200f3\"\n }],\n \"created_at\": \"2021-11-10T17:35:14+0330\",\n \"id\": \"4f3d252a-ebbc-4147-b6e8-aba9b64200f3\",\n \"picked_up_at\": null,\n \"pickup\": {\n \"address\": \"تهران، صادقیه، بلوار آیت الله کاشانی\",\n \"deadline\": \"2021-11-10T21:06:00+0330\",\n \"image\": \"https://example.com/restaurants/bm_logo.png\",\n \"location\": {\n \"latitude\": 35.737004,\n \"longitude\": 51.413569\n },\n \"name\": \"رستوران بزرگمهر\",\n \"phone_number\": \"09123456789\"\n },\n \"state\": \"assign_queue\"\n }\n}", + "raw": "{\n \"event\": \"added\",\n \"trip\": {\n \"area\": {\n \"id\": \"3\",\n \"name\": \"یوسف آباد\"\n },\n \"assigned_at\": null,\n \"courier\": null,\n \"courses\": [{\n \"address\": \"تهران، خیابان استاد معین، پلاک ۱۲\",\n \"bill_number\": \"DEL-119\",\n \"dropped_off_at\": null,\n \"id\": \"0f662083-284e-4729-b34d-2479bd7b558a\",\n \"location\": {\n \"latitude\": 35.737004,\n \"longitude\": 51.413569\n },\n \"manifest_items\": [{\n \"name\": \"پیتزا پپرونی خانواده\",\n \"quantity\": 2\n }],\n \"name\": \"علی علوی\",\n \"payment\": {\n \"payment_type\": \"cash\",\n \"price\": 0\n },\n \"phone_number\": \"09123456789\",\n \"tracking_url\": \"https://www.staging.miare.ir/p/trip_watching/#!/0f66208328\",\n \"trip_id\": \"4f3d252a-ebbc-4147-b6e8-aba9b64200f3\"\n }],\n \"created_at\": \"2021-11-10T17:35:14+0330\",\n \"id\": \"4f3d252a-ebbc-4147-b6e8-aba9b64200f3\",\n \"picked_up_at\": null,\n \"pickup\": {\n \"address\": \"تهران، صادقیه، بلوار آیت الله کاشانی\",\n \"deadline\": \"2021-11-10T21:06:00+0330\",\n \"image\": \"https://example.com/restaurants/bm_logo.png\",\n \"location\": {\n \"latitude\": 35.737004,\n \"longitude\": 51.413569\n },\n \"name\": \"رستوران بزرگمهر\",\n \"phone_number\": \"09123456789\"\n },\n \"state\": \"assign_queue\"\n }\n}", "options": { "raw": { "language": "json" @@ -303,4 +303,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/slate/source/index.html.md b/slate/source/index.html.md index 3c7d74b..84d8b6b 100644 --- a/slate/source/index.html.md +++ b/slate/source/index.html.md @@ -2,37 +2,46 @@ title: Miare API language_tabs: # must be one of https://git.io/vQNgJ - - shell - - python + +- shell +- python toc_footers: - - Postman Collection - - Documentation Powered by Slate + +- Postman Collection +- Documentation Powered by Slate search: true code_clipboard: true meta: - - name: description - content: Documentation for the Miare API ---- +- name: description + content: Documentation for the Miare API + +--- # Introduction -This is Miare's Third-Party API, designed to enable registered Miare users to integrate our delivery services into their applications. +This is Miare's Third-Party API, designed to enable registered Miare users to integrate our delivery services into their +applications. This document walks you through the steps required to use Miare's services and endpoints. -If you need any further information about how Miare works or you are still not sure whether or not our services meet your needs, -feel free to check out our website mia.re or contact us at tech@miare.ir. +If you need any further information about how Miare works or you are still not sure whether or not our services meet +your needs, +feel free to check out our website miare.ir or contact us at +tech@miare.ir. # Registration -To use our services, you need to first have an API account. An API account is a specific type of account that + +To use our services, you need to first have an API account. An API account is a specific type of account that can access our Third-Party endpoints and receive our event callbacks. -In order to create an account and discuss the basic terms and financial details of our services, you can reach our sales team at -02191009282 Ext. 3, they will provide us with the required information to create your account. +In order to create an account and discuss the basic terms and financial details of our services, you can reach our sales +team at +02191009282 Ext. 3, they will provide us with the required information to create your +account. After registration, you'll be given a string called **Token**. - # Definitions ### Client + A registered user who can use Miare's delivery service. ### Courier + A biker from our pool of bikers who can deliver packages from sources to destinations. -In Miare, bikers don't pick and choose what packages they deliver. Instead, each order is automatically assigned to one of the available couriers based on their distance from the source and many other parameters. +In Miare, bikers don't pick and choose what packages they deliver. Instead, each order is automatically assigned to one +of the available couriers based on their distance from the source and many other parameters. ### Trip + An order given by one of our clients for one or more packages to be delivered. A trip can have one and only one source but multiple destinations (and multiple packages to be delivered at those destinations). Our clients may also indicate that they wish the courier to return to the source at the end of the trip. -#### Trip states +#### Trip States + Each trip can be in only one the following states at any given time -Name | Description ----- | ----------- -assign_queue | Trip is created but no courier has been assigned to it yet -pickup | Trip is assigned to a courier and the courier is on his way to pickup packages from the source -dropoff | Trip is picked up by the courier and he is on his way to deliver the packages -delivered | All of the packages of the trip are delivered (and if trip was a round trip, courier has returned to the source) -canceled_by_miare | Trip is canceled by our support staff. This only happens with source's aggrement or due to a violation of terms of service -canceled_by_client | Trip is canceled by client (either from the web panel or Third Party API) +| Name | Description | +|--------------------|----------------------------------------------------------------------------------------------------------------------------| +| assign_queue | Trip is created but no courier has been assigned to it yet | +| pickup | Trip is assigned to a courier and the courier is on his way to pickup packages from the source | +| dropoff | Trip is picked up by the courier and he is on his way to deliver the packages | +| delivered | All of the packages of the trip are delivered (and if trip was a round trip, courier has returned to the source) | +| canceled_by_miare | Trip is canceled by our support staff. This only happens with source's aggrement or due to a violation of terms of service | +| canceled_by_client | Trip is canceled by client (either from the web panel or Third Party API) | ### Course -A destination and a package to be delivered at that destination. Each trip can have one or more courses. -As an example, if a **trip** has two **course**s, our courier will drive to the source, pick up two packages, + +A destination and a package to be delivered at that destination. Each trip can have one or more courses. +As an example, if a **trip** has two **course**s, our courier will drive to the source, pick up two packages, and deliver them to two separate customers in two different destinations. ### Area + Part of the city defined by a set of latitude-longitudes forming a polygon that Miare operates in it. If **source** of a trip is inside an area, that trip is considered part of trips of that specific area. ### Shift -A period of time in each day defined by a start and an end time. If deadline of a trip is within a shift, that trip is considered part of trips of that specific shift. + +A period of time in each day defined by a start and an end time. If deadline of a trip is within a shift, that trip is +considered part of trips of that specific shift.