Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Send a package notification email

Receives an Omnitron package webhook body and sends the seller (stock location) the email that matches the event type. Nothing is stored: the request is validated, one email is rendered from payload and sent, and an empty object is returned.

event.type selects the templates — package.created sends the package-created mail, package.status.preparing sends the offer-accepted mail. Any other value is rejected with 400.

The whole payload object is exposed to the templates as data, so send the complete package representation. Two members are required by the server itself: stock_location.email, which becomes the primary recipient, and created_date, which must be a UTC timestamp matching YYYY-MM-DDTHH:MM:SS.fffZ and is shifted forward by PACKAGE_EXTRA_MINUTES before rendering. A missing or unparsable created_date, or a missing stock_location object, fails with 500 rather than 400.

The email is sent synchronously, but a 200 does not guarantee delivery was attempted: the send is skipped silently when the event's body template is switched off through the DISABLED_EMAIL_TEMPLATES dynamic setting, or when the subject or body template is missing or fails to render. If a message is composed and the mail backend rejects it, the request fails with 500 — a retry re-sends the mail. See the Package Notifications section for the settings that control recipients, copy addresses and the deadline offset.

post
/packages/notify/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Body

An Omnitron package webhook body — the event that occurred and the package it concerns.

Responses
200

The request was valid and processed. The body is always an empty object; it carries no information about whether an email was actually sent.

application/json
objectOptional

Always empty.

post/packages/notify/
POST /api/v1/remote/1/packages/notify/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 511

{
  "event": {
    "type": "package.created",
    "uuid": "bdad5d78422b40e7b8c02ac80ed62752"
  },
  "payload": {
    "number": "P-100234",
    "order_number": "202400012345",
    "created_date": "2020-03-23T12:12:12.123Z",
    "stock_location": {
      "name": "Kadıköy Store",
      "email": "store@example.com",
      "address": {
        "city": {
          "name": "İstanbul"
        },
        "township": {
          "name": "Kadıköy"
        }
      }
    },
    "packageitem_set": [
      {
        "id": 5512,
        "order_item": {
          "price_currency": "try",
          "product": {
            "name": "Basic T-Shirt",
            "sku": "TSHIRT-001"
          },
          "extra_field": {
            "price_extra_field": {
              "offer_price": "149.90"
            }
          }
        }
      }
    ]
  }
}
{}

Last updated

Was this helpful?