Miare
Miare webhooks 2.0.0

Public HTTP POST callbacks for trip lifecycle, course additions, support issues, area changes and batch financial results. Configure your receiver URL with the Miare technical team. See the webhook integration guide for authentication, delivery and recovery.

Trip/course/issue/area events include X-Miare-API-Version: 2. Authorization normally uses Token ; explicitly configured trip callbacks can omit it. Issue and area callbacks require it. Financial callbacks require Authorization and omit the version header.

Go-service callbacks reload the current snapshot before delivery and retry HTTP 500 responses up to five times, five seconds apart. Financial callbacks preserve the original payload and use a separate configurable retry policy for any non-2XX response or network failure. Both can be duplicated or arrive out of order.

course_added contains the whole trip; course_added__course contains one course. Delegated trip issue callbacks contain a restricted issue projection, while issue_* callbacks contain the full webhook issue snapshot. issue_updated is not emitted. The older guide also lists returning and canceled_by_delay as event names; the current Go event mapper does not emit them. They remain valid trip states, so reconcile state using List Trips rather than waiting for these callbacks.

Account enablement controls advanced return, arrival/departure, delegated issue and financial features. All monetary values are Tomans (IRT). Example identifiers and receiver addresses are illustrative.

  • #Trip
  • #Course
  • #Issue
  • #Area
  • #Financial

Servers

  • https://partner.example.invalid/httpscustomerWebhook

    Illustrative receiver only. The actual host and path come from the client’s configured webhook URL.

