Sandbox

To facilitate ease of connector development, integration and testing, Amazon Yojaka supports a sandbox against which you can test all your connector code. You can test code that validates any workflow management, error handling, and idempotency checks. Along with testing your code that handles authentication and authorization.

Further, Amazon Yojaka supports a simple utility that will let you inject orders into the sandbox to help facilitate complete testing of your code. Amazon Yojaka also supports you to build adapters for any demand channels (marketplaces or DTC channels).

How do I use it?

To use the sandbox from your connector, complete the On-boarding and Seller Registration steps. Reach out to the smartconnect-support@amazon.com to request access to our sandbox.

Sandbox Setup

Once the Amazon Yojaka team receives your on-boarding and seller registration details, the following setup will be done on the sandbox:

  1. Setup your connector to be able to access the sandbox

  2. Create an account in the Amazon Yojaka sandbox for the seller

  3. Create a pseudo-location in the Amazon Yojaka sandbox for the seller

Once the sandbox setup is done, the Amazon Yojaka team will provide you with the following information:

  • Identifier of the Amazon Yojaka sandbox’s pseudo location created for the seller. You will need this identifier as an input parameter in many of Amazon Yojaka’s API calls.

Tip

Reach out to smartconnect-support@amazon.com if you need multiple pseudo-locations created for a single seller in the Amazon Yojaka sandbox for your testing.

Sandbox Details

Once you have been on-boarded onto Amazon Yojaka’s sandbox, you can direct your connector code to use the Amazon Yojaka sandbox’s endpoint URL as the base URL for all the APIs.

Country / Area

API Endpoint URL

IN

api.sandbox.dub.yojaka.xp.sellers.a2z.com

NA

api.sandbox.iad.yojaka.xp.sellers.a2z.com

How do I inject orders?

While the Amazon Yojaka sandbox works very much like the production system, the main difference is that the sandbox is disconnected from all marketplaces. Any inventory updates, order processing, etc are only handled internally within the sandbox and no updates are sent to any marketplace.

Because of the disconnected sandbox model, orders will not be injected into the sandbox from any marketplace/channel. To facilitate complete testing of your connector, Amazon Yojaka provides an API that allows you to an order into the sandbox. You can specify the following attributes for the sandbox-order to control the testing of your connector.

  • Location id

  • One or more line items in the order

For each line item in the order, you need to specify the following values:

  • SKU of line item

  • Number of units

The API’s response will include the identifier of the newly created sandbox order.

API Description

This section documents that API provided by the Amazon Yojaka sandbox for injecting an order into the sandbox.

Note

The Authentication and Authorization mechanisms for this API are exactly the same as that of any other Amazon Yojaka API.

HTTP Method

POST

Path

/v1/sandbox/orders

Request

{
    // Use the pseudo-location's id provided as part of sandbox onboarding
    "locationId": "d8973c6b-8571-451d-8e0f-c1c447187379",
    // This optional field can have one of two values - "REPLACEMENT" or
    // "EXCHANGE". Specify this value to inject a replacement/exchange
    // order into the sandbox. Omitting this field will insert a new order
    // into the sandbox.
    // Note: Check Order response to understand difference between
    // exchange and replacement orders
    "replacementOrderType": "EXCHANGE",
    // Provide Yojaka orderId of order you want to generate a replacement.
    // If empty, the fields populated will be random.
    // Note: Replaced order should be shipped before generating replacement
    "replacedOrderId": "YojakaReplacedOrderId",
    // This optional field can have one of two values - "FBA" or "MFN".
    // Specify this value to inject an order for FBA/MFN channel into the
    // sandbox. Omitting this field will insert an order for FBA channel.
    "channelName": "MFN",

    // This optional field can have one of two values - "Marketplace" or
    // "Self".
    // "Marketplace": It is the responsibilty of marketplace(FBA/MFN) to
    //  to ship the order to customer.
    // "Self": It is the responsibilty of seller to ship the order
    //  to customer.
    //  Specify this value to inject an order based on shipping type into
    //  the sandbox. Omitting this field will insert an order with
    //  Marketplace as shipping type.
    //  Note: Currently shipping type "Self" is not supported in FBA.
    "shippingType": "Self",

    //  Below block should contain the channel details for replaced order
    //  when the orderType is "EXCHANGE" or "REPLACEMENT". These details
    //  can be found in the marketplaceChannelDetails of replaced order
    "replacedChannelAttributes": {
         "locationId": "replacedChannelLocationId",
         "shipmentId": "replacedChannelShipmentId",
         "customerOrderId": "replacedChannelOrderId",
    },
    "lineItems": [{
        // Use any SKU identifier of your choice
        "sku": "TestSku1",
        // Provide replacedSku from replaced order
        // If providing replacedOrder, replacedSku is mandatory and should
        // also be present in the replacedOrder.
        "replacedSku": "TestSku2",
        // Provide any positive number greater than 1
        "numberOfUnits": 2,
        // This is an optional field. Only applicable in the case
        // of pharma order creation. This field could have "RX",
        // "OTC", "DL_REGULATED_PRODUCTS_WITH_EXPIRY" values.
        // Rx products require prescription and addendum to the invoice
        // (p-slip). OTC products and DL_regulated_products_with_expiry
        // don't require prescription but require addendum to the invoice
        // (p-slip).
        "medicalClassification": "RX"
    }, {
        "sku": "TestSku2",
        "numberOfUnits": 1
    }]
}

Response

{
    // Identifier of the newly created sandbox order
    "orderId": "8b9e408d-48bc-459f-ad27-8e37912e6c105"
}

