Kod API'si Kullanım Senaryosu Rehberi
Satış Ortağı API'lerine güvenli erişim için Kısıtlanmış Veri Simgesini kullanın.
API Sürümü: 2021-03-01
Kodlar API'si nedir?
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.
Yetki verme
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.
Terminoloji
-
Kısıtlı Veri Kodu (RDT). Kısıtlı işlemlere yapılan çağrıları yetkilendiren kısa süreli bir erişim kodu. Bir RDT'nin geçerlilik süresi bir saattir.
-
Restricted operation. An operation that returns restricted data, such as PII. You need an RDT to call a restricted operation.
-
Kısıtlı kaynak. Kısıtlı bir işlemi temsil eden bir HTTP yöntemi ve yolu.
-
Restricted report type. A report type that contains PII. Refer to Restricted report types.
-
Yetki veren uygulama. Bir RDT alıp onu yetki verilen uygulamaya ileten uygulama. Yetki veren uygulama, satış ortağı tarafından yetkilendirilir ve satış ortağının etkileşimde bulunduğu uygulamadır.
-
Yetki verilen uygulama. Yetki veren bir uygulamanın kendisine ilettiği bir RDT ile kısıtlı işlemleri çağırma yetkisini alan uygulama. Kargo, vergi faturalandırma veya vergi ödeme hizmetleri gibi PII gerektiren özel işlevleri gerçekleştirir ve satış ortağı tarafından doğrudan yetkilendirilmez.
-
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
.
Kısıtlı işlemler
Kısıtlı işlemler, müşterilerin Kimliğini Tanımlayabilecek Bilgileri (PII) döndürür. Kısıtlı bir işleme çağrı yapmak için bir RDT gerekir.
API'ye göre gruplandırılmış kısıtlı işlemler listesi:
Doğrudan Gönderim Siparişleri API'si:
getOrders
getOrder
Doğrudan Gönderim Siparişleri API v2021-12-28
getOrders
getOrder
Doğrudan Gönderim Kargo API'si:
getShippingLabel
getShippingLabels
getPackingSlip
getPackingSlips
getCustomerInvoice
getCustomerInvoices
createShippingLabels
Doğrudan Gönderim Gönderim API'si v2021-12-28
getShippingLabel
getCustomerInvoices
getCustomerInvoice
getPackingSlips
getPackingSlip
Kolay Gönderim API'si v2022-03-23
createScheduledPackageBulk
Satıcıdan Gönderim API'si:
getShipment
cancelShipment
cancelShipmentOld
createShipment
Siparişler API'si:
getOrders
getOrder
getOrderItems
getOrderRegulatedInfo
getOrderAddress
getOrderBuyerInfo
getOrderItemsBuyerInfo
Raporlar API'si:
getReportDocument
Notlar
- 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.
Kargo Faturalandırması:
getShipmentDetails
Kargo API'si:
getShipment
Kısıtlı rapor türleri
Kısıtlı rapor türleri PII içerir. getReportDocument
işlemine yaptığınız bir çağrıda kısıtlı bir rapor türünü belirtecekseniz RDT'yi de iletmelisiniz.
Kısıtlı rapor türlerinin listesi:
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
Eğitim: PII bilgileriyle kısıtlanmış rapor türlerine erişmek için yetkilendirme alın
-
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.
Ön koşullar
Bu eğitici içeriği tamamlamak için şunlara ihtiyacınız olacak:
-
Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
-
Aşağıdaki roller için onay:
- Doğrudan tüketiciye gönderim. Teslimat adres bilgilerine erişmek için gerekir.
- Vergi ödemesi. Alıcı bilgilerine erişmek için gerekir.
- Vergi faturalandırması. Alıcı bilgilerine erişmek için gerekir.
To request access to these roles, refer to Registering as a developer and update your developer profile.
1. Adım: RDT alın
- Call the
createRestrictedDataToken
operation, passing the following parameters:
Gövde parametresi:
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
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 |
İstek Örneği
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"
}
]
}
Yanıt
Başarılı bir yanıtta aşağıdakiler yer alır:
Ad | Açıklama |
---|---|
restrictedDataToken | Kısıtlı Veri Simgesi (RDT). Bu, kısıtlı işlemlere yapılan çağrıları yetkilendiren kısa ömürlü bir erişim belirtecidir. Bu değeri ile iletin x-amz-access-token Bu kısıtlı kaynaklara sonraki çağrılar yaparken başlık. RDT'nin boyutu, istekte belirtilen kısıtlı kaynakların sayısına göredir. Kodlama ve şifrelemeden önce kısıtlanmış veri belirtecinin maksimum boyutu, belirteç kullanıldığında arıza riski olmadan 7 kb'yi geçemez. Tür: dize |
expiresIn | Kısıtlanmış Veri Simgesinin ömrü saniye cinsinden. Tür: tamsayı |
Yanıt Örneği
{
"restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR",
"expiresIn": 3600
}
- Kaydet
restrictedDataToken
içinde sağlamak için değer (RDT)getReportDocument
operasyon.
Eğitici İçerik: Toplu siparişlerde PII'ye erişme yetkisi alın
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.
Ön koşullar
Bu eğitici içeriği tamamlamak için şunlara ihtiyacınız olacak:
-
Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
-
Aşağıdaki roller için onay:
- Doğrudan tüketiciye gönderim. Teslimat adres bilgilerine erişmek için gerekir.
- Vergi ödemesi. Alıcı bilgilerine erişmek için gerekir.
- Vergi faturalandırması. Alıcı bilgilerine erişmek için gerekir.
To request access to these roles, refer to Registering as a developer and update your developer profile.
1. Adım: RDT alın
RDT almak için createRestrictedDataToken
işlemini çağırın.
- Call the
createRestrictedDataToken
operation, passing the following parameters:
Gövde parametresi:
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
restrictedResources
|
Kısıtlı kaynakların listesi. Not:
Type: < |
Evet |
İstek örneği
POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken
{
"restrictedResources": [
{
"method": "GET",
"path": "/orders/v0/orders",
"dataElements": ["buyerInfo", "shippingAddress"]
}
]
}
Yanıt
Başarılı bir yanıtta aşağıdakiler yer alır:
Ad | Açıklama |
---|---|
restrictedDataToken
|
Kısıtlı Veri Kodu (RDT). Kısıtlı işlemlere yapılan çağrıları yetkilendiren kısa süreli bir erişim kodudur. Bu kısıtlı kaynaklara yapacağınız sonraki çağrılarda RDT'nin boyutu, istekte belirtilen kısıtlı kaynakların sayısıyla ilişkilidir. Kodlama ve şifreleme öncesinde kısıtlı veri kodunun boyutu, kod kullanılırken hata riski olmaması için en fazla 7 kb olabilir. Tür: dize |
expiresIn
|
RDT'nin saniye cinsinden geçerlilik süresi. Tür: tam sayı |
Yanıt örneği
{
"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
2. Adım: RDT'yi, getOrders
işlemine yapılan çağrıya dahil edin
getOrders
işlemine yapılan çağrıya dahil edinCall 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.
Eğitici içerik: Bir siparişteki ürünlerle ilgili PII'ye erişmek için yetkilendirme alın
Belirli bir siparişteki ürünlerle ilgili Kimliği Tanımlayabilecek Bilgilere (PII) erişim yetkisi veren bir RDT alabilirsiniz. Bu iş akışında, RDT'nin uygulamanıza siparişteki ürünlere ilişkin alıcı bilgilerine erişme yetkisi vereceğini belirtmek için dataElements
=buyerInfo
değerini girersiniz.
Ön koşullar
Bu eğitici içeriği tamamlamak için şunlara ihtiyacınız olacak:
-
Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
-
Aşağıdaki roller için onay:
- Vergi havalesi
- Vergi faturalandırması
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.
1. Adım: Sipariş kimliği alın
Ürün bilgilerini istediğiniz siparişi tanımlamak için sipariş kimliğine ihtiyacınız vardır. Ayrıca uygulamanıza, sipariş ürünlerine ilişkin alıcı bilgilerine erişme yetkisi veren bir RDT almak için de sipariş kimliğine ihtiyacınız vardır. İhtiyacınız olan sipariş kimliğini alabileceğiniz sipariş listesini görmek için Siparişler API'sindeki getOrders
işlemini kullanabilirsiniz.
-
Call the
getOrders
operation of the Orders API, specifying the appropriate parameters to filter for the order that you want.İşlem, isteğinizle eşleşen siparişleri döndürür. Her siparişte bir sipariş kimliği bulunur.
-
Döndürülen siparişler arasından ürün bilgilerini istediğiniz siparişi tanımlayın.
-
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.
2. Adım: RDT alın
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.
RDT almak için createRestrictedDataToken
işlemini çağırın.
- Call the
createRestrictedDataToken
operation, passing the following parameter:
Gövde parametresi:
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
restrictedResources
|
Kısıtlı kaynakların listesi. Not:
Type: < |
Evet |
İstek örneği
POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken
{
"restrictedResources": [
{
"method": "GET",
"path": "/orders/v0/orders/123-1234567-1234567/orderItems",
"dataElements": ["buyerInfo"]
}
]
}
Yanıt
Başarılı bir yanıtta aşağıdakiler yer alır:
Ad | Açıklama |
---|---|
restrictedDataToken
|
Kısıtlı Veri Kodu (RDT). Kısıtlı işlemlere yapılan çağrıları yetkilendiren kısa süreli bir erişim kodudur. Bu kısıtlı kaynaklara yapacağınız sonraki çağrılarda RDT'nin boyutu, istekte belirtilen kısıtlı kaynakların sayısıyla ilişkilidir. Kodlama ve şifreleme öncesinde kısıtlı veri kodunun boyutu, kod kullanılırken hata riski olmaması için en fazla 7 kb olabilir. Tür: dize |
expiresIn
|
RDT'nin saniye cinsinden geçerlilik süresi. Tür: tam sayı |
Yanıt örneği
{
"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.
3. Adım: RDT'yi, getOrderItems
işlemine yapılan çağrıya dahil edin
getOrderItems
işlemine yapılan çağrıya dahil edinCall 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
.
Eğitici içerik: PII'ye erişim yetkisi verin
Kısıtlı işlemleri çağırma yetkisini, satış ortağı için özel işlev (kargo, vergi faturalandırması veya vergi havalesi hizmetleri gibi) gerçekleştiren ancak satış ortağının doğrudan yetkilendirmediği "yetki verilen uygulamaya" verebilirsiniz. Yetki vermek için aşağıdaki işlemleri yapın:
- Calling the
createRestrictedDataToken
operation of the Tokens API (specifying the application ID of the delegatee application), createRestrictedDataToken
yanıtından RDT alın ve- RDT'yi, yetki verilen uygulamaya iletin.
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.
Ön koşullar
Bu eğitici içeriği tamamlamak için şunlara ihtiyacınız olacak:
-
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.
-
Kargo veya vergi işlevini gerektiren bir siparişin kimliği.
-
Yetki verilen uygulamanın geliştiricisiyle iş ortaklığı.
-
Yetki verilen uygulamanın kimliği.
-
RDT'nin ve sipariş kimliğinin yetki verilen uygulamaya iletileceği güvenli bir yöntem.
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:
- Doğrudan tüketiciye gönderim. Teslimat adres bilgilerine erişmek için gerekir.
- Vergi ödemesi. Alıcı bilgilerine erişmek için gerekir.
- Vergi faturalandırması. Alıcı bilgilerine erişmek için gerekir.
For more information about roles, refer to Roles in the Selling Partner API.
1. Adım: RDT alın
RDT almak için createRestrictedDataToken
işlemini çağırın. restrictedResources
parametresinin path
özelliğine PII'nin gerektiği siparişin kimliğini ekleyin. Bu iş akışında dataElements
parametresini buyerInfo
ve shippingAddress
değerlerini belirteceğiz. Bu sayede RDT'nin vergi ve kargo gibi kullanım senaryoları için PII'ye erişim yetkisini içermesi gerektiği gösterilir. Kendi iş akışınızda, kullanım senaryosunun gerektirdiği PII'ye bağlı olarak yalnızca bir değer de belirtebilirsiniz.
- Call the
createRestrictedDataToken
operation, passing the following parameters:
Gövde parametreleri:
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
restrictedResources
|
Kısıtlı kaynakların listesi. Not:
Type: < |
Evet |
targetApplication
|
Erişim yetkisinin verildiği hedef uygulamanın kimliği. Tür: dize |
Hayır |
İstek örneği
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"
}
Yanıt
Başarılı bir yanıtta aşağıdakiler yer alır:
Ad | Açıklama |
---|---|
restrictedDataToken
|
Kısıtlı Veri Kodu (RDT). Kısıtlı işlemlere yapılan çağrıları yetkilendiren kısa süreli bir erişim kodudur. Bu kısıtlı kaynaklara yapacağınız sonraki çağrılarda RDT'nin boyutu, istekte belirtilen kısıtlı kaynakların sayısıyla ilişkilidir. Kodlama ve şifreleme öncesinde kısıtlı veri kodunun boyutu, kod kullanılırken hata riski olmaması için en fazla 7 kb olabilir. Tür: dize |
expiresIn
|
RDT'nin saniye cinsinden geçerlilik süresi. Tür: tam sayı |
Yanıt örneği
{
"restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR",
"expiresIn": 3600
}
- Aşağıdaki adımda yetki verilen uygulamaya sağlamak için
restrictedDataToken
değerini (RDT) kaydedin.
2. Adım: RDT'yi ve sipariş kimliğini yetki verilen uygulamaya iletin
RDT ve sipariş kimliğini güvenli bir şekilde yetki verilen uygulamaya iletin. Uygulama, aşağıdaki adımda getOrder
işlemine çağrı yaparken bu bilgileri kullanacaktır.
3. Adım: Yetki verilen uygulama getOrder
işlemini çağırır
getOrder
işlemini çağırırThe 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:
Gövde parametreleri:
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
orderId
|
3-7-7 biçiminde Amazon tanımlı bir sipariş tanımlayıcı. Tür: dize |
Evet |
İstek örneği
GET https://sellingpartnerapi-na.amazon.com/orders/v0/orders/123-1234567-1234567
Yanıt
Başarılı bir yanıtta aşağıdakiler yer alır:
Ad | Açıklama |
---|---|
payload
|
Type: Order |
Yanıt örneği
{
"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"
}
}
}
- Yetki verilen uygulama, kargo ve vergi işlevlerini yürütmek için yanıtta yer alan verileri kullanır.
Eğitici İçerik: Birden fazla kargonun kargo bilgilerine erişme yetkisi alın
Satış ortaklarınızın kargolarının bilgilerini alma yetkisi veren bir RDT alabilirsiniz.
Ön koşullar
Bu eğitici içeriği tamamlamak için şunlara ihtiyacınız olacak:
-
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.
-
Kargo bilgilerini almak istediğiniz kargoların kargo kimlikleri.
1. Adım: RDT alın
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:
Gövde parametreleri:
Parametre | Açıklama | Zorunlu mu? |
---|---|---|
restrictedResources
|
Kısıtlı kaynakların listesi. Not:
Type: < |
Evet |
İstek örneği
POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken
{
"restrictedResources": [
{
"method": "GET",
"path": "/mfn/v0/shipments/{shipmentId}"
}
]
}
Yanıt
Başarılı bir yanıtta aşağıdakiler yer alır:
Ad | Açıklama |
---|---|
restrictedDataToken
|
Kısıtlı Veri Kodu (RDT). Kısıtlı işlemlere yapılan çağrıları yetkilendiren kısa süreli bir erişim kodudur. Bu kısıtlı kaynaklara yapacağınız sonraki çağrılarda RDT'nin boyutu, istekte belirtilen kısıtlı kaynakların sayısıyla ilişkilidir. Kodlama ve şifreleme öncesinde kısıtlı veri kodunun boyutu, kod kullanılırken hata riski olmaması için en fazla 7 kb olabilir. Tür: dize |
expiresIn
|
RDT'nin saniye cinsinden geçerlilik süresi. Tür: tam sayı |
Yanıt örneği
{
"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.
2. Adım: RDT'yi, getShipment
işlemine yapılan çağrıya dahil edin
getShipment
işlemine yapılan çağrıya dahil edinCall 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.
Not
An RDT remains valid for one hour.
Eğitim: Token API'si için bir SDK oluşturma
Java veya C#'da Token API'si için SDK'nın nasıl oluşturulacağını açıklayan adımları aşağıda bulabilirsiniz:
- LWA token değişimi ile bir Java SDK oluşturun
- LWA kodu oluşturma ve kimlik doğrulaması yoluyla C# SDK oluşturma
If you're using the Java SDK, you should also:
-
Koş
mvn package
oluşturulan SDK klasörünün içinde. -
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.
Tokens API'sinin en son sürümünü kullanın
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