ベンダー出品者出荷の動的サンドボックスガイド
Use the Selling Partner API dynamic sandbox to test vendor direct fulfillment operations.
概要
Selling Partner APIの動的サンドボックス環境では、本番データに影響を与えたり、実際のイベントを発生させたりすることなく、アプリケーションをテストできます。動的サンドボックスは、リクエストパラメーターに基づいて現実的なレスポンスを返すことができるサンドボックスバックエンドにリクエストをルーティングします。本番環境のエンドポイントではなく、サンドボックスのエンドポイントにリクエストを送信することで、本番データに影響を与えずに標準ワークフローをテストできます。
This guide introduces the available dynamic sandbox operations for the Vendor Direct Fulfillment APIs. For more information about the Selling Partner API sandbox environments, refer to Selling Partner API sandbox.
ベンダー ダイレクトフルフィルメント APIにおける動的サンドボックスのサポート
The following Vendor Direct Fulfillment API sections support the dynamic sandbox:
-
ベンダー出品者出荷の注文API 2021-12-28バージョンは、同等のV1本番オペレーションをすべてサポートします。
注
Production calls for Vendor Direct Fulfillment Orders API include additional response parameters beyond
scenarioId
andorderId
sandbox parameters. You must update your request to specify these additional parameters prior to making production calls. -
ベンダー出品者出荷配送API 2021-12-28バージョンは、同等のV1本番オペレーションをすべてサポートします。
静的レスポンス
The dynamic sandbox backend service does not yet return dynamic responses for all Vendor Direct Fulfillment Shipping operations. The service returns static responses for the
submitShipmentStatusUpdates
,getCustomerInvoices
,getCustomerInvoice
,getPackageSlips
, andgetPackageSlip
operations. Any successful call to one of these operations always returns the same static response for that operation. -
ベンダー出品者出荷トランザクションAPI 2021-12-28バージョンは、同等のV1本番オペレーションをすべてサポートします。
これらのAPIを使用したテスト中に架空の注文を生成する場合は、ベンダー出品者出荷サンドボックスデータAPI 2021-10-28バージョンを使用します。
サポートされている出品者出荷APIを使用したテスト
Follow these high-level steps to test using the supported Direct Fulfillment APIs:
-
テスト用の架空の注文を生成します。生成する注文は、以下のシナリオで説明するビジネスのテストシナリオに対応するように設計されています。
-
Use the generated orders to perform business test scenarios with the supported Vendor Direct Fulfillment APIs and operations.
重要
You must direct your sandbox requests to the Selling Partner API sandbox endpoints. If you are using a SP-API sandbox environment to test a call that requires a Restricted Data Token (RDT), you must get the RDT from the production environment and pass it to your sandbox call. For more information about restricted operations for which you need an RDT, refer to the Token API Use case guide.
シナリオ
生成されたテスト用の注文は、次のビジネスシナリオに対応しています。これらのユースケースのみがテスト注文をサポートし、主として配送用のラベル生成に焦点を当てています。明記されていない限り、ラベルのシナリオでは一定の標準化された架空のラベルが返されます。
- LIFECYCLE: Use these test orders to simulate order lifecycle testing. The response to an operation that employs these orders can vary. For example, a ship label request made for a multi-box order results in a multiple label response. Similarly, a ship label request made with a package dimension change can result in a ship method change in the response.
- LABEL_CASE-SHIP_METHOD_UNASSIGNABLE: Use these test orders to simulate a ship method unassignable error, which occurs when Amazon is not able to assign a ship method for an order.
- LABEL_CASE-INCONSISTENT_METHODS: Use these test orders to simulate an "inconsistent ship method" error, which occurs when Amazon is not able to assign the same ship method to all of the boxes for a multi-box or multi-package order.
- LABEL_CASE-CARRIER_INTERNAL_FAILURE: Use these test orders to simulate a "carrier internal failure" error, which occurs when the carrier throws an error during label generation.
- LABEL_CASE-SYS_INTERNAL_FAILURE: Use these test orders to simulate a "system internal failure" error, which occurs when an unexpected failure happens in Amazon's systems.
- LABEL_CASE-DEST_ADDRESS_WRONG: Use these test orders to simulate a "destination address is wrong" error, which happens when a customer address falls outside of a carrier's service area.
- LABEL_CASE-SERVICE_NOT_AVAILABLE: Use these test cases to simulate a "service not available" error, which occurs when the selected carrier service is not available or applicable.
- SHIP_CONFIRM_CASE-SHIP_METHOD_UNASSIGNABLE: Use these test orders to simulate a ship method unassignable error, which occurs when Amazon is not able to assign a ship method for an order. This applies to vendor own label shipments.
- SHIP_CONFIRM_CASE-SYS_INTERNAL_FAILURE: Use these test orders to simulate a "system internal failure" error, which occurs when an unexpected failure happens in Amazon's systems.
テスト注文のASIN
生成された架空の注文には、次の表に示す一連のテストASIN(Amazon標準識別番号)と関連する小包の特性を使用します。
小包タイプ | ASIN | パッケージの特性 |
---|---|---|
小さい小包 | TESTASIN001 | パッケージの寸法(高さx幅x長さ):1インチ x 1インチ x 2インチ。 重量:1ポンド。 |
小さい小包 | TESTASIN004 | パッケージの寸法(高さx幅x長さ):5インチ x 2インチ x 8インチ。 重量:3ポンド。 |
重くてかさばる | TESTASIN002 | パッケージの寸法(高さx幅x長さ):50インチ x 50インチ x 30インチ。 重量:100ポンド。 |
複数個 | TESTASIN003 | パッケージ1の寸法(高さx幅x長さ):36インチ x 37インチ x 24インチ 重量:7ポンド パッケージ2の寸法(高さx幅x長さ):10インチ x 30インチ x 40インチ 重量:3ポンド |
Tutorial - Generate fictional orders for testing
Use this tutorial to generate test orders for the preceding scenarios to test the Vendor Direct Fulfillment APIs.
Follow these steps to generate test orders and related label scenarios:
-
必要な当事者IDを指定して、
generateOrderScenarios
オペレーションを呼び出します。Amazonがテストデータリクエストを受け取ります。このオペレーションが成功すると、レスポンスに
transactionId
値が含まれます。成功レスポンスの受信後、およそ30~40分待ってから処理してください。 -
Periodically call the
getOrderScenarios
operation, passing thetransactionId
value from the previous step, until you receive a successful response and thestatus
value in the response indicates that processing has ended. Processing ends when the status equalsSUCCESS
orFAILURE
. At this point the response includes either the test orders if the status isSUCCESS
, or an error array with details about the errors if the status isFAILURE
.
前提条件
このチュートリアルを完了するには、以下が必要です。
- 呼び出し先の出品パートナーからの承認。
- Approval for the Direct-to-Consumer Shipping role in your developer profile.
- The Direct-to-Consumer Shipping role selected in the App registration page for your application.
Step 1: Request fictional test orders
必要な当事者IDを指定して、テスト注文をリクエストします。テスト注文の生成をリクエストするには、以下のパラメーターを渡して、generateOrderScenarios
オペレーションを呼び出します。
リクエストパラメータ
リクエスト本文
パラメーター | 説明 | 必須 |
---|---|---|
orders |
当事者IDで示されるテスト注文の配列。 タイプ:< OrderScenarioRequest > 配列 |
はい |
リクエストの例
POST http://sandbox.sellingpartnerapi-na.amazon.com//vendor/directFulfillment/
sandbox/2021-10-28/orders
{
"orders": [
{
"sellingParty": {
"partyId": "NIQQM"
},
"shipFromParty": {
"partyId": "CWPQ"
}
}
]
}
レスポンス
成功レスポンスには、以下が含まれます。
パラメーター | 説明 | 必須 |
---|---|---|
transactionId |
このトランザクションを識別するためにAmazonが割り当てたGUID。 タイプ:文字列 |
はい |
レスポンスの例
{
"transactionId": "0343fcb3-fd7e-455e-968f-fb4ff7dd4081-20211014222021"
}
transactionIdが記載された成功レスポンスを受信したら、30~40分程待ってからステップ2に進みます。
Step 2: Return the status and the requested fictional orders if ready
To retrieve the status of the generateOrderScenarios
transaction, and the requested test order data if available, call the getOrderScenarios
operation and pass the required transactionId
parameter. You must call this operation periodically until you receive either a successful response that contains the generated test orders, or a failure response that contains an error array with details about the errors.
After you receive the test orders, use them to perform dynamic ship label testing with the supported Vendor Direct Fulfillment APIs and operations.
リクエストパラメータ
パスパラメーター
パラメーター | 説明 | 必須 |
---|---|---|
transactionId |
GenerateOrderScenariosオペレーションへのレスポンスで返されたトランザクションID。 | はい |
リクエストの例
GET http://sandbox.sellingpartnerapi-na.amazon.com/vendor/directFulfillment/
sandbox/2021-10-28/transactions/0343fcb3-fd7e-455e-968f-fb4ff7dd4081-20211014222021
レスポンス
成功レスポンスには、以下が含まれます。
パラメーター | 説明 | 必須 |
---|---|---|
transactionStatus |
ステータスなど、トランザクションの詳細。トランザクションが成功した場合は、リクエストされたテスト注文データも含まれます。 タイプ:Transaction |
はい |
レスポンスの例
成功(HTTPステータスコード200):レスポンスには、生成されたシナリオテストデータと注文番号が含まれます。
{
"transactionStatus":
{
"transactionId": "ff35f39e-e69f-499e-903e-6c4f6c32609f-20210827003315",
"status": "Success",
"testCaseData":
{
"scenarios": [
{
"scenarioId": "LIFECYCLE",
"orders": [
{
"orderId": "T1111N"
},
{
"orderId": "T1111P"
}
]
},
{
"scenarioId": "LABEL_CASE-SHIP_METHOD_UNASSIGNABLE",
"orders": [
{
"orderId": "T5555N"
},
{
"orderId": "T5555P"
}
]
},
{
"scenarioId": "LABEL_CASE-INCONSISTENT_METHODS",
"orders": [
{
"orderId": "T2222N"
},
{
"orderId": "T2222P"
}
]
},
{
"scenarioId": "LABEL_CASE-CARRIER_INTERNAL_FAILURE",
"orders": [
{
"orderId": "T3333N"
},
{
"orderId": "T3333P"
}
]
},
{
"scenarioId": "LABEL_CASE-SYS_INTERNAL_FAILURE",
"orders": [
{
"orderId": "T4444N"
},
{
"orderId": "T4444P"
}
]
},
{
"scenarioId": "SHIP_CONFIRM_CASE-SHIP_METHOD_UNASSIGNABLE",
"orders": [
{
"orderId": "buw38"
}
]
},
{
"scenarioId": "SHIP_CONFIRM_CASE-SYS_INTERNAL_FAILURE",
"orders": [
{
"orderId": "qqw52"
}
]
},
{
"scenarioId": "LABEL_CASE-DEST_ADDRESS_WRONG",
"orders": [
{
"orderId": "T6666N"
},
{
"orderId": "T6666P"
}
]
},
{
"scenarioId": "LABEL_CASE-SERVICE_NOT_AVAILABLE",
"orders": [
{
"orderId": "T7777N"
},
{
"orderId": "T7777P"
}
]
}
]
}
}
}
レスポンスの例
処理中(HTTPステータスコード404):リクエストは処理中であり、テストデータの生成はまだ完了していません。
{
"errors": [
{
"code": "ResourceNotFound",
"message": "Cannot find resource by the given URI"
}
]
}
レスポンスの例
Failure (HTTP status code 200) - The test data failed to generate. Refer to the errors array for more information.
{
"transactionStatus":
{
"transactionId": "ee8363d3-d061-4b17-b218-d3c80e014c2f-20220105231359",
"status": "FAILED",
"testCaseData":
{
"scenarios": [
{
"scenarioId": "",
"orders": []
}
]
},
"errors": [
{
"code": "INVALID_WAREHOUSE_CODE",
"details": "Invalid Warehouse Code. Retry request with correct Warehouse code"
}
]
}
}
Updated 20 days ago