トークンAPIユースケースガイド

制限付きデータトークンを使用して、販売パートナーAPIに安全にアクセスしてください。

API バージョン:2021-03-01

トークンAPIとは何ですか?

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.

権限の委任

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.

用語

  • 制限付きデータトークン(RDT)。有効期間の短いアクセストークンで、呼び出しが制限されているオペレーションを許可します。RDTは1時間有効です。

  • Restricted operation. An operation that returns restricted data, such as PII. You need an RDT to call a restricted operation.

  • 制限付きリソース。制限付きオペレーションを表すHTTPメソッドとパス。

  • Restricted report type. A report type that contains PII. Refer to Restricted report types.

  • 委任者アプリケーション。RDTを取得して受任者アプリケーションに渡すアプリケーション。出品パートナーは委任者アプリケーションを承認して操作します。

  • 受任者アプリケーション。委任者アプリケーションから渡されたRDTから制限付きオペレーションを呼び出す権限を取得するアプリケーション。受任者アプリケーションは、配送、税金請求、税金送金サービスなど、PIIを必要とする特殊な機能を実行し、出品パートナーが直接許可するものではありません。

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

制限付きオペレーション

制限付きオペレーションは、顧客の個人識別情報(PII)を返します。制限付きオペレーションを呼び出すにはRDTが必要です。

次のリストに、制限付きオペレーションをAPI別に示します。

出品者出荷注文API:

  • getOrders
  • getOrder

ダイレクト・フルフィルメント・オーダー API v2021-12-28

  • getOrders
  • getOrder

出品者出荷配送API:

  • getShippingLabel
  • getShippingLabels
  • getPackingSlip
  • getPackingSlips
  • getCustomerInvoice
  • getCustomerInvoices
  • createShippingLabels

ダイレクト・フルフィルメント・シッピング API v2021-12-28

  • getShippingLabel
  • getCustomerInvoices
  • getCustomerInvoice
  • getPackingSlips
  • getPackingSlip

Easy Ship API v2022-03-23

  • createScheduledPackageBulk

出品者出荷API:

  • getShipment
  • cancelShipment
  • cancelShipmentOld
  • createShipment

注文API:

  • getOrders
  • getOrder
  • getOrderItems
  • getOrderRegulatedInfo
  • getOrderAddress
  • getOrderBuyerInfo
  • getOrderItemsBuyerInfo

レポートAPI:

  • getReportDocument

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

出荷請求:

  • getShipmentDetails

配送API:

  • getShipment

制限付きレポートタイプ

制限付きレポートタイプにはPIIが含まれています。getReportDocumentオペレーションの呼び出しで制限付きレポートタイプを指定する場合は、呼び出しでRDTを渡す必要があります。

次のリストに、制限付きレポートタイプを示します。

  • 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

チュートリアル:PII 情報を含む制限付きレポートタイプにアクセスするための認証を取得

  • 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 the getReportDocument operation, the specified restricted resource can contain only a specific path, not a generic path. For definitions, refer to Terminology.

前提条件

このチュートリアルを完了するには、以下が必要です。

  • Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.

  • 以下の役割の承認:

    • 購入者への直送。配送先住所情報にアクセスするために必要です。
    • 税金送金。購入者情報にアクセスするために必要です。
    • 税金請求。購入者情報にアクセスするために必要です。

    To request access to these roles, refer to Registering as a developer and update your developer profile.

ステップ1:RDTを取得する

  1. Call the createRestrictedDataToken operation, passing the following parameters:

ボディのパラメーター:

パラメーター説明必須
restrictedResourcesA 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

リクエスト例

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

レスポンス

成功レスポンスには、以下が含まれます。

名前説明
restrictedDataToken制限付きデータトークン (RDT)。これは制限付き操作の呼び出しを許可する短期間のアクセストークンです。この値を次のコードに渡します。 x-amz-access-token これらの制限されたリソースを以降に呼び出すときのヘッダー。RDT のサイズは、リクエストで指定された制限付きリソースの数に比例します。制限付きデータトークンのエンコードおよび暗号化前の最大サイズは、トークンを使用する際に障害が発生しない限りは 7 KB を超えることはできません。タイプ:文字列
expiresIn制限付きデータトークンの有効期間 (秒単位)。タイプ:整数

レスポンスの例

