Notifications

Apart from invoking your adapter’s APIs for certain actions, the Amazon Yojaka product raises notifications to your adapter that occur based on some action by a seller. The Amazon Yojaka product ensures that your adapter will only receive notifications that are relevant for your adapter.

All notifications are raised using the AWS Simple Notifications Service. You can find more information about this service here.

Setup

All notifications for your adapter are raised on an AWS SNS topic that is specific to your adapter. You would have received the ARN for the AWS SNS topic of your adapter during the On-boarding step.

With AWS SNS, you have multiple options available on how you process the notifications that you receive. Typical scenarios for processing notifications include:

  • Invoking an AWS Lambda function

  • Inserting the notification message into an AWS SQS queue

  • Invoking a HTTP(S) endpoint

More information about options for handling such system-to-system messaging can be found here.

Messages

Your adapter will receive notifications containing a message as a payload, based on actions triggered by a seller’s connector applications working with the Amazon Yojaka connector APIs. It is expected that your adapter will process these messages and take appropriate actions against the marketplace/fulfilment channel that your adapter works with.

Note

The payload for a notification from the Amazon Yojaka product will be provided in the standard JSON format and will be available as a JSON string in the Message attribute of the SNS notification payload.

The format of the messages that your adapter will receive are documented in this section.

Inventory Update

Your adapter will receive an inventory update notification message from the Amazon Yojaka product whenever the inventory of a particular SKU of a particular seller (merchant) in a particular location is updated. This could occur in one of the following cases: #. Any inventory update received from a seller via an Amazon Yojaka connector application #. Any orders dropped/cancelled on a seller by any other Amazon Yojaka adapter service

{
    // A unique identifier for this inventory update message. Can be used to handle idempotency
    "id": "MARKETPLACE_1.CHANNEL_1.6023685228.0210075566.Y_T_SKUTZU.0",
    // The message type
    "type": "INVENTORY_UPDATE",
    "payload": {
        // Details about the marketplace/fulfilment channel
        "marketplaceAttributes": {
            "marketplaceName": "MARKETPLACE_1",
            "channelName": "CHANNEL_1"
        },
        // The id of the location, as defined in the marketplace, where an inventory update occurred
        "locationId": "0210075566",
        // The id of the merchant, as defined in the marketplace, whose inventory was updated
        "merchantId": "6023685228",
        // The SKU for which inventory was updated
        "merchantSku": "Y_T_SKUTZU",
        // A unique sequence number to handle out-of-order notifications
        "sequenceNumber": 0,
        // The new inventory quantity as an absolute value
        "absoluteQuantity": 3,
        // The new inventory quantity as a value relative to the previous inventory update
        "relativeQuantity": -3
    }
}

Order Fulfilment

Your adapter will receive order fulfilment notification messages whenever a seller performs certain actions using an Amazon Yojaka connector application to fulfil an order.

Order Accepted

This notification is sent from the Amazon Yojaka product when an order that your adapter has dropped using the Inbound APIs has been accepted by the Amazon Yojaka product, and inventory has been bound for that order.

{
    // A unique identifier for this order update message. Can be used to handle idempotency
    "id": "MARKETPLACE_1.CHANNEL_1.AutomationTestMerchant.0160173235.20vcEgy8UA.ACCEPTED",
    // The message type
    "type": "ORDER_UPDATE",
    "payload": {
        // The id of the order, as defined in the marketplace, which has an update
        "orderId": "VZjQhBc3q0",
        // The id of the location, as defined in the marketplace, where an order update occurred
        "locationId": "0160173235",
        // The id of the shipment, as defined in the marketplace, which has an update
        "shipmentId": "20vcEgy8UA",
        // The id of the merchant, as defined in the marketplace, whose order has been updated
        "merchantId": "AutomationTestMerchant",
        // Details about the marketplace/fulfilment channel
        "marketplaceAttributes": {
            "marketplaceName": "MARKETPLACE_1",
            "channelName": "CHANNEL_1"
        },
        // The current order status indicating that the order has been ACCEPTED by the Amazon Yojaka product
        "status": "ACCEPTED",
        // The timestamp in UTC seconds since epoch at which time the order the was updated
        "updateTimeStamp": 1588140951228,
        // The line items from the order
        "lineItemsList": [{
            // The id of the line item
            "id": "xw5UQ7GS8o",
            // The merchant SKU
            "merchantSku": "Y_T_SKUqQV",
            // The quantity being fulfilled
            "quantityFulfilled": 1
            // The quantity that has been cancelled
            "quantityCancelled": 0
        }]
    }
}

Order Confirmed

This notification is sent from the Amazon Yojaka product when an order that your adapter has dropped using the Inbound APIs is confirmed by the seller for further processing and fulfilment.