What about SKUs?

For the purpose of enabling your testing, the sandbox will treat any SKU you provide as a valid SKU on any marketplace. You can use any SKU identifier to update inventory, or any SKU identifier while injecting orders into the sandbox.

How do I inject or update returns?

While the Amazon Yojaka sandbox works very much like the production system, the main difference is that the sandbox is disconnected from all marketplaces. Any inventory updates, order processing, etc are only handled internally within the sandbox and no updates are sent to any marketplace.

Because of the disconnected sandbox model, returns will not be injected into the sandbox from any marketplace/channel. To facilitate complete testing of your connector, Amazon Yojaka provides an API that allows you to an reutrn into the sandbox. You can specify the following attributes for the sandbox-return to control the testing of your connector.

  • Return Location id

  • Return Type

  • Merchant SKU

  • Number of Units

  • Rma Id

  • Tracking Info

For Tracking Info in the return, you need to specify the following values:

  • Reverse Leg Tracking Id

  • Carrier Name

The API’s response will include the identifier of the newly created sandbox return.

API Description

This section documents that API provided by the Amazon Yojaka sandbox for injecting Returns into the sandbox. To create a return you should have a ship completed order available on Sandbox. For this, you can inject an order by adding inventory on the sku and ship complete it. You can find the details on how to inject the order above. Or you can reuse any of your existing sandbox order which is in shipped/delivered state

You can specify the following attributes for the sandbox-return to control the testing of your connector.

  • Order Id

  • Return Type

  • Merchant Sku

  • Number Of Units

  • Tracking Info

  • Flag for Replacement Returns

  • Flag for Exchange Returns

For Tracking Info in the return, you need to specify the following values:

  • Reverse Leg Tracking Id

  • Carrier Name

For a Replacement/Exchange Return on an FBA order trackingInfo should be null initially, same for RETURNLESS type returns.

The API’s response will include the identifier of the newly created sandbox return.

Note

The Authentication and Authorization mechanisms for this API are exactly the same as that of any other Amazon Yojaka API.

HTTP Method

POST

Path

/v1/sandbox/returns

Request

{
    "orderId": "13ERT3241KJ",
    "returnLocationId": "d8973c6b-8571-451d-8e0f-c1c447187379",
    // returnType Can be any of the two CUSTOMER or REJECT
    "returnType": "CUSTOMER",

    "merchantSku": "TestSku1",
     // Any positive number for numberOfUnits
     "isReplacement": false,
     "isExchange": false,
     "numberOfUnits": "5",
     "rmaId": "TestRmaId",
     "trackingInfo": {
         "reverseLegTrackingId": "TestTrackingId",
         "carrierName": "TestCarrierName"
      }
 }

Response

{
    // Identifier of the newly created sandbox return
    "returnId": "8b9e408d-48bc-459f-ad27-8e37912e6c105"
}

API Description

This section documents that API provided by the Amazon Yojaka sandbox for updating Returns into the sandbox.

You can specify the following attributes for the sandbox-return to control the testing of your connector.

  • Return id

  • Return Status

  • OTP

  • Returned With OTP

  • Tracking Info

For Tracking Info in the return, you need to specify the following values:

  • Reverse Leg Tracking Id

  • Carrier Name

Tracking Info should be provided when status is REPLANNED.

OTP can only be sent when status is being sent as “OUT_FOR_DELIVERY”.

Returned With OTP can only be sent when status is being sent as “DELIVERED”.

This API does not return a response.

Note

The Authentication and Authorization mechanisms for this API are exactly the same as that of any other Amazon Yojaka API.

HTTP Method

PATCH

Path

/v1/sandbox/returns

Request

{
    "returnId": "8b9e408d-48bc-459f-ad27-8e37912e6c10",
    // returnStatus should be one of
    // CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER
    // CARRIER_OUT_FOR_PICK_UP_FROM_CUSTOMER
    // CUSTOMER_CANCELLED_PICK_UP
    // CUSTOMER_RESCHEDULED_PICK_UP
    // PICKED_FROM_CUSTOMER
    // IN_TRANSIT
    // DELIVERED
    // OUT_FOR_DELIVERY
    "returnStatus": "REPLANNED",
    "otp" : "38976",
},
{
    "returnId": "8b9e408d-48bc-459f-ad27-8e37912e6c10",
    // returnStatus should be one of
    // CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER
    // CARRIER_OUT_FOR_PICK_UP_FROM_CUSTOMER
    // CUSTOMER_CANCELLED_PICK_UP
    // CUSTOMER_RESCHEDULED_PICK_UP
    // PICKED_FROM_CUSTOMER
    // IN_TRANSIT
    // DELIVERED
    // OUT_FOR_DELIVERY
    "returnStatus": "DELIVERED",
     "trackingInfo": {
         "reverseLegTrackingId": "TestTrackingId",
         "carrierName": "TestCarrierName"
      }
    "returnedWithOTP"  : true
}

Working with Postman

You can use the Postman tool to invoke Amazon Yojaka’s APIs and familiarize yourself with the API methods, requests and responses. You can find more information about the Postman tool here.

For easier usage and testing of Amazon Yojaka’s APIs in the sandbox from the Postman tool, follow the instructions given below:

  1. Download the Postman collection onto your local system

  2. Launch the Postman tool

  3. Import the collection into the Postman tool using the instructions given here

You can now use the APIs imported into the Postman tool to invoke and test the Amazon Yojaka APIs in the sandbox.

Note

We recommend that you download and use the latest version of the Postman tool for testing. You can download the Postman tool here.

On this page