> For the complete documentation index, see [llms.txt](https://user.netmera.com/netmera-developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://user.netmera.com/netmera-developer-guide/api-documentation/recipes/sending-transactional-push.md).

# Sending Transactional Push Notifications to a Single User

This recipe shows how to define a reusable notification once, send it to individual users with values that belong to each user, and check the delivery result of a specific user. A transactional notification is triggered by an action in your own system, such as an order status change, and carries data that is specific to one user.

## When to Use

This recipe fits one-to-one messages that your backend sends right after an event: order confirmation, shipping update, payment reminder, or a verification prompt. The message text is maintained in one definition, and every send only supplies the changing values.

## Prerequisites

* REST API key of the application
* The external ID (`extId`) of the user who receives the message
* Optional: a message category created in the panel under **Settings > Message Categories**

## Step 1: Create the Notification Definition

Create the definition with `createNotificationDefinition`. Use `@{parameterName}` placeholders in `personalizedMessage` for the values that change per user, and keep a readable fallback in `message`.

```bash
curl https://restapi.netmera.com/rest/3.0/createNotificationDefinition \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-netmera-api-key: <API_KEY>' \
  --data '{
  "title": "Order Update",
  "message": "Your order is on its way.",
  "personalizedMessage": "Hello @{name}, your order @{orderNo} is on its way.",
  "platforms": ["IOS", "ANDROID"],
  "inbox": false,
  "click": {
    "deeplink": "myapp://orders"
  }
}'
```

The response contains the identifier of the definition:

```json
{
  "notificationKey": 96
}
```

Note the `notificationKey`. Every send in the next step references it.

**Expected result:** HTTP 200 with a `notificationKey`.

## Step 2: Send the Notification to a User

Call `sendNotification` with the `notificationKey` of the definition, the target user, and the per-user values in `message.params`. The parameter names must match the placeholder names of the definition.

```bash
curl https://restapi.netmera.com/rest/3.0/sendNotification \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-netmera-api-key: <API_KEY>' \
  --data '{
  "notificationKey": "96",
  "message": {
    "params": {
      "name": "John",
      "orderNo": "A-10432"
    }
  },
  "target": {
    "extId": "user_1001"
  }
}'
```

`target` also accepts an array of external IDs or device tokens, with a maximum of 1000 unique values per request. When a value in `params` differs from the one configured in the panel, the value in the request overwrites it.

**Expected result:** HTTP 200. The notification is accepted for delivery.

## Step 3: Check the Delivery Result of the User

Read the result of the send with `getPushResult`, filtered by the `notificationKey` and the `extId` of the user.

```bash
curl 'https://restapi.netmera.com/rest/3.0/getPushResult?notificationKey=96&extId=user_1001' \
  --header 'X-netmera-api-key: <API_KEY>'
```

Each entry in the response `list` carries the `platform`, the `status` (`SUCCESS` or `FAILED`), and, for failures, an `errorCode` and `errorMsg`. When the result is paginated, the response contains a `nextPage` URL; send a request to that URL to fetch the next page. Without `start` and `end`, results of the last 2 weeks are returned.

**Expected result:** One result entry per device of the user, with a status.

## Verification Checklist

* The definition is created once and its `notificationKey` is stored in your system
* `notificationKey` is sent as a string in `sendNotification`
* Names in `message.params` match the `@{...}` placeholders of the definition
* `target` contains the external ID or device token of the recipient
* `getPushResult` returns `SUCCESS` for the expected platform

## Related Pages

For all supported overrides, such as click behavior, rich media and custom parameters, see the Send transactional notification page in the REST API documentation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://user.netmera.com/netmera-developer-guide/api-documentation/recipes/sending-transactional-push.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
