Guida all'ambiente sandbox dinamico di gestione logistica diretta per i fornitori
Use the Selling Partner API dynamic sandbox to test vendor direct fulfillment operations.
Panoramica
L'ambiente sandbox dinamico dell'API per i partner di vendita consente di testare le applicazioni senza influire sui dati di produzione o scatenare eventi reali. La sandbox dinamica indirizza le richieste a un back-end sandbox che può restituire risposte in base ai parametri della richiesta. Inviando le richieste agli endpoint sandbox e non agli endpoint di produzione, puoi testare i flussi di lavoro standard senza alcun impatto sui dati di produzione.
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.
Supporto della sandbox dinamica nelle API Gestione logistica diretta per i fornitori
The following Vendor Direct Fulfillment API sections support the dynamic sandbox:
-
La API Ordini di gestione logistica diretta per i fornitori v2021-12-28 supporta tutte le operazioni di produzione equivalenti a V1.
Nota
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. -
L'API Spedizione di gestione logistica diretta per i fornitori v2021-12-28 supporta tutte le operazioni di produzione equivalenti a V1.
Risposte statiche
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. -
L'API Transazioni di gestione logistica diretta per i fornitori v2021-12-28 supporta tutte le operazioni di produzione equivalenti a V1.
Usa l'API SandboxData di gestione logistica diretta per i fornitori v2021-10-28 per generare ordini fittizi da utilizzare per i test con queste API.
Test con le API Gestione logistica diretta supportate
Follow these high-level steps to test using the supported Direct Fulfillment APIs:
-
Genera ordini fittizi per i test. Gli ordini generati sono progettati per soddisfare gli scenari aziendali specifici di prova descritti nella sezione Scenari.
-
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.
Scenari
Per gli ordini generati a scopo di test, sono supportati i seguenti scenari aziendali di prova. Si tratta degli unici casi d'uso supportati dagli ordini di prova e sono incentrati principalmente sulla generazione di etichette di spedizione. Salvo diversa indicazione, gli scenari di etichettatura restituiscono un'etichetta fittizia, fissa e standardizzata.
- 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 per gli ordini di prova
Gli ordini fittizi generati utilizzano il set di ASIN (Amazon Standard Identification Number) di prova indicato nella seguente tabella, insieme alle caratteristiche dei pacchi associate.
Tipo di pacco | ASIN | Caratteristiche del pacco |
---|---|---|
piccolo collo | TESTASIN001 | Dimensioni del pacco (altezza x larghezza x lunghezza): 2,5 cm x 2,5 cm x 5 cm Peso: 0,5 kg |
piccolo collo | TESTASIN004 | Dimensioni del pacco (altezza x larghezza x lunghezza): 13 cm x 5 cm x 20 cm Peso: 1,4 kg |
pesante-voluminoso | TESTASIN002 | Dimensioni del pacco (altezza x larghezza x lunghezza): 127 cm x 127 cm x 76 cm Peso: 45 kg |
multi-pacco | TESTASIN003 | Dimensioni del pacco 1 (altezza x larghezza x lunghezza): 91 cm x 94 cm x 61 cm Peso: 3,2 kg Dimensioni del pacco 2 (altezza x larghezza x lunghezza): 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:
-
Chiama l'operazione
generateOrderScenarios
, specificando gli identificativi delle parti necessari.Amazon riceve la richiesta dati di prova. Se l'operazione va a buon fine, la risposta include un valore
transactionId
. Dopo aver ricevuto una risposta positiva, attendi circa 30-40 minuti prima di procedere. -
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
.
Prerequisiti
Per completare questo tutorial, avrai bisogno di:
- L'autorizzazione del partner di vendita per il quale stai effettuando chiamate.
- 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
Richiedi gli ordini di prova fornendo gli indentificativi delle parti richiesti. Per richiedere la generazione degli ordini di prova, chiama l'operazione generateOrderScenarios
, passando i seguenti parametri:
Parametri della richiesta
Corpo della richiesta
Parametro | Descrizione | Obbligatorio |
---|---|---|
orders |
Una matrice di ordini di prova indicati dagli identificatori delle parti. Tipo: matrice < OrderScenarioRequest > |
Sì |
Esempio di richiesta
POST http://sandbox.sellingpartnerapi-na.amazon.com//vendor/directFulfillment/
sandbox/2021-10-28/orders
{
"orders": [
{
"sellingParty": {
"partyId": "NIQQM"
},
"shipFromParty": {
"partyId": "CWPQ"
}
}
]
}
Risposta
Una risposta con esito positivo include quanto segue:
Parametro | Descrizione | Obbligatorio |
---|---|---|
transactionId |
Un GUID assegnato da Amazon per identificare la transazione. Tipo: stringa |
Sì |
Esempio di risposta
{
"transactionId": "0343fcb3-fd7e-455e-968f-fb4ff7dd4081-20211014222021"
}
Dopo aver ricevuto una risposta positiva con il transactionId, attendi circa 30-40 minuti prima di procedere al Passaggio 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.
Parametri della richiesta
Parametro del percorso
Parametro | Descrizione | Obbligatorio |
---|---|---|
transactionId |
L'identificativo della transazione restituito in risposta all'operazione generateOrderScenarios. | Sì |
Esempio di richiesta
GET http://sandbox.sellingpartnerapi-na.amazon.com/vendor/directFulfillment/
sandbox/2021-10-28/transactions/0343fcb3-fd7e-455e-968f-fb4ff7dd4081-20211014222021
Risposta
Una risposta con esito positivo include quanto segue:
Parametro | Descrizione | Obbligatorio |
---|---|---|
transactionStatus |
I dettagli della transazione, incluso lo stato. Se la transazione è andata a buon fine, include anche i dati dell'ordine di prova richiesti. Tipo: Transaction |
Sì |
Esempio di risposta
Operazione riuscita (codice di stato HTTP 200): la risposta contiene i dati di prova dello scenario generato con i numeri degli ordini
{
"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"
}
]
}
]
}
}
}
Esempio di risposta
In elaborazione (codice di stato HTTP 404): la richiesta è in fase di elaborazione e la generazione dei dati di prova non è ancora completa.
{
"errors": [
{
"code": "ResourceNotFound",
"message": "Cannot find resource by the given URI"
}
]
}
Esempio di risposta
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