{ "restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR", "expiresIn": 3600 }
  1. を保存 restrictedDataToken で入力する値 (RDT) getReportDocument オペレーション。

チュートリアル:一括注文のPIIにアクセスする権限を取得する

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.

前提条件

このチュートリアルを完了するには、以下が必要です。

  • Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.

  • 以下の役割の承認:

    • 購入者への直送。配送先住所情報にアクセスするために必要です。
    • 税金送金。購入者情報にアクセスするために必要です。
    • 税金請求。購入者情報にアクセスするために必要です。

    To request access to these roles, refer to Registering as a developer and update your developer profile.

ステップ1:RDTを取得する

createRestrictedDataTokenオペレーションを呼び出し、RDTを取得します。

  1. Call the createRestrictedDataToken operation, passing the following parameters:

ボディのパラメーター:

パラメーター 説明 必須
restrictedResources

制限付きリソースのリスト。

  1. 制限付きリソースの数が増えると、生成される制限付きデータトークンのサイズも拡大します。エンコードと暗号化を行う前の制限付きデータトークンの最大サイズは、トークンを使用する際に障害が発生しない限り、7 KBを超えることはできません。
  2. 複数のリソースをリクエストする場合は、リクエストしたリソースが出品パートナーのアカウントタイプで有効であることを確認してください。たとえば、販売者に RDT トークンをリクエストする場合は、ベンダー固有の API をリストに含めないでください。 createRestrictedDataToken コールをリクエストしてください。

Type: < RestrictedResource > array

はい

リクエストの例

POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken { "restrictedResources": [ { "method": "GET", "path": "/orders/v0/orders", "dataElements": ["buyerInfo", "shippingAddress"] } ] }

レスポンス

成功レスポンスには、以下が含まれます。

名前 説明
restrictedDataToken

制限付きデータトークン(RDT)。制限付きオペレーションの呼び出しを許可する、有効期間が短いアクセストークンです。制限付きリソースへの後続の呼び出しを行うときに、x-amz-access-tokenヘッダーでこの値を渡します。

RDTのサイズは、リクエストで指定された制限付きリソースの数を基準にしています。エンコードと暗号化を行う前の制限付きデータトークンの最大サイズは、トークンを使用する際に障害が発生しない限り、7 KBを超えることはできません。

タイプ:文字列

expiresIn

RDTの有効期間(秒単位)。

タイプ:整数

レスポンスの例

{ "restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR", "expiresIn": 3600 }
  1. Save the restrictedDataToken value (the RDT) to use in Step 2. Include the RDT with a call to the getOrders operation

ステップ2:getOrdersオペレーションの呼び出しでRDTを含める

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.

チュートリアル:注文に含まれる注文品目のPIIにアクセスする権限を取得する

特定の注文に含まれる注文品目の個人識別情報(PII)へのアクセスを許可するRDTを取得できます。このワークフローでは、dataElements=buyerInfoを指定し、注文品目の購入者情報にアプリケーションがアクセスすることをRDTが許可することを示します。

前提条件

このチュートリアルを完了するには、以下が必要です。

  • Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.

  • 以下の役割の承認:

    • 税金送金
    • 税金請求

    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:注文IDを取得する

注文品目情報が必要な注文を識別するには、注文IDが必要です。また、アプリケーションが注文品目の購入者情報にアクセスすることを許可するRDTを取得するにも、注文IDが必要です。注文APIのgetOrdersオペレーションを使用して注文のリストを取得し、そこから必要な注文の注文IDを取得できます。

  1. Call the getOrders operation of the Orders API, specifying the appropriate parameters to filter for the order that you want.

    このオペレーションでは、リクエストに一致する注文が返されます。各注文には注文IDが含まれます。

  2. 返された注文から、注文品目情報が必要な注文を特定します。

  3. 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: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.

createRestrictedDataTokenオペレーションを呼び出し、RDTを取得します。

  1. Call the createRestrictedDataToken operation, passing the following parameter:

ボディのパラメーター:

パラメーター 説明 必須
restrictedResources

制限付きリソースのリスト。

  1. 制限付きリソースの数が増えると、生成される制限付きデータトークンのサイズも拡大します。エンコードと暗号化を行う前の制限付きデータトークンの最大サイズは、トークンを使用する際に障害が発生しない限り、7 KBを超えることはできません。
  2. 複数のリソースをリクエストする場合は、リクエストするリソースが出品パートナーのアカウントタイプで有効であることを確認してください。たとえば、出品者のRDTトークンをリクエストする場合は、createRestrictedDataTokenリクエスト呼び出しにベンダー固有のAPIを含めないでください。

