Tedarikçi Doğrudan Gönderim Dinamik Korumalı Alan Rehberi
Use the Selling Partner API dynamic sandbox to test vendor direct fulfillment operations.
Genel Bakış
Satış Ortağı API'si dinamik korumalı alan ortamı, üretim verilerini etkilemeden veya gerçek dünya olaylarını tetiklemeden uygulamalarınızı test etmenize olanak tanır. Dinamik korumalı alan, istekleri istek parametrelerine göre gerçekçi yanıtlar döndürebilen bir korumalı alan arka ucuna yönlendirir. İstekleri üretim uç noktaları yerine korumalı alan uç noktalarına göndererek standart iş akışlarını üretim verilerini etkilemeden test edebilirsiniz.
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.
Tedarikçi Doğrudan Gönderim API'lerinde dinamik korumalı alan desteği
The following Vendor Direct Fulfillment API sections support the dynamic sandbox:
-
The Vendor Direct Fulfillment Orders API 2021-12-28 version supports all of the equivalent V1 production operations.
Not
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. -
The Vendor Direct Fulfillment Shipping API 2021-12-28 version supports all of the equivalent V1 production operations.
Statik yanıtlar
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. -
The Vendor Direct Fulfillment Transactions API 2021-12-28 version supports all of the equivalent V1 production operations.
Use the Vendor Direct Fulfillment SandboxData API 2021-10-28 version to generate fictional orders to use while testing with these APIs.
Desteklenen Doğrudan Gönderim API'lerini kullanarak test etme
Follow these high-level steps to test using the supported Direct Fulfillment APIs:
-
Generate fictional orders for testing. The orders that you generate are designed to accommodate the specific business test scenarios described under Scenarios.
-
Use the generated orders to perform business test scenarios with the supported Vendor Direct Fulfillment APIs and operations.
Önemli
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.
Senaryolar
Test amacıyla oluşturulan siparişlerde aşağıdaki iş senaryoları desteklenmektedir. Bunlar, test siparişleri tarafından desteklenen tek kullanım senaryolarıdır ve öncelikle kargo için etiket oluşturmaya odaklanır. Aksi belirtilmedikçe, etiket senaryoları sabit, standartlaştırılmış, kurgusal bir etiket döndürür.
- 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.
Test siparişi ASIN'leri
Oluşturulan kurgusal siparişler, aşağıdaki tabloda gösterilen test ASIN'leri (Amazon Standart Kimlik Numaraları) kümesini ve ilişkili parsel özelliklerini kullanır.
Parsel türü | ASIN | Paket özellikleri |
---|---|---|
küçük parsel | TESTASIN001 | Paket boyutları (YxGxU): 1 inç x 1 inç x 2 inç. Ağırlık: 1 lb. |
küçük parsel | TESTASIN004 | Paket Boyutları (YxGxU): 5 inç x 2 inç x 8 inç. Ağırlık: 3 lb. |
ağır hacimli | TESTASIN002 | Paket Boyutları (YxGxU): 50 inç x 50 inç x 30 inç. Ağırlık: 100 lb. |
çok parçalı | TESTASIN003 | Paket1 Boyutları (YxGxU): 36 inç x 37 inç x 24 inç. Ağırlık: 7 lb. Paket2 Boyutları (YxGxU): 10 inç x 30 inç x 40 inç. Ağırlık: 3 lb. |
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:
-
Call the
generateOrderScenarios
operation, specifying the required party identifiers.Amazon, test verisi talebini alır. İşlem başarılı olursa yanıt
transactionId
değeri içerir. Başarılı bir yanıt aldıktan sonra, devam etmeden önce yaklaşık 30-40 dakika bekleyin. -
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
.
Ön koşullar
Bu eğitici içeriği tamamlamak için şunlara ihtiyacınız olacak:
- Çağrıda bulunduğunuz satış ortağından yetkilendirme.
- 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
Request the test orders by providing the required party identifiers. To request generation of test orders, call the generateOrderScenarios
operation, passing the following parameters:
İstek parametreleri
İstek gövdesi
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
orders |
Taraf tanımlayıcıları tarafından belirtildiği gibi bir dizi test siparişi. Type: < OrderScenarioRequest > array |
Evet |
İstek örneği
POST http://sandbox.sellingpartnerapi-na.amazon.com//vendor/directFulfillment/
sandbox/2021-10-28/orders
{
"orders": [
{
"sellingParty": {
"partyId": "NIQQM"
},
"shipFromParty": {
"partyId": "CWPQ"
}
}
]
}
Yanıt
Başarılı bir yanıtta aşağıdakiler yer alır:
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
transactionId |
Bu işlemi tanımlamak için Amazon tarafından atanan bir GUID. Tür: dize |
Evet |
Yanıt örneği
{
"transactionId": "0343fcb3-fd7e-455e-968f-fb4ff7dd4081-20211014222021"
}
İşlem kimliği ile başarılı bir yanıt aldıktan sonra, 2. Adım'a geçmeden önce yaklaşık 30-40 dakika bekleyin.
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.
İstek parametreleri
Yol parametresi
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
transactionId |
"generateOrderScenarios" işlemine verilen yanıtta döndürülen işlem tanımlayıcısı. | Evet |
İstek örneği
GET http://sandbox.sellingpartnerapi-na.amazon.com/vendor/directFulfillment/
sandbox/2021-10-28/transactions/0343fcb3-fd7e-455e-968f-fb4ff7dd4081-20211014222021
Yanıt
Başarılı bir yanıtta aşağıdakiler yer alır:
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
transactionStatus |
Durum da dahil olmak üzere işlem ayrıntıları. İşlem başarılı olduysa istenen test siparişi verilerini de içerir. Type: Transaction |
Evet |
Yanıt örneği
Başarılı (HTTP durum kodu 200): Yanıt, sipariş numaralarıyla oluşturulan senaryo test verilerini içerir
{
"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"
}
]
}
]
}
}
}
Yanıt örneği
İşleniyor (HTTP durum kodu 404): İstek işleniyor ve test verilerinin oluşturulması henüz tamamlanmadı.
{
"errors": [
{
"code": "ResourceNotFound",
"message": "Cannot find resource by the given URI"
}
]
}
Yanıt örneği
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