import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.notification.retrieve("notif_123")
.then(({ notification }) => {
console.log(notification)
}){
"notification": {
"id": "<string>",
"to": "<string>",
"channel": "email",
"template": "<string>",
"provider_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"data": {},
"trigger_type": "order.created",
"resource_id": "<string>",
"resource_type": "order",
"receiver_id": "<string>",
"original_notification_id": "<string>",
"external_id": "<string>"
}
}Retrieve a notification by its ID. You can expand the notification’s relations or select the fields that should be returned.
import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.notification.retrieve("notif_123")
.then(({ notification }) => {
console.log(notification)
}){
"notification": {
"id": "<string>",
"to": "<string>",
"channel": "email",
"template": "<string>",
"provider_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"data": {},
"trigger_type": "order.created",
"resource_id": "<string>",
"resource_type": "order",
"receiver_id": "<string>",
"original_notification_id": "<string>",
"external_id": "<string>"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The notification's ID.
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
OK
The notification's details.
The notification's details.
Show child attributes
The notification's ID.
Where to send the notification to. For example, if channel is email, this can be an email number.
Through which channel is the notification sent through.
"email"
The ID of the template in a third-party service used as the notification's shape.
The ID of the provider used to send the notification.
The date the notification was created.
Data payload to send with the notification.
What triggered this notification.
"order.created"
The ID of the associated resource. For example, if the notification was triggered because an order was created, this would be the ID of the order.
The type of the resource that triggered the notification.
"order"
The ID of the user or customer that's receiving this notification.
The ID of the original notification, if this notification is resent.
The ID of the notification in an external or third-party system.