Type: < RestrictedResource > array

はい

リクエストの例

POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken { "restrictedResources": [ { "method": "GET", "path": "/orders/v0/orders/123-1234567-1234567/orderItems", "dataElements": ["buyerInfo"] } ] }

レスポンス

成功レスポンスには、以下が含まれます。

名前 説明
restrictedDataToken

制限付きデータトークン(RDT)。制限付きオペレーションの呼び出しを許可する、有効期間が短いアクセストークンです。制限付きリソースへの後続の呼び出しを行うときに、x-amz-access-tokenヘッダーでこの値を渡します。

RDTのサイズは、リクエストで指定された制限付きリソースの数を基準にしています。エンコードと暗号化を行う前の制限付きデータトークンの最大サイズは、トークンを使用する際に障害が発生しない限り、7 KBを超えることはできません。

タイプ:文字列

expiresIn

RDTの有効期間(秒単位)。

タイプ:整数

レスポンスの例

{ "restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR", "expiresIn": 3600 }
  1. Save the restrictedDataToken value (the RDT) to use in Step 3. Include the RDT with a call the getOrder operation.

ステップ3:getOrderItemsオペレーションの呼び出しでRDTを含める

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.

チュートリアル:PIIへのアクセス権限を委任する

制限付きオペレーションを呼び出す権限を「受任者アプリケーション」に委任できます。これは、配送、税金請求、税金送金サービスなどの特別な機能を出品パートナーのために実行するアプリケーションですが、出品パートナーが直接許可するものではありません。権限は、次のような方法で委任します。

  1. Calling the createRestrictedDataToken operation of the Tokens API (specifying the application ID of the delegatee application),
  2. createRestrictedDataTokenレスポンスからRDTを取得します。
  3. RDTを受任者アプリケーションに渡します。

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.

前提条件

このチュートリアルを完了するには、以下が必要です。

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

  • 受任者アプリケーションを使用する開発者とのパートナーシップ。

  • 受任者アプリケーションのアプリケーションID。

  • RDTと注文IDを受任者アプリケーションに送信する安全な手段。

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:

    • 購入者への直送。配送先住所情報にアクセスするために必要です。
    • 税金送金。購入者情報にアクセスするために必要です。
    • 税金請求。購入者情報にアクセスするために必要です。

    For more information about roles, refer to Roles in the Selling Partner API.

ステップ1:RDTを取得する

RDTを取得するには、createRestrictedDataTokenオペレーションを呼び出します。restrictedResourcesパラメーターのpathプロパティには、PIIが必要な注文の注文IDを含めます。このワークフローでは、dataElementsパラメーターのbuyerInfoshippingAddressの値を両方とも指定します。つまり、RDTには税金や配送などのユースケースでPIIにアクセスする権限を含める必要があるということです。独自のワークフローでは、ユースケースで必要なPIIに応じて、値を1つだけ指定してもかまいません。

  1. Call the createRestrictedDataToken operation, passing the following parameters:

ボディのパラメーター:

パラメーター 説明 必須
restrictedResources

制限付きリソースのリスト。

  1. 制限付きリソースの数が増えると、生成される制限付きデータトークンのサイズも拡大します。エンコードと暗号化を行う前の制限付きデータトークンの最大サイズは、トークンを使用する際に障害が発生しない限り、7 KBを超えることはできません。
  2. 複数のリソースをリクエストする場合は、リクエストするリソースが出品パートナーのアカウントタイプで有効であることを確認してください。たとえば、出品者のRDTトークンをリクエストする場合は、createRestrictedDataTokenリクエスト呼び出しにベンダー固有のAPIを含めないでください。

Type: < RestrictedResource > array

はい
targetApplication

アクセスを委任しているターゲットアプリケーションのアプリケーションID。

タイプ:文字列

いいえ

リクエストの例

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

レスポンス

成功レスポンスには、以下が含まれます。

名前 説明
restrictedDataToken

制限付きデータトークン(RDT)。制限付きオペレーションの呼び出しを許可する、有効期間が短いアクセストークンです。制限付きリソースへの後続の呼び出しを行うときに、x-amz-access-tokenヘッダーでこの値を渡します。

