Guía de entorno aislado dinámico de gestión logística directa del proveedor

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

Visión general

El entorno aislado dinámico de la API del colaborador comercial te permite probar tus aplicaciones sin afectar a los datos de producción ni desencadenar eventos reales. Dicho entorno envía las solicitudes a un backend de otro entorno aislado que puede devolver respuestas realistas en función de los parámetros de la solicitud. Al enviar solicitudes a los endpoints del entorno aislado en lugar de a los endpoints de producción, puedes poner a prueba los procesos estándar sin que ello afecte a los datos de producción.

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.

Compatibilidad con el entorno aislado dinámico en las API de gestión logística directa del proveedor

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

Utiliza la API de datos de entorno aislado de gestión logística directa del proveedor versión 2021-10-28 para generar pedidos ficticios que se utilizarán durante las pruebas con estas API.

Pruebas con las API de gestión logística directa compatibles

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

  1. Genera pedidos ficticios para realizar pruebas. Los pedidos que generes están diseñados para adaptarse a los escenarios de pruebas empresariales específicos descritos en Escenarios.

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

🚧

Importante

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.

Escenarios

Los siguientes escenarios empresariales son compatibles en los pedidos generados para realizar pruebas. Estos son los únicos casos de uso admitidos por los pedidos de prueba y se centran principalmente en la generación de etiquetas de envío. A menos que se indique lo contrario, los escenarios de etiquetas devuelven una etiqueta fija, estandarizada y ficticia.

  • 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 de pedidos de prueba

Los pedidos ficticios generados utilizan el conjunto de ASIN de prueba (números de identificación normalizados de Amazon) y las características de paquete asociadas que se muestran en la siguiente tabla.

Tipo de paquete ASIN Características del paquete
paquete pequeño TESTASIN001 Dimensiones del paquete (alt. x anch. x prof.): 2,5 cm x 2,5 cm x 5 cm
Peso: 0,5 kg
paquete pequeño TESTASIN004 Dimensiones del paquete (alt. x anch. x prof.): 13 cm x 5 cm x 20 cm
Peso: 1,4 kg
muy voluminoso TESTASIN002 Dimensiones del paquete (alt. x anch. x prof.): 127 cm x 127 cm x 76 cm
Peso: 45 kg
varias piezas TESTASIN003 Dimensiones del paquete 1 (alt. x anch. x prof.): 91 cm x 94 cm x 61 cm
Peso: 7 3 kg
Dimensiones del paquete 2 (alt. x anch. x prof.): 25 cm x 76 cm x 102 cm
Peso: 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. Llama a la operación generateOrderScenarios, especificando los identificadores de las partes necesarios.

    Amazon recibe la solicitud de datos de prueba. Si la operación se realiza correctamente, la respuesta incluye un valor de transactionId. Tras recibir una respuesta correcta, espera aproximadamente de 30 a 40 minutos antes de continuar.

  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.

Requisitos

Para completar este tutorial, necesitarás:

  • Autorización del colaborador comercial para el que ejecutas llamadas.
  • 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

Para solicitar los pedidos de prueba, proporciona los identificadores de las partes necesarios. Para solicitar la generación de pedidos de prueba, llama a la operación generateOrderScenarios, utilizando los parámetros siguientes:

Parámetros de solicitud

Cuerpo de solicitud

Parámetro Descripción Obligatorio
orders Una matriz de pedidos de prueba, según lo indicado por los identificadores de las partes.

Tipo: matriz < OrderScenarioRequest >

Ejemplo de solicitud

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

Respuesta

Una respuesta correcta incluye lo siguiente:

Parámetro Descripción Obligatorio
transactionId Un GUID asignado por Amazon para identificar esta transacción.

Tipo: cadena

Ejemplo de respuesta

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

Tras recibir una respuesta correcta con el transactionId, espera aproximadamente de 30 a 40 minutos antes de continuar en el paso 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.

Parámetros de solicitud

Parámetro de ruta

Parámetro Descripción Obligatorio
transactionId El identificador de transacción devuelto en la respuesta a la operación generateOrderScenarios.

Ejemplo de solicitud

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

Respuesta

Una respuesta correcta incluye lo siguiente:

Parámetro Descripción Obligatorio
transactionStatus Los detalles de la transacción, incluido el estado. Si la transacción se ha realizado correctamente, también incluye los datos solicitados del pedido de prueba.

Tipo: Transacción

Ejemplo de respuesta

Correcto (código de estado HTTP 200): la respuesta contiene los datos de prueba del escenario generados con los números de pedido

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

Ejemplo de respuesta

En proceso (código de estado HTTP 404): la solicitud está en proceso y la generación de los datos de prueba aún no ha finalizado.

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

Ejemplo de respuesta

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

¿Te ha ayudado esta página?