{
    // A unique identifier for this order update message. Can be used to handle idempotency
    "id": "MARKETPLACE_1.CHANNEL_1.AutomationTestMerchant.2107259351.u983gNVRFm.CONFIRMED",
    // The message type
    "type": "ORDER_UPDATE",
    "payload": {
        // The id of the order, as defined in the marketplace, which has an update
        "orderId": "SarAYa2Lkr",
        // The id of the location, as defined in the marketplace, where an order update occurred
        "locationId": "2107259351",
        // The id of the shipment, as defined in the marketplace, which has an update
        "shipmentId": "u983gNVRFm",
        // The id of the merchant, as defined in the marketplace, whose order has been updated
        "merchantId": "AutomationTestMerchant",
        // Details about the marketplace/fulfilment channel
        "marketplaceAttributes": {
            "marketplaceName":"MARKETPLACE_1",
            "channelName": "CHANNEL_1"
        },
        // The current order status indicating that the order has been CONFIRMED by the seller for fulfilment
        "status": "CONFIRMED",
        // The timestamp in UTC seconds since epoch at which time the order the was updated
        "updateTimeStamp": 1588142539396,
        // The line items from the order
        "lineItemsList": [{
            // The id of the line item
            "id": "7FLgDPOvPG",
            // The merchant SKU
            "merchantSku": "Y_T_SKUNLM",
            // The quantity being fulfilled
            "quantityFulfilled": 1,
            // The quantity that has been cancelled
            "quantityCancelled": 0
        }]
    }
}

Seller Rejection

This notification is sent from the Amazon Yojaka product when an order that your adapter has dropped using the Inbound APIs is rejected by the seller and will not be fulfilled.

{
    // A unique identifier for this order update message. Can be used to handle idempotency
    "id": "MARKETPLACE_1.CHANNEL_1.AutomationTestMerchant.7011665563.035VuB1X2t.SELLER_CANCELLATION",
    // The message type
    "type": "ORDER_UPDATE",
    "payload": {
        // The id of the order, as defined in the marketplace, which has an update
        "orderId": "phWKgNr3Pa",
        // The id of the location, as defined in the marketplace, where an order update occurred
        "locationId": "7011665563",
        // The id of the shipment, as defined in the marketplace, which has an update
        "shipmentId": "035VuB1X2t",
        // The id of the merchant, as defined in the marketplace, whose order has been updated
        "merchantId": "AutomationTestMerchant",
        // Details about the marketplace/fulfilment channel
        "marketplaceAttributes": {
            "marketplaceName": "MARKETPLACE_1",
            "channelName": "CHANNEL_1"
        },
        // The current order status indicating that the order has been CANCELLED by the SELLER for fulfilment
        "status": "SELLER_CANCELLATION",
        // The timestamp in UTC seconds since epoch at which time the order the was updated
        "updateTimeStamp": 1588150565968,
        // The line items from the order
        "lineItemsList": [{
            // The id of the line item
            "id": "ihrV8yG1rp",
            // The merchant SKU
            "merchantSku": "Y_T_SKUA3U",
            // The quantity being fulfilled
            "quantityFulfilled": 0,
            // The quantity that has been cancelled
            "quantityCancelled": 1,
            // The reason for the cancellation
            "failureReason": "OUT_OF_STOCK"
        }]
    }
}

Customer Cancellation Acceptance

This notification is sent from the Amazon Yojaka product when an order that your adapter has dropped using the Inbound APIs has been cancelled by your adapter, and the seller acknowledges that the cancellation has been accepted.

{
    // A unique identifier for this order update message. Can be used to handle idempotency
    "id": "MARKETPLACE_1.CHANNEL_1.AutomationTestMerchant.0160173235.LrBM3iqrO0.CUSTOMER_CANCELLATION_ACCEPTED",
    // The message type
    "type": "ORDER_UPDATE",
    "payload": {
        // The id of the order, as defined in the marketplace, which has an update
        "orderId": "ttYUuhUKy3",
        // The id of the location, as defined in the marketplace, where an order update occurred
        "locationId": "0160173235",
        // The id of the shipment, as defined in the marketplace, which has an update
        "shipmentId": "LrBM3iqrO0",
        // The id of the merchant, as defined in the marketplace, whose order has been updated
        "merchantId": "AutomationTestMerchant",
        // Details about the marketplace/fulfilment channel
        "marketplaceAttributes": {
            "marketplaceName":"MARKETPLACE_1",
            "channelName": "CHANNEL_1"
        },
        // The current order status indicating that the CUSTOMER CANCELLATION of the order has been ACCEPTED by the seller
        "status": "CUSTOMER_CANCELLATION_ACCEPTED",
        // The timestamp in UTC seconds since epoch at which time the order the was updated
        "updateTimeStamp": 1588141228273,
        // The line items from the order
        "lineItemsList": [{
            // The id of the line item
            "id": "W9xQLT7P8K",
            // The merchant SKU
            "merchantSku": "Y_T_SKUqQV",
            // The quantity being fulfilled
            "quantityFulfilled": 0,
            // The quantity that has been cancelled
            "quantityCancelled": 1,
            // The reason for the cancellation
            "failureReason": "CUSTOMER_CANCELLATION"
        }]
    }
}

On this page