Dokumentation
Entwickler-HubAPI-StatusUnterstützung

Leitfaden zur dynamischen Sandbox für Anbieter mit Direktversand

Use the Selling Partner API dynamic sandbox to test vendor direct fulfillment operations.

Überblick

Die Umgebung der dynamischen Sandbox für die Verkaufspartner-API ermöglicht Ihnen, Ihre Anwendungen zu testen, ohne dass die Produktionsdaten beeinträchtigt oder reale Ereignisse ausgelöst werden. Die dynamische Sandbox leitet Anfragen an ein Sandbox-Backend weiter, das auf der Grundlage der Anforderungsparameter realistische Antworten zurückgeben kann. Indem Sie Anfragen an die Sandbox-Endpunkte statt an die Produktionsendpunkte senden, können Sie Standard-Workflows testen, ohne die Produktionsdaten zu beeinflussen.

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.

Unterstützung für dynamische Sandbox in den APIs für Direktversand durch Anbieter

The following Vendor Direct Fulfillment API sections support the dynamic sandbox:

Nutzen Sie die SandboxData-API für Direktversand durch Anbieter (Version 2021-10-28), um fiktive Bestellungen zu generieren, die beim Testen mit diesen APIs verwendet werden können.

Testen mit den unterstützten APIs für Direktversand

Follow these high-level steps to test using the supported Direct Fulfillment APIs:

  1. Generieren Sie fiktive Bestellungen zum Testen. Die Bestellungen, die Sie generieren, sind so konzipiert, dass sie den spezifischen Geschäftstestszenarien entsprechen, die unter Szenarien beschrieben werden.

  2. Use the generated orders to perform business test scenarios with the supported Vendor Direct Fulfillment APIs and operations.

🚧

Wichtig

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.

Szenarien

Die folgenden Geschäftsszenarien werden in den generierten Bestellungen zu Testzwecken unterstützt. Dies sind die einzigen Anwendungsfälle, die von den Testbestellungen unterstützt werden. Sie konzentrieren sich hauptsächlich auf die Generierung von Etiketten für den Versand. Sofern nicht anders angegeben, geben die Etikettenszenarien ein festes, standardisiertes, fiktives Etikett zurück.

  • 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.

ASINs für Testbestellungen

Die generierten fiktiven Bestellungen verwenden den Satz von Test-ASINs (Amazon Standard Identification Numbers) und die zugehörigen Paketmerkmale, die in der folgenden Tabelle aufgeführt sind.

Art des Pakets ASIN Eigenschaften des Pakets
kleines Paket TESTASIN001 Verpackungsabmessungen (HxBxL): 2,5 cm x 2,5 cm x 5 cm
Gewicht: 0,5 kg
kleines Paket TESTASIN004 Verpackungsabmessungen (HxBxL): 13 cm x 5 cm x 20 cm
Gewicht: 1,4 kg
schwer-sperrig TESTASIN002 Verpackungsabmessungen (HxBxL): 127 cm x 127 cm x 76 cm
Gewicht: 45 kg
mehrteilig TESTASIN003 Paket1 Abmessungen (HxBxL): 91 cm x 94 cm x 61 cm
Gewicht: 3 kg
Paket2 Abmessungen (HxBxL): 25 cm x 76 cm x 102 cm
Gewicht: 1,4 kg

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:

  1. Rufen Sie den Vorgang generateOrderScenarios auf und geben Sie die erforderlichen Party-IDs ein.

    Amazon erhält die Testdatenanfrage. Wenn der Vorgang erfolgreich ist, enthält die Antwort den Wert transactionId. Warten Sie nach Erhalt einer erfolgreichen Antwort etwa 30 bis 40 Minuten, bevor Sie fortfahren.

  2. Periodically call the getOrderScenarios operation, passing the transactionId value from the previous step, until you receive a successful response and the status value in the response indicates that processing has ended. Processing ends when the status equals SUCCESS or FAILURE. At this point the response includes either the test orders if the status is SUCCESS, or an error array with details about the errors if the status is FAILURE.

Voraussetzungen

Um dieses Tutorial abzuschließen, benötigen Sie Folgendes:

  • Autorisierung durch den Verkaufspartner, für den Sie Aufrufe tätigen.
  • 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

Fordern Sie die Testbestellungen an, indem Sie die erforderlichen Party-IDs angeben. Um die Generierung von Testbestellungen anzufordern, rufen Sie den Vorgang generateOrderScenarios auf, wobei die folgenden Parameter übergeben werden:

Parameter anfordern

Text der Anfrage

Parameter Beschreibung Erforderlich
orders Eine Reihe von Testbestellungen, wie durch Party-IDs angegeben.

Typ: < OrderScenarioRequest > Array

Ja

Beispiel anfordern

POST http://sandbox.sellingpartnerapi-na.amazon.com//vendor/directFulfillment/ sandbox/2021-10-28/orders
{ "orders": [ { "sellingParty": { "partyId": "NIQQM" }, "shipFromParty": { "partyId": "CWPQ" } } ] }

Antwort

Eine erfolgreiche Antwort umfasst Folgendes:

Parameter Beschreibung Erforderlich
transactionId Eine von Amazon zugewiesene GUID zur Identifizierung dieser Transaktion.

Typ: Zeichenfolge

Ja

Beispiel für eine Antwort

{ "transactionId": "0343fcb3-fd7e-455e-968f-fb4ff7dd4081-20211014222021" }

Warten Sie nach Erhalt einer erfolgreichen Antwort mit der transactionId etwa 30 bis 40 Minuten, bevor Sie mit Schritt 2 fortfahren.

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.

Parameter anfordern

Pfadparameter

Parameter Beschreibung Erforderlich
transactionId Die Transaktions-ID, die in der Antwort auf den Vorgang generateOrderScenarios zurückgegeben wurde.

Ja

Beispiel anfordern

GET http://sandbox.sellingpartnerapi-na.amazon.com/vendor/directFulfillment/ sandbox/2021-10-28/transactions/0343fcb3-fd7e-455e-968f-fb4ff7dd4081-20211014222021

Antwort

Eine erfolgreiche Antwort umfasst Folgendes:

Parameter Beschreibung Erforderlich
transactionStatus Die Transaktionsdetails einschließlich des Status. Wenn die Transaktion erfolgreich war, sind auch die angeforderten Testbestelldaten enthalten.

Typ: Transaction

Ja

Beispiel für eine Antwort

Erfolgreich (HTTP-Statuscode 200) — Die Antwort enthält die generierten Szenario-Testdaten mit Bestellnummern

{ "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" } ] } ] } } }

Beispiel für eine Antwort

Verarbeitung (HTTP-Statuscode 404) — Die Anfrage wird verarbeitet und die Generierung der Testdaten ist noch nicht abgeschlossen.

{ "errors": [ { "code": "ResourceNotFound", "message": "Cannot find resource by the given URI" } ] }

Beispiel für eine Antwort

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" } ] } }

Hat Ihnen diese Seite weitergeholfen?