RDTのサイズは、リクエストで指定された制限付きリソースの数を基準にしています。エンコードと暗号化を行う前の制限付きデータトークンの最大サイズは、トークンを使用する際に障害が発生しない限り、7 KBを超えることはできません。

タイプ:文字列

expiresIn

RDTの有効期間(秒単位)。

タイプ:整数

レスポンスの例

{ "restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR", "expiresIn": 3600 }
  1. restrictedDataToken値(RDT)を保存し、次のステップで受任者アプリケーションに提供します。

ステップ2:RDTと注文IDを受任者アプリケーションに渡す

RDTと注文IDを受任者アプリケーションに安全に送信します。アプリケーションは、次のステップでgetOrderオペレーションを呼び出すときにこれを使用します。

ステップ3:受任者アプリケーションで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.

  1. The delegatee application calls the getOrder operation, passing the following parameters:

ボディのパラメーター:

パラメーター 説明 必須
orderId

Amazonが定義した注文識別子。3-7-7形式。

タイプ:文字列

はい

リクエストの例

GET https://sellingpartnerapi-na.amazon.com/orders/v0/orders/123-1234567-1234567

レスポンス

成功レスポンスには、以下が含まれます。

名前 説明
payload

getOrderオペレーションのペイロード。

Type: Order

レスポンスの例

{ "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" } } }
  1. 受任者アプリケーションは、レスポンス内のデータを使用して出荷と税の関数を実行します。

チュートリアル:複数の出荷の出荷情報にアクセスする権限を取得する

どの出品パートナーの出荷についても、出荷情報を取得する権限を与えるRDTを取得できます。

前提条件

このチュートリアルを完了するには、以下が必要です。

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

  • 出荷情報を取得する出荷の出荷ID。

ステップ1: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.

  1. Call the createRestrictedDataToken operation, passing the following parameter:

ボディのパラメーター:

パラメーター 説明 必須
restrictedResources

制限付きリソースのリスト。

  1. 制限付きリソースの数が増えると、生成される制限付きデータトークンのサイズも拡大します。エンコードと暗号化を行う前の制限付きデータトークンの最大サイズは、トークンを使用する際に障害が発生しない限り、7 KBを超えることはできません。
  2. 複数のリソースをリクエストする場合は、リクエストするリソースが出品パートナーのアカウントタイプで有効であることを確認してください。たとえば、出品者のRDTトークンをリクエストする場合は、createRestrictedDataTokenリクエスト呼び出しにベンダー固有のAPIを含めないでください。

Type: < RestrictedResource > array

はい

リクエストの例

POST https://sellingpartnerapi-na.amazon.com/tokens/2021-03-01/restrictedDataToken { "restrictedResources": [ { "method": "GET", "path": "/mfn/v0/shipments/{shipmentId}" } ] }

レスポンス

成功レスポンスには、以下が含まれます。

名前 説明
restrictedDataToken

制限付きデータトークン(RDT)。制限付きオペレーションの呼び出しを許可する、有効期間が短いアクセストークンです。制限付きリソースへの後続の呼び出しを行うときに、x-amz-access-tokenヘッダーでこの値を渡します。

RDTのサイズは、リクエストで指定された制限付きリソースの数を基準にしています。エンコードと暗号化を行う前の制限付きデータトークンの最大サイズは、トークンを使用する際に障害が発生しない限り、7 KBを超えることはできません。

タイプ:文字列

expiresIn

RDTの有効期間(秒単位)。

タイプ:整数

レスポンスの例

{ "restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR", "expiresIn": 3600 }
  1. Save the restrictedDataToken value (the RDT) to use in Step 2. Include the RDT with a call the getShipment operation.

    For definitions, refer to Terminology.

ステップ2:getShipmentオペレーションの呼び出しでRDTを含める

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.

📘

An RDT remains valid for one hour.

チュートリアル:トークン API 用の SDK の生成

Java または C# で Tokens API の SDK を生成する方法を説明する手順については、以下を参照してください。

If you're using the Java SDK, you should also:

  1. 実行 mvn package 生成された SDK フォルダー内。

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

🚧

トークン API の最新バージョンを使用する

Use the latest version of tokens_2021-03-01.json when generating your SDK to ensure that you are getting the latest functionality.


このページは役に立ちましたか?