Operations

  • Service sends

    HTTP POST to the callback URL configured for the delivery client. The example receiver host is illustrative.

    Operation IDsendTripWebhooks

    Available only on servers:

    object
    • #Trip

    Accepts one of the following messages:

    • #0added

      A trip was created.

      Message IDadded

      A trip was created.

      object
      object
      • #Trip

      Examples

      • #1 Example - added
        {
          "event": "added",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": null,
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": null,
            "picked_up_at": null,
            "delivery_cost": null,
            "arrived_at": null,
            "departed_at": null,
            "state": "assign_queue",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #2 Example - configured-tokenless-trip-callback
        {
          "event": "added",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": null,
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": null,
            "picked_up_at": null,
            "delivery_cost": null,
            "arrived_at": null,
            "departed_at": null,
            "state": "assign_queue",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - added
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
      • #2 Example - configured-tokenless-trip-callback
        {
          "X-Miare-API-Version": "2"
        }
        
    • #1assigned

      An assignment was made, confirmed as seen, or revoked.

      Message IDassigned

      An assignment was made, confirmed as seen, or revoked. Delivery may wait for courier visibility; an unseen revocation can be suppressed. Reconcile the supplied trip snapshot.

      object
      object
      • #Trip

      Examples

      • #1 Example - assigned
        {
          "event": "assigned",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.735,
                "longitude": 51.415
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": null,
            "delivery_cost": null,
            "arrived_at": null,
            "departed_at": null,
            "state": "pickup",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #2 Example - assignment-revoked
        {
          "event": "assigned",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": null,
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": null,
            "picked_up_at": null,
            "delivery_cost": null,
            "arrived_at": null,
            "departed_at": null,
            "state": "assign_queue",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - assigned
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
      • #2 Example - assignment-revoked
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #2arrived

      The courier arrived at pickup.

      Message IDarrived

      The courier arrived at pickup. Emitted only when arrival/departure notifications are enabled for the client.

      object
      object
      • #Trip

      Examples

      • #1 Example - arrived
        {
          "event": "arrived",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.735,
                "longitude": 51.415
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": null,
            "delivery_cost": null,
            "arrived_at": "2026-11-29T10:00:00Z",
            "departed_at": null,
            "state": "receiving",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - arrived
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #3picked_up

      The pickup was accepted.

      Message IDpicked_up

      The pickup was accepted. The snapshot may be departing or dropoff depending on client configuration.

      object
      object
      • #Trip

      Examples

      • #1 Example - picked_up
        {
          "event": "picked_up",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.735,
                "longitude": 51.415
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": "2026-11-29T10:00:00Z",
            "delivery_cost": null,
            "arrived_at": "2026-11-29T10:00:00Z",
            "departed_at": null,
            "state": "departing",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - picked_up
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #4departed

      The courier departed pickup.

      Message IDdeparted

      The courier departed pickup. Emitted only when arrival/departure notifications are enabled for the client.

      object
      object
      • #Trip

      Examples

      • #1 Example - departed
        {
          "event": "departed",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.735,
                "longitude": 51.415
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": "2026-11-29T10:00:00Z",
            "delivery_cost": null,
            "arrived_at": "2026-11-29T10:00:00Z",
            "departed_at": "2026-11-29T10:00:00Z",
            "state": "dropoff",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - departed
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #5course_dropped_off

      A course was completed.

      Message IDcourse_dropped_off

      A course was completed. This payload contains the full trip, not a top-level course object. For configured clients, completion of the final course can emit delivered instead.

      object
      object
      • #Trip

      Examples

      • #1 Example - course_dropped_off
        {
          "event": "course_dropped_off",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.735,
                "longitude": 51.415
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": "2026-11-29T10:00:00Z",
            "delivery_cost": null,
            "arrived_at": "2026-11-29T10:00:00Z",
            "departed_at": "2026-11-29T10:00:00Z",
            "state": "dropoff",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - course_dropped_off
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #6course_added

      A course was added.

      Message IDcourse_added

      A course was added. A full-trip callback accompanies the per-course course_added__course callbacks.

      object
      object
      • #Trip

      Examples

      • #1 Example - course_added
        {
          "event": "course_added",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.735,
                "longitude": 51.415
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": "2026-11-29T10:00:00Z",
            "delivery_cost": null,
            "arrived_at": "2026-11-29T10:00:00Z",
            "departed_at": "2026-11-29T10:00:00Z",
            "state": "dropoff",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - course_added
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #7course_deleted

      A course was removed.

      Message IDcourse_deleted

      A course was removed. This callback contains the updated full trip; no course_deleted__course callback is emitted.

      object
      object
      • #Trip

      Examples

      • #1 Example - course_deleted
        {
          "event": "course_deleted",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.735,
                "longitude": 51.415
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": "2026-11-29T10:00:00Z",
            "delivery_cost": null,
            "arrived_at": "2026-11-29T10:00:00Z",
            "departed_at": "2026-11-29T10:00:00Z",
            "state": "dropoff",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - course_deleted
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #8delivered

      The trip completed, or a configured final-course completion produced a delivered snapshot.

      Message IDdelivered

      The trip completed, or a configured final-course completion produced a delivered snapshot. Event-driven and current-state delivery can overlap.

      object
      object
      • #Trip

      Examples

      • #1 Example - delivered
        {
          "event": "delivered",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": "2026-11-29T10:00:00Z",
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.766428,
                "longitude": 51.395183
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": "2026-11-29T10:00:00Z",
            "delivery_cost": 12000,
            "arrived_at": "2026-11-29T10:00:00Z",
            "departed_at": "2026-11-29T10:00:00Z",
            "state": "delivered",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - delivered
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #9canceled_by_client

      The client canceled the trip.

      Message IDcanceled_by_client

      The client canceled the trip. The current state may also be canceled_by_delay for configured clients.

      object
      object
      • #Trip

      Examples

      • #1 Example - canceled_by_client
        {
          "event": "canceled_by_client",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": null,
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": null,
            "picked_up_at": null,
            "delivery_cost": null,
            "arrived_at": null,
            "departed_at": null,
            "state": "canceled_by_client",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - canceled_by_client
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #10canceled_by_miare

      Miare canceled/deleted the trip.

      Message IDcanceled_by_miare

      Miare canceled/deleted the trip.

      object
      object
      • #Trip

      Examples

      • #1 Example - canceled_by_miare
        {
          "event": "canceled_by_miare",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": null,
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": null,
            "picked_up_at": null,
            "delivery_cost": null,
            "arrived_at": null,
            "departed_at": null,
            "state": "canceled_by_miare",
            "boost": {
              "level": 0,
              "amount": 0
            }
          }
        }
        
      • #1 Example - canceled_by_miare
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #11trip_issue_reported

      A delegated issue was reported for this trip.

      Message IDtrip_issue_reported

      A delegated issue was reported for this trip. Includes the affected issue projection and available actions. The event does not imply a particular trip state.

      object
      object
      • #Trip

      Examples

      • #1 Example - trip_issue_reported
        {
          "event": "trip_issue_reported",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.735,
                "longitude": 51.415
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": "2026-11-29T10:00:00Z",
            "delivery_cost": null,
            "arrived_at": "2026-11-29T10:00:00Z",
            "departed_at": "2026-11-29T10:00:00Z",
            "state": "dropoff",
            "boost": {
              "level": 0,
              "amount": 0
            }
          },
          "issue": {
            "id": "33333333-3333-4333-8333-333333333333",
            "problem_id": "44444444-4444-4444-8444-444444444444",
            "reported_at": "2026-11-29T10:00:00Z",
            "description": "Please confirm whether the courier can proceed.",
            "resolution_actions": [
              "cancel_trip",
              "reject_issue"
            ],
            "resolution_deadline": "2026-11-29T10:10:00Z"
          }
        }
        
      • #1 Example - trip_issue_reported
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #12trip_issue_resolved

      A delegated issue was resolved.

      Message IDtrip_issue_resolved

      A delegated issue was resolved. Includes the selected action, resolver role, and resolution text; the full trip snapshot is also included.

      object
      object
      • #Trip

      Examples

      • #1 Example - trip_issue_resolved
        {
          "event": "trip_issue_resolved",
          "trip": {
            "id": "11111111-1111-4111-8111-111111111111",
            "batch_id": "11111111-1111-4111-8111-111111111111",
            "area": {
              "id": "12",
              "name": "Example area"
            },
            "pickup": {
              "name": "Example pickup",
              "phone_number": "02100000000",
              "address": "Example pickup address",
              "image": "",
              "location": {
                "latitude": 35.73,
                "longitude": 51.41
              },
              "deadline": null
            },
            "courses": [
              {
                "id": "22222222-2222-4222-8222-222222222222",
                "trip_id": "11111111-1111-4111-8111-111111111111",
                "bill_number": "DEMO-100",
                "requires_box": false,
                "name": "Example recipient",
                "phone_number": "09000000000",
                "address": "Example drop-off address",
                "location": {
                  "latitude": 35.74,
                  "longitude": 51.42
                },
                "payment": {
                  "price": 0,
                  "payment_type": "cash"
                },
                "manifest_items": [
                  {
                    "name": "Example package",
                    "quantity": 1
                  }
                ],
                "dropped_off_at": null,
                "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
              }
            ],
            "courier": {
              "name": "Example Courier",
              "first_name": "Example",
              "last_name": "Courier",
              "image": "",
              "phone_number": "09000000001",
              "location_updated_at": "2026-11-29T10:00:00Z",
              "location": {
                "latitude": 35.735,
                "longitude": 51.415
              }
            },
            "created_at": "2026-11-29T10:00:00Z",
            "assigned_at": "2026-11-29T10:00:00Z",
            "picked_up_at": "2026-11-29T10:00:00Z",
            "delivery_cost": null,
            "arrived_at": "2026-11-29T10:00:00Z",
            "departed_at": "2026-11-29T10:00:00Z",
            "state": "dropoff",
            "boost": {
              "level": 0,
              "amount": 0
            }
          },
          "issue": {
            "id": "33333333-3333-4333-8333-333333333333",
            "problem_id": "44444444-4444-4444-8444-444444444444",
            "reported_at": "2026-11-29T10:00:00Z",
            "description": "Please confirm whether the courier can proceed.",
            "resolution_actions": [
              "cancel_trip",
              "reject_issue"
            ],
            "resolution_deadline": "2026-11-29T10:10:00Z",
            "resolved_at": "2026-11-29T10:00:00Z",
            "resolution_action": "reject_issue",
            "resolve_description": "Confirmed with the recipient.",
            "resolver_type": "client"
          }
        }
        
      • #1 Example - trip_issue_resolved
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
  • Service sends

    HTTP POST to the callback URL configured for the delivery client. The example receiver host is illustrative.

    Operation IDsendCourseWebhooks

    Available only on servers:

    object
    • #Course

    Accepts the following message:

    course_added__course

    One callback for each newly added course identified by the event.

    Message IDcourse_added__course

    One callback for each newly added course identified by the event. The companion course_added callback carries the full trip. The double underscore is part of the wire event name.

    object
    object
    • #Course

    Examples

    • #1 Example - course_added__course
      {
        "event": "course_added__course",
        "course": {
          "id": "22222222-2222-4222-8222-222222222222",
          "trip_id": "11111111-1111-4111-8111-111111111111",
          "bill_number": "DEMO-100",
          "requires_box": false,
          "name": "Example recipient",
          "phone_number": "09000000000",
          "address": "Example drop-off address",
          "location": {
            "latitude": 35.74,
            "longitude": 51.42
          },
          "payment": {
            "price": 0,
            "payment_type": "cash"
          },
          "manifest_items": [
            {
              "name": "Example package",
              "quantity": 1
            }
          ],
          "dropped_off_at": null,
          "tracking_url": "https://tracking.example.invalid/DEMOHASH01"
        }
      }
      
    • #1 Example - course_added__course
      {
        "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
        "X-Miare-API-Version": "2"
      }
      
  • Service sends

    HTTP POST to the callback URL configured for the delivery client. The example receiver host is illustrative.

    Operation IDsendIssueWebhooks

    Available only on servers:

    object
    • #Issue

    Accepts one of the following messages:

    • #0issue_added

      An issue was reported; contains the full issue snapshot.

      Message IDissue_added

      An issue was reported; contains the full issue snapshot.

      object
      object
      • #Issue

      Examples

      • #1 Example - issue_added
        {
          "event": "issue_added",
          "issue": {
            "picker_type": null,
            "state": "reported",
            "resolve_description": null,
            "id": "33333333-3333-4333-8333-333333333333",
            "trip_id": "11111111-1111-4111-8111-111111111111",
            "problem_id": "44444444-4444-4444-8444-444444444444",
            "resolved_at": null,
            "reported_at": "2026-11-29T10:00:00Z",
            "reporter_type": "miare",
            "resolver_type": null,
            "picked_at": null,
            "messages": []
          }
        }
        
      • #1 Example - issue_added
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #1issue_picked

      An issue was picked for handling; contains the full issue snapshot.

      Message IDissue_picked

      An issue was picked for handling; contains the full issue snapshot.

      object
      object
      • #Issue

      Examples

      • #1 Example - issue_picked
        {
          "event": "issue_picked",
          "issue": {
            "picker_type": "miare",
            "state": "picked",
            "resolve_description": null,
            "id": "33333333-3333-4333-8333-333333333333",
            "trip_id": "11111111-1111-4111-8111-111111111111",
            "problem_id": "44444444-4444-4444-8444-444444444444",
            "resolved_at": null,
            "reported_at": "2026-11-29T10:00:00Z",
            "reporter_type": "miare",
            "resolver_type": null,
            "picked_at": "2026-11-29T10:00:00Z",
            "messages": []
          }
        }
        
      • #1 Example - issue_picked
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #2issue_resolved

      An issue was resolved; contains the full issue snapshot.

      Message IDissue_resolved

      An issue was resolved; contains the full issue snapshot. Delegated issues can also produce trip_issue_resolved.

      object
      object
      • #Issue

      Examples

      • #1 Example - issue_resolved
        {
          "event": "issue_resolved",
          "issue": {
            "picker_type": "miare",
            "state": "resolved",
            "resolve_description": "Resolved by support.",
            "id": "33333333-3333-4333-8333-333333333333",
            "trip_id": "11111111-1111-4111-8111-111111111111",
            "problem_id": "44444444-4444-4444-8444-444444444444",
            "resolved_at": "2026-11-29T10:00:00Z",
            "reported_at": "2026-11-29T10:00:00Z",
            "reporter_type": "miare",
            "resolver_type": "miare",
            "picked_at": "2026-11-29T10:00:00Z",
            "messages": []
          }
        }
        
      • #2 Example - resolved-delegated-issue
        {
          "event": "issue_resolved",
          "issue": {
            "picker_type": "miare",
            "state": "resolved",
            "resolve_description": "Resolved by support.",
            "id": "33333333-3333-4333-8333-333333333333",
            "trip_id": "11111111-1111-4111-8111-111111111111",
            "problem_id": "44444444-4444-4444-8444-444444444444",
            "resolved_at": "2026-11-29T10:00:00Z",
            "reported_at": "2026-11-29T10:00:00Z",
            "reporter_type": "miare",
            "resolver_type": "miare",
            "picked_at": "2026-11-29T10:00:00Z",
            "messages": [],
            "description": "Please confirm whether the courier can proceed.",
            "resolution_actions": [
              "cancel_trip",
              "reject_issue"
            ],
            "resolution_deadline": "2026-11-29T10:10:00Z",
            "resolution_action": "reject_issue"
          }
        }
        
      • #1 Example - issue_resolved
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
      • #2 Example - resolved-delegated-issue
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
    • #3issue_message_added

      A message was added to an issue.

      Message IDissue_message_added

      A message was added to an issue. The issue.messages array contains the serialized conversation snapshot.

      object
      object
      • #Issue

      Examples

      • #1 Example - issue_message_added
        {
          "event": "issue_message_added",
          "issue": {
            "picker_type": null,
            "state": "reported",
            "resolve_description": null,
            "id": "33333333-3333-4333-8333-333333333333",
            "trip_id": "11111111-1111-4111-8111-111111111111",
            "problem_id": "44444444-4444-4444-8444-444444444444",
            "resolved_at": null,
            "reported_at": "2026-11-29T10:00:00Z",
            "reporter_type": "miare",
            "resolver_type": null,
            "picked_at": null,
            "messages": [
              {
                "id": "55555555-5555-4555-8555-555555555555",
                "type": "text",
                "message": "Example update from support.",
                "image_url": "",
                "created_at": "2026-11-29T10:00:00Z",
                "sender_type": "miare"
              }
            ]
          }
        }
        
      • #1 Example - issue_message_added
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
          "X-Miare-API-Version": "2"
        }
        
  • Service sends

    HTTP POST to the callback URL configured for the delivery client. The example receiver host is illustrative.

    Operation IDsendAreaWebhooks

    Available only on servers:

    object
    • #Area

    Accepts the following message:

    area_radius_changed

    The client’s area radius or heat-level notification.

    Message IDarea_radius_changed

    The client’s area radius or heat-level notification. The area body contains id, name, nested city, radius in meters, and heat_level.

    object
    object
    • #Area

    Examples

    • #1 Example - area_radius_changed
      {
        "event": "area_radius_changed",
        "area": {
          "id": 12,
          "name": "Sample area",
          "city": {
            "id": 1,
            "name": "Tehran"
          },
          "radius": 3000,
          "heat_level": "NORMAL"
        }
      }
      
    • #1 Example - area_radius_changed
      {
        "Authorization": "Token EXAMPLE_CLIENT_TOKEN",
        "X-Miare-API-Version": "2"
      }
      
  • Service sends

    HTTP POST to the callback URL configured for the delivery client. The example receiver host is illustrative.

    Separate accounting delivery policy. No X-Miare-API-Version header. Return 2XX after accepting an event; any other response or network failure is retried. The request timeout is ten seconds; default configurable delays are 30, 120, 300, 900 and 1800 seconds. Retry payloads are preserved. Deduplicate by (batch_id, revision), retain the highest revision and use financials.total_cost without reapplying cumulative changes. Receiving an event does not imply that an invoice PDF is ready.

    Operation IDsendFinancialWebhooks

    Available only on servers:

    object
    • #Financial

    Accepts one of the following messages:

    • #0financial_calculated

      Initial batch accounting completed.

      Message IDfinancial_calculated

      Available for enabled client accounts with a configured webhook. financial_calculated reports initial accounting; eligible deleted trips have zero amounts. financial_adjusted reports a non-zero financial change after a course is marked invalid. Deduplicate by (batch_id, revision), retain the highest revision and use the complete total rather than reapplying cumulative changes. Revisions can arrive out of order, including before revision 0. Any non-2xx response or network failure is retried with a 10-second request timeout. Default retry delays are 30,120,300,900,1800 seconds and are configurable. Retries use the stored payload. Recover latest data using GET https://www.miare.ir/api/accounting/financial-detail/{batch_id}/ with the client token; the response omits event. Invoice PDF readiness is independent.

      allOf
      object

      Financial callbacks omit X-Miare-API-Version. revision is a batch accounting revision, not an API version.

      • #Financial

      Examples

      • #1 Example - financial_calculated
        {
          "event": "financial_calculated",
          "batch_id": "b3951922-4f3e-43dc-a051-a9b765b2cbe7",
          "revision": 0,
          "trip_ids": [
            "4f3d252a-ebbc-4147-b6e8-aba9b64200f3"
          ],
          "course_ids": [
            "0f662083-284e-4729-b34d-2479bd7b558a"
          ],
          "bill_numbers": [
            "DEL-119"
          ],
          "state": "calculated",
          "financials": {
            "total_cost": 30000,
            "details": {
              "base_cost": 28000,
              "cancel_cost": 0,
              "delay_cost": 2000,
              "return_cost": 0
            }
          },
          "changes": []
        }
        
      • #1 Example - financial_calculated
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN"
        }
        
    • #1financial_adjusted

      Batch total changed after a course was marked invalid.

      Message IDfinancial_adjusted

      Available for enabled client accounts with a configured webhook. financial_calculated reports initial accounting; eligible deleted trips have zero amounts. financial_adjusted reports a non-zero financial change after a course is marked invalid. Deduplicate by (batch_id, revision), retain the highest revision and use the complete total rather than reapplying cumulative changes. Revisions can arrive out of order, including before revision 0. Any non-2xx response or network failure is retried with a 10-second request timeout. Default retry delays are 30,120,300,900,1800 seconds and are configurable. Retries use the stored payload. Recover latest data using GET https://www.miare.ir/api/accounting/financial-detail/{batch_id}/ with the client token; the response omits event. Invoice PDF readiness is independent.

      allOf
      object

      Financial callbacks omit X-Miare-API-Version. revision is a batch accounting revision, not an API version.

      • #Financial

      Examples

      • #1 Example - financial_adjusted
        {
          "event": "financial_adjusted",
          "batch_id": "b3951922-4f3e-43dc-a051-a9b765b2cbe7",
          "revision": 1,
          "trip_ids": [
            "4f3d252a-ebbc-4147-b6e8-aba9b64200f3"
          ],
          "course_ids": [
            "0f662083-284e-4729-b34d-2479bd7b558a"
          ],
          "bill_numbers": [
            "DEL-119"
          ],
          "state": "changed",
          "financials": {
            "total_cost": 21000,
            "details": {
              "base_cost": 19000,
              "cancel_cost": 0,
              "delay_cost": 2000,
              "return_cost": 0
            }
          },
          "changes": [
            {
              "type": "course_faked",
              "course_id": "0f662083-284e-4729-b34d-2479bd7b558a",
              "trip_id": "4f3d252a-ebbc-4147-b6e8-aba9b64200f3",
              "bill_number": "DEL-119",
              "previous_total_cost": 30000,
              "change_amount": -9000,
              "current_total_cost": 21000,
              "occurred_at": "2026-11-11T10:30:00+03:30"
            }
          ]
        }
        
      • #1 Example - financial_adjusted
        {
          "Authorization": "Token EXAMPLE_CLIENT_TOKEN"
        }
        

Schemas

  • object
  • object
  • string | null

    Serialized time, for example 2026-11-29T10:00:00Z or 2026-11-29T13:30:00+0330. Unset times are null.

  • object | null
  • object
    Documentation
  • object | null
  • object
  • object | null

    Null before a visible assignment. For completed/canceled trips the serializer substitutes a dummy location; do not use it as a live courier position.

  • object
  • object

    Manifest objects are passed through from the original request; additional fields are retained.

  • object | null
    Documentation
  • object

    Both values are zero when no applicable client boost is present.

  • object
  • object | null

    Full third-party trip snapshot. Optional completion/return fields depend on client configuration. Original course/trip hashes are preserved when orders are batched.

    Documentation
  • object | null

    Full issue snapshot used by issue_* callbacks. Delegation fields are included only for delegated issues. Public reporter/resolver/sender roles are client or miare.

    Documentation
  • object

    Projection attached to trip_issue_reported. This is not the full issue_* callback snapshot.

  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object oneOf

    Available for enabled client accounts with a configured webhook. financial_calculated reports initial accounting; eligible deleted trips have zero amounts. financial_adjusted reports a non-zero financial change after a course is marked invalid. Deduplicate by (batch_id, revision), retain the highest revision and use the complete total rather than reapplying cumulative changes. Revisions can arrive out of order, including before revision 0. Any non-2xx response or network failure is retried with a 10-second request timeout. Default retry delays are 30,120,300,900,1800 seconds and are configurable. Retries use the stored payload. Recover latest data using GET https://www.miare.ir/api/accounting/financial-detail/{batch_id}/ with the client token; the response omits event. Invoice PDF readiness is independent.

  • object

    Financial callbacks omit X-Miare-API-Version. revision is a batch accounting revision, not an API version.

  • allOf
  • allOf