Guide des cas d'utilisation de l'API Jetons
Utilisez le jeton de données restreint pour accéder en toute sécurité aux API des partenaires commerciaux.
Version de l'API : 01/03/2021
Qu'est-ce que l'API Jetons ?
The Selling Partner API for Tokens (Tokens API) provides a secure way to access a customer's Personally Identifiable Information (PII). You can call the createRestrictedDataToken
operation of the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. Or, if you have a delegatee application, you can get an RDT from a delegator application owned by a developer that you work closely with (refer to Delegating authorization). In either case, an RDT authorizes you to make calls to operations that return restricted data. For definitions, refer to Terminology.
When you call a restricted operation, you include an RDT in the x-amz-access-token
header. This is in contrast to other Selling Partner API operations, where you include an LWA access token in the x-amz-access-token
header. For more information, refer to Step 3. Add headers to the URI.
Délégation d'autorisation
With the Tokens API, a delegator application can get an RDT that delegates authorization to access PII to a delegatee application. The delegator application is authorized by the selling partner and is the application that the selling partner interacts with. The delegatee application performs a specialized function that requires PII, such as shipping, tax invoicing, or tax remittance services. These two applications are owned by different developers and are closely integrated, such that the delegator application can securely transmit an RDT to the delegatee application. For more information about delegating authorization using an RDT, refer to Tutorial: Delegate authorization to access PII.
Terminologie
-
Jeton de données restreint (RDT). Un jeton d'accès éphémère qui autorise des opérations restreintes d'appels. Un RDT reste valide pendant une heure.
-
Restricted operation. An operation that returns restricted data, such as PII. You need an RDT to call a restricted operation.
-
Ressource restreinte. Chemin et méthode HTTP qui représentent une opération restreinte.
-
Restricted report type. A report type that contains PII. Refer to Restricted report types.
-
Application délégante. Application qui obtient un RDT et le transmet à une application déléguée. Le partenaire de vente autorise l'application délégante et interagit avec elle.
-
Application déléguée. Application qui obtient l'autorisation d'appeler des opérations restreintes à partir d'un RDT qui lui est transmis par une application délégante. Une application déléguée exécute une fonction spécialisée qui nécessite des informations personnelles, telles que des services d'expédition, de facturation ou de versement de taxes, et n'est pas directement autorisée par le partenaire de vente.
-
Specific path. A path in a restricted resource that contains a specific order or shipment identifier. For example,
orders/v0/orders/902-3159896-1390916/address
. -
Generic path. A path in a restricted resource that contains a generic identifier, such as
{orderId}
or{shipmentId}
. For example,orders/v0/orders/{orderId}/address
.
Opérations restreintes
Les opérations restreintes renvoient des informations personnelles identifiables (PII) des clients. Vous avez besoin d'un RDT pour appeler une opération restreinte.
Voici la liste des opérations restreintes, regroupées par API :
API Commandes d'expédition directe :
getOrders
getOrder
API pour les commandes à traitement direct v2021-12-28
getOrders
getOrder
API Expédition directe :
getShippingLabel
getShippingLabels
getPackingSlip
getPackingSlips
getCustomerInvoice
getCustomerInvoices
createShippingLabels
API d'expédition directe v2021-12-28
getShippingLabel
getCustomerInvoices
getCustomerInvoice
getPackingSlips
getPackingSlip
API Easy Ship v06-03-23
createScheduledPackageBulk
API Merchant Fulfillment :
getShipment
cancelShipment
cancelShipmentOld
createShipment
API Commandes :
getOrders
getOrder
getOrderItems
getOrderRegulatedInfo
getOrderAddress
getOrderBuyerInfo
getOrderItemsBuyerInfo
API Rapports :
getReportDocument
Remarques
- The
getReportDocument
operation is considered a restricted operation only when a restricted report type is specified. Refer to the list of restricted report types. - When calling the
createRestrictedDataToken
operation to get an RDT for thegetReportDocument
operation, the specified restricted resource can contain only a specific path, not a generic path. For definitions, refer to Terminology. - When using RDT to access the
getReportDocument
operation, make sure your application has the correct right roles to access the report. Refer to Roles in the Selling Partner API for roles to reports mapping.
Facturation des expéditions :
getShipmentDetails
API Expédition :
getShipment
Types de rapports restreints
Les types de rapports restreints contiennent des informations personnelles. Lorsque vous spécifiez un type de rapport restreint dans un appel vers l'opération getReportDocument
, vous devez transmettre un RDT avec l'appel.
Voici une liste des types de rapports restreints :
GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING
GET_AMAZON_FULFILLED_SHIPMENTS_DATA_TAX
GET_FLAT_FILE_ACTIONABLE_ORDER_DATA_SHIPPING
GET_FLAT_FILE_ORDER_REPORT_DATA_SHIPPING
GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING
GET_FLAT_FILE_ORDER_REPORT_DATA_TAX
GET_FLAT_FILE_ORDERS_RECONCILIATION_DATA_TAX
GET_FLAT_FILE_ORDERS_RECONCILIATION_DATA_INVOICING
GET_FLAT_FILE_ORDERS_RECONCILIATION_DATA_SHIPPING
GET_ORDER_REPORT_DATA_INVOICING
GET_ORDER_REPORT_DATA_TAX
GET_ORDER_REPORT_DATA_SHIPPING
GET_EASYSHIP_DOCUMENTS
GET_GST_MTR_B2B_CUSTOM
GET_VAT_TRANSACTION_DATA
SC_VAT_TAX_REPORT
Tutoriel : Obtenir l'autorisation d'accéder à des types de rapports restreints contenant des informations d'identification personnelle
-
The
getReportDocument
operation is considered a restricted operation only when a restricted report type is specified. Refer to the list of restricted report types. -
When calling the
createRestrictedDataToken
operation to get an RDT for thegetReportDocument
operation, the specified restricted resource can contain only a specific path, not a generic path. For definitions, refer to Terminology.
Conditions préalables
Pour suivre ce tutoriel, vous aurez besoin des éléments suivants :
-
Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
-
Approbation pour les rôles suivants :
- Expédition directe aux consommateurs. Obligatoire pour accéder aux informations relatives à l'adresse d'expédition.
- Versement de taxes. Obligatoire pour accéder aux informations de l'acheteur.
- Facturation fiscale. Obligatoire pour accéder aux informations de l'acheteur.
To request access to these roles, refer to Registering as a developer and update your developer profile.
Étape 1. Obtenir un RDT
- Call the
createRestrictedDataToken
operation, passing the following parameters:
Paramètres du corps :
Paramètre | Description | Obligatoire |
---|---|---|
restrictedResources | A list of restricted resources. Note: Growth in the number of restricted resources results in growth in the size of the resulting restricted data token. The maximum size of the restricted data token before encoding and encryption cannot exceed 7kb without risk of failure when the token is employed. When requesting multiple resources, make sure that the resources requested are valid for the selling partner account type. For example, if requesting an RDT token for a seller, do not include vendor specific APIs in the createRestrictedDataToken request call. Type: < RestrictedResource > array |
Exemple de demande
POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken
{
"restrictedResources": [
{
"method": "GET",
"path": "/reports/2021-06-30/documents/amzn1.spdoc.1.4.eu.dca0cb77-4733-4769-8476-f09bc32be2af.T1KIM200NIMFNU.1234"
}
]
}
Réponse
Une réponse réussie comprend les éléments suivants :
Nom | Description |
---|---|
restrictedDataToken | Un jeton de données restreint (RDT). Il s'agit d'un jeton d'accès de courte durée qui autorise les appels vers des opérations restreintes. Transmettez cette valeur avec x-amz-access-token en-tête lors des appels ultérieurs à ces ressources restreintes. La taille du RDT est relative au nombre de ressources restreintes spécifié dans la demande. La taille maximale du jeton de données restreint avant le codage et le cryptage ne peut pas dépasser 7 Ko sans risque de défaillance lorsque le jeton est utilisé. Type : chaîne |
expiresIn | Durée de vie du jeton de données restreint, en secondes. Type : entier |
Exemple de réponse
{
"restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR",
"expiresIn": 3600
}
- Enregistrez le
restrictedDataToken
valeur (le RDT) à fournir dans legetReportDocument
opération.
Tutoriel : obtenir l'autorisation d'accéder aux informations personnelles pour les commandes groupées
You can get an RDT that provides authorization to access Personally Identifiable Information (PII) for bulk orders. The dataElements
values that you specify (using the restrictedResources
parameter of the createRestrictedDataToken
operation) determine the type of restricted data that the RDT authorizes your application to access. In this tutorial we request an RDT that authorizes access to both buyer information and shipping address information.
Conditions préalables
Pour suivre ce tutoriel, vous aurez besoin des éléments suivants :
-
Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
-
Approbation pour les rôles suivants :
- Expédition directe aux consommateurs. Obligatoire pour accéder aux informations relatives à l'adresse d'expédition.
- Versement de taxes. Obligatoire pour accéder aux informations de l'acheteur.
- Facturation fiscale. Obligatoire pour accéder aux informations de l'acheteur.
To request access to these roles, refer to Registering as a developer and update your developer profile.
Étape 1. Obtenir un RDT
Appelez l'opération createRestrictedDataToken
pour obtenir un RDT.
- Call the
createRestrictedDataToken
operation, passing the following parameters:
Paramètres du corps :
Paramètre | Description | Obligatoire |
---|---|---|
restrictedResources
|
Liste de ressources restreintes. Remarque :
Type: < |
Oui |
Exemple de demande
POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken
{
"restrictedResources": [
{
"method": "GET",
"path": "/orders/v0/orders",
"dataElements": ["buyerInfo", "shippingAddress"]
}
]
}
Réponse
Une réponse réussie comprend les éléments suivants :
Nom | Description |
---|---|
restrictedDataToken
|
Jeton de données restreint (RDT). Il s'agit d'un jeton d'accès éphémère qui autorise les appels vers des opérations restreintes. Transmettez cette valeur avec l'en-tête La taille du RDT est relative au nombre de ressources restreintes spécifié dans la demande. La taille maximale du jeton de données restreint avant le codage et le chiffrement ne peut pas dépasser 7 Ko sans risque de défaillance lors de son utilisation. Type : chaîne |
expiresIn
|
Durée de vie du RDT, en secondes. Type : entier |
Exemple de réponse
{
"restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR",
"expiresIn": 3600
}
- Save the
restrictedDataToken
value (the RDT) to use in Step 2. Include the RDT with a call to thegetOrders
operation
Étape 2. Inclure le RDT dans un appel vers l'opération getOrders
getOrders
Call the getOrders
operation of the Orders API, specifying the appropriate parameters to filter for the orders that you want. Be sure to include the RDT from Step 1. Get an RDT in the x-amz-access-token
header of your call to getOrders
. Because you specified both buyerInfo
and shippingAddress
in Step 1. Get an RDT, your call to getOrders
is authorized to return both buyer information and shipping address information for each order. Had you specified only buyerInfo
in Step 1, getOrders
would be authorized to return only buyer information for each order. Had you specified only shippingAddress
in Step 1, getOrders
would be authorized to return only shipping address information for each order.
Tutoriel : obtenir l'autorisation d'accéder aux informations personnelles pour les articles d'une commande
Vous pouvez obtenir un RDT qui autorise l'accès aux informations personnelles identifiables (PII) pour les articles d'une commande spécifiée. Dans ce workflow, vous spécifiez dataElements
=buyerInfo
pour indiquer que le RDT autorisera votre application à accéder aux informations de l'acheteur pour les articles de la commande.
Conditions préalables
Pour suivre ce tutoriel, vous aurez besoin des éléments suivants :
-
Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
-
Approbation pour les rôles suivants :
- Versement de taxes
- Facturation fiscale
Depending on your use case, you might need approval for only one of these roles. To learn more about roles and request access, refer to Registering as a developer and update your developer profile.
Étape 1. Obtenir un D de commande
Vous avez besoin d'un ID de commande pour identifier une commande pour laquelle vous souhaitez obtenir des informations sur les articles. Vous avez également besoin d'un ID de commande pour obtenir un RDT qui autorise votre application à accéder aux informations de l'acheteur pour les articles de la commande. Vous pouvez utiliser l'opération getOrders
de l'API Commandes pour obtenir une liste des commandes, à partir de laquelle vous pouvez obtenir l'ID de la commande qui vous intéresse.
-
Call the
getOrders
operation of the Orders API, specifying the appropriate parameters to filter for the order that you want.L'opération renvoie les commandes correspondant à votre demande. Chaque commande comprend un ID de commande.
-
Parmi les commandes retournées, identifiez la commande pour laquelle vous souhaitez obtenir des informations sur les articles.
-
Save the order ID for the order that you want, to use in Step 2. Get an RDT and Step 3. Include the RDT with a call to the
getOrderItems
operation.
Étape 2. Obtenir un RDT
Call the createRestrictedDataToken
operation to get an RDT. In the path
property of the restrictedResources
parameter, include the order ID from Step 1. Get an order ID. In this workflow we will specify the buyerInfo
value of the dataElements
parameter. This indicates that the RDT should provide authorization to access PII for use cases such as tax and gift wrapping.
Appelez l'opération createRestrictedDataToken
pour obtenir un RDT.
- Call the
createRestrictedDataToken
operation, passing the following parameter:
Paramètres du corps :
Paramètre | Description | Obligatoire |
---|---|---|
restrictedResources
|
Liste de ressources restreintes. Remarque :
Type: < |
Oui |
Exemple de demande
POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken
{
"restrictedResources": [
{
"method": "GET",
"path": "/orders/v0/orders/123-1234567-1234567/orderItems",
"dataElements": ["buyerInfo"]
}
]
}
Réponse
Une réponse réussie comprend les éléments suivants :
Nom | Description |
---|---|
restrictedDataToken
|
Jeton de données restreint (RDT). Il s'agit d'un jeton d'accès éphémère qui autorise les appels vers des opérations restreintes. Transmettez cette valeur avec l'en-tête La taille du RDT est relative au nombre de ressources restreintes spécifié dans la demande. La taille maximale du jeton de données restreint avant le codage et le chiffrement ne peut pas dépasser 7 Ko sans risque de défaillance lors de son utilisation. Type : chaîne |
expiresIn
|
Durée de vie du RDT, en secondes. Type : entier |
Exemple de réponse
{
"restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR",
"expiresIn": 3600
}
- Save the
restrictedDataToken
value (the RDT) to use in Step 3. Include the RDT with a call thegetOrder
operation.
Étape 3. Inclure le RDT dans un appel vers l'opération getOrderItems
getOrderItems
Call the getOrderItems
operation of the Orders API, specifying the order ID that you identified in Step 1. Get an order ID. Be sure to include the RDT from Step 1 in the x-amz-access-token
header of your call to getOrderItems
.
Tutoriel : déléguer l'autorisation d'accéder aux informations personnelles
Vous pouvez déléguer l'autorisation d'appeler des opérations restreintes à une “application déléguée”, qui est une application qui exécute une fonction spécialisée pour un partenaire de vente (telle que des services d'expédition, de facturation fiscale ou de versement de taxes), mais qui n'est pas directement autorisée par le partenaire de vente. Vous déléguez l'autorisation ainsi en
- Calling the
createRestrictedDataToken
operation of the Tokens API (specifying the application ID of the delegatee application), - Obtenant un RDT dans la réponse
createRestrictedDataToken
, et - Transmettant le RDT à l'application déléguée.
The RDT authorizes the delegatee application to call restricted operations that return the PII required to perform functions on behalf of the selling partner. For definitions, refer to Terminology.
Conditions préalables
Pour suivre ce tutoriel, vous aurez besoin des éléments suivants :
-
Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
-
To have indicated in the App registration form that you want to delegate access to PII to another application. For instructions for updating the App registration form, refer to Registering your application. Indicate in the form the types of PII that you want to delegate.
-
ID d'une commande qui nécessite une fonction d'expédition ou fiscale.
-
Partenariat avec un développeur disposant d'une application déléguée.
-
ID de l'application déléguée.
-
Moyen sécurisé de transmettre un RDT et un ID de commande à une application déléguée.
In addition, the developer with the delegatee application in Step 3. The delegatee application calls the getOrder
operation will need to:
-
Register as a developer, requesting approval for the roles that are required to access buyer information and shipping address information. These are:
- Expédition directe aux consommateurs. Obligatoire pour accéder aux informations relatives à l'adresse d'expédition.
- Versement de taxes. Obligatoire pour accéder aux informations de l'acheteur.
- Facturation fiscale. Obligatoire pour accéder aux informations de l'acheteur.
For more information about roles, refer to Roles in the Selling Partner API.
Étape 1. Obtenir un RDT
Appelez l'opération createRestrictedDataToken
pour obtenir un RDT. Dans la propriété path
du paramètre restrictedResources
, incluez l'ID de la commande pour laquelle des informations personnelles sont requises. Dans ce workflow, nous allons spécifier à la fois les valeurs buyerInfo
et shippingAddress
du paramètre dataElements
. Cela indique que le RDT doit inclure l'autorisation d'accéder aux informations personnelles pour des cas d'utilisation tels que les fonctions fiscales et d'expédition. Dans votre propre workflow, il se peut que vous ne spécifiiez qu'une seule valeur, en fonction des informations personnelles requises pour votre cas d'utilisation.
- Call the
createRestrictedDataToken
operation, passing the following parameters:
Paramètres du corps :
Paramètre | Description | Obligatoire |
---|---|---|
restrictedResources
|
Liste de ressources restreintes. Remarque :
Type: < |
Oui |
targetApplication
|
ID de l'application cible à laquelle l'accès est délégué. Type : chaîne |
Non |
Exemple de demande
POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken
{
"restrictedResources": [
{
"method": "GET",
"path": "/orders/v0/orders/123-1234567-1234567",
"dataElements": ["buyerInfo", "shippingAddress"]
}
],
"targetApplication": "amzn1.sellerapps.app.target-application"
}
Réponse
Une réponse réussie comprend les éléments suivants :
Nom | Description |
---|---|
restrictedDataToken
|
Jeton de données restreint (RDT). Il s'agit d'un jeton d'accès éphémère qui autorise les appels vers des opérations restreintes. Transmettez cette valeur avec l'en-tête La taille du RDT est relative au nombre de ressources restreintes spécifié dans la demande. La taille maximale du jeton de données restreint avant le codage et le chiffrement ne peut pas dépasser 7 Ko sans risque de défaillance lors de son utilisation. Type : chaîne |
expiresIn
|
Durée de vie du RDT, en secondes. Type : entier |
Exemple de réponse
{
"restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR",
"expiresIn": 3600
}
- Enregistrez la valeur
restrictedDataToken
(le RDT) à fournir à l'application déléguée à l'étape suivante.
Étape 2. Transmettre le RDT et l'ID de commande à l'application déléguée
Transmettez en toute sécurité le RDT et l'ID de commande à l'application déléguée. L'application les utilisera pour appeler l'opération getOrder
à l'étape suivante.
Étape 3. L'application déléguée appelle l'opération getOrder
getOrder
The delegatee application calls the getOrder
operation of the Orders API, specifying in the path the order ID from Step 2. Pass the RDT and order ID to the delegatee application. The call must include the RDT (also from Step 2) in the x-amz-access-token
header of the call. Because both buyerInfo
and shippingAddress
were specified in Step 1. Get an RDT, the call to getOrder
returns both buyer information and shipping address information for the order.
- The delegatee application calls the
getOrder
operation, passing the following parameters:
Paramètres du corps :
Paramètre | Description | Obligatoire |
---|---|---|
orderId
|
Identifiant de commande défini par Amazon, au format 3-7-7. Type : chaîne |
Oui |
Exemple de demande
GET https://sellingpartnerapi-na.amazon.com/orders/v0/orders/123-1234567-1234567
Réponse
Une réponse réussie comprend les éléments suivants :
Nom | Description |
---|---|
payload
|
La charge utile de l'opération Type: Order |
Exemple de réponse
{
"payload": {
"AmazonOrderId": "902-3159896-1390916",
"PurchaseDate": "2017-01-20T19:49:35Z",
"LastUpdateDate": "2017-01-20T19:49:35Z",
"OrderStatus": "Pending",
"FulfillmentChannel": "SellerFulfilled",
"NumberOfItemsShipped": 0,
"NumberOfItemsUnshipped": 0,
"PaymentMethod": "Other",
"PaymentMethodDetails": [
"CreditCard",
"GiftCerificate"
],
"MarketplaceId": "ATVPDKIKX0DER",
"ShipmentServiceLevelCategory": "Standard",
"OrderType": "StandardOrder",
"EarliestShipDate": "2017-01-20T19:51:16Z",
"LatestShipDate": "2017-01-25T19:49:35Z",
"IsBusinessOrder": false,
"IsPrime": false,
"IsGlobalExpressEnabled": false,
"IsPremiumOrder": false,
"IsSoldByAB": false,
"DefaultShipFromLocationAddress": {
"Name": "MFNIntegrationTestMerchant",
"AddressLine1": "2201 WESTLAKE AVE",
"City": "SEATTLE",
"StateOrRegion": "WA",
"PostalCode": "98121-2778",
"CountryCode": "US",
"Phone": "+1 480-386-0930 ext. 73824",
"AddressType": "Commercial"
},
"FulfillmentInstruction": {
"FulfillmentSupplySourceId": "sampleSupplySourceId"
},
"IsISPU": false,
"ShippingAddress": {
"Name": "Michigan address",
"AddressLine1": "1 Cross St.",
"City": "Canton",
"StateOrRegion": "MI",
"PostalCode": "48817",
"CountryCode": "US"
},
"BuyerInfo": {
"BuyerEmail": "user@example.com",
"BuyerName": "John Doe",
"BuyerTaxInfo": {
"CompanyLegalName": "A Company Name"
},
"PurchaseOrderNumber": "1234567890123"
}
}
}
- L'application déléguée utilise les données de la réponse pour exécuter ses fonctions d'expédition et fiscales.
Tutoriel : obtenir l'autorisation d'accéder aux informations de plusieurs expéditions
Vous pouvez obtenir un RDT qui autorise l'obtention d'informations pour toutes les expéditions d'un partenaire de vente.
Conditions préalables
Pour suivre ce tutoriel, vous aurez besoin des éléments suivants :
-
Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
-
Approval for the Direct-to-consumer shipping role, which is required to access shipping address information. To request access to this role, refer to Registering as a developer and update your developer profile.
-
Identifiants des expéditions pour lesquelles vous souhaitez obtenir des informations.
Étape 1. Obtenir un RDT
Call the createRestrictedDataToken
operation to get an RDT. In the path
property of the restrictedResources
parameter that you specify, use a generic path that includes this text: {shipmentId}
. For definitions, refer to Terminology.
- Call the
createRestrictedDataToken
operation, passing the following parameter:
Paramètres du corps :
Paramètre | Description | Obligatoire |
---|---|---|
restrictedResources
|
Liste de ressources restreintes. Remarque :
Type: < |
Oui |
Exemple de demande
POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken
{
"restrictedResources": [
{
"method": "GET",
"path": "/mfn/v0/shipments/{shipmentId}"
}
]
}
Réponse
Une réponse réussie comprend les éléments suivants :
Nom | Description |
---|---|
restrictedDataToken
|
Jeton de données restreint (RDT). Il s'agit d'un jeton d'accès éphémère qui autorise les appels vers des opérations restreintes. Transmettez cette valeur avec l'en-tête La taille du RDT est relative au nombre de ressources restreintes spécifié dans la demande. La taille maximale du jeton de données restreint avant le codage et le chiffrement ne peut pas dépasser 7 Ko sans risque de défaillance lors de son utilisation. Type : chaîne |
expiresIn
|
Durée de vie du RDT, en secondes. Type : entier |
Exemple de réponse
{
"restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR",
"expiresIn": 3600
}
-
Save the
restrictedDataToken
value (the RDT) to use in Step 2. Include the RDT with a call thegetShipment
operation.For definitions, refer to Terminology.
Étape 2. Inclure le RDT dans un appel vers l'opération getShipment
getShipment
Call the getShipment
operation of the Merchant Fulfillment API, using the generic path that you specified in Step 1. Get an RDT and replacing {shipmentId}
with a real shipment ID from the selling partner. For example, GET /mfn/v0/shipments/FBA1234ABC5D
. Repeat this step for all of the shipments for which you want shipping information, specifying the appropriate shipment ID with each call. Each call must include the RDT from Step 1. Get an RDT in the x-amz-access-token
header.
Remarque
An RDT remains valid for one hour.
Tutoriel : Générer un SDK pour l'API Tokens
Vous trouverez les étapes à suivre pour générer un SDK pour l'API Tokens en Java ou C# à l'adresse suivante :
- Générez un SDK Java avec les jetons d'échange Se connecter avec votre compte Amazon
- Générer un SDK C# avec authentification et génération de jetons LWA
If you're using the Java SDK, you should also:
-
Courez
mvn package
dans le dossier SDK généré. -
Download any of the following files and use them to build classes inside the
main/java/sampleCode/
folder of the generated client library. For definitions, refer to Terminology.- RestrictedDataTokenWorkflow.java. For getting an RDT and using it to authorize your own application to call one or more restricted operations.
- DelegatedRestrictedDataTokenWorkflowForDelegator.java. For getting an RDT that delegates authorization to call restricted operations to a delegatee application.
- DelegatedRestrictedDataTokenWorkflowForDelegatee.java. For a delegatee application that receives an RDT from a delegator application and uses it for authorization to call restricted operations.
Utilisez la dernière version de l'API Tokens
Use the latest version of
tokens_2021-03-01.json
when generating your SDK to ensure that you are getting the latest functionality.
Updated 6 months ago