チュートリアル:発注書番号を取得して配送業者に渡す
販売パートナーAPIを使用して発注書番号を取得し、UPS、FedEx、またはUSPSに渡します。
企業間 (B2B) 注文には通常、配送ラベルに注文番号が記載されています。セラーセントラルまたは出品パートナーAPIを使用して取得した配送ラベルには、自動的に発注書番号が含まれます。
If you get shipping labels from a source outside of Amazon, the shipping labels might not include the purchase order number. For these cases, you can get the purchase order number by using the Orders API or the Reports API of the Selling Partner API. You then pass the purchase order number to the carrier when you use the carrier's API.
これらのチュートリアルでは、発注書番号を取得し、その発注番号をUPS、FedEx、USPSに渡す方法を説明します。
チュートリアル:Orders API を使用して注文番号を取得する
The following tutorial shows how to retrieve a purchase order number by using the Orders API. For this method to work, the isBusinessOrder
field of the order must be true
.
ステップ1. getOrder
オペレーションを呼び出す
getOrder
オペレーションを呼び出すCall the getOrder
operation. Include the orderId
in the path.
ステップ 2:をチェックしてください。 IsBusinessOrder
フィールド
IsBusinessOrder
フィールドレスポンスで、次のことを確認してください IsBusinessOrder
フィールドは true
。もし、 IsBusinessOrder
フィールドは false
または存在しない場合、応答には発注書番号が含まれません。
次の例は、を含むレスポンスペイロードを示しています。 IsBusinessOrder
フィールドをに設定 true
。
"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"
],
"MarketplaceId": "ATVPDKIKX0DER",
"ShipmentServiceLevelCategory": "Standard",
"OrderType": "StandardOrder",
"EarliestShipDate": "2017-01-20T19:51:16Z",
"LatestShipDate": "2017-01-25T19:49:35Z",
"IsBusinessOrder": true,
"IsPrime": false,
"IsGlobalExpressEnabled": false,
"IsPremiumOrder": false,
"IsSoldByAB": false,
"IsIBA": false,
"DefaultShipFromLocationAddress": {
"Name": "TestMerchant",
"AddressLine1": "2201 WESTLAKE AVE",
"City": "SEATTLE",
"StateOrRegion": "WA",
"PostalCode": "98121-2778",
"CountryCode": "US",
"Phone": "+1 234-567-8910",
"AddressType": "Commercial"
},
"FulfillmentInstruction": {
"FulfillmentSupplySourceId": "sampleSupplySourceId"
},
"IsISPU": false,
"IsAccessPointOrder": false,
"ShippingAddress": {
"Name": "Michigan address",
"AddressLine1": "1 Main Street",
"City": "Canton",
"StateOrRegion": "MI",
"PostalCode": "48817",
"CountryCode": "US"
},
"BuyerInfo": {
"BuyerEmail": "user@example.com",
"BuyerName": "John Doe",
"BuyerTaxInfo": {
"CompanyLegalName": "A Company Name"
},
"PurchaseOrderNumber": "1234567890123"
},
"AutomatedShippingSettings": {
"HasAutomatedShippingSettings": false
}
}
ステップ 3:発注書番号を取得
発注書番号は PurchaseOrderNumber
のフィールド BuyerInfo
レスポンス内のオブジェクト。レスポンスペイロードの例については、前のステップを参照してください。
チュートリアル:Reports API を使用して発注書番号を取得する
The following tutorial shows how to retrieve a purchase order number by using the Reports API.
ステップ1. createReport
オペレーションを呼び出す
createReport
オペレーションを呼び出すCall the createReport
operation. Specify one of the following report types:
GET_FLAT_FILE_ORDER_REPORT_DATA_SHIPPING
GET_FLAT_FILE_ORDERS_RECONCILIATION_DATA_SHIPPING
GET_ORDER_REPORT_DATA_SHIPPING
ステップ 2:レポートが完成しているかどうかを確認してください。
Amazon SQS キューを定期的にポーリングして、 REPORT_PROCESSING_FINISHED
イベント:レポート処理が行われたときに情報を提供します CANCELLED
、 DONE
、または FATAL
。レポートデータがある場合、イベントには以下の値が含まれます。 reportDocumentId
フィールド。
For details, refer to Verify that Report Processing is Complete.
ステップ 3:レポートを入手
Call the getReportDocument
operation. Pass in the reportDocumentId
value from the previous step.
A successful response includes a url
that you can use to download the report. For details, refer to Retrieve a Report.
ステップ2:レポートをダウンロードする
前のステップで見つけた URL からレポートをダウンロードします。
ステップ 5:をチェックしてください。 IsBusinessOrder
フィールド
IsBusinessOrder
フィールドレポートで、次の点を確認してください。 IsBusinessOrder
フィールドは true
。もし、 IsBusinessOrder
フィールドは false
または存在しない場合、レポートには発注書番号が含まれていません。
次の例は、を含むレポートを示しています IsBusinessOrder
フィールドをに設定 true
。
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>A3912FIWOIVW91</MerchantIdentifier>
</Header>
<MessageType>OrderReport</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderReport>
<AmazonOrderID>123-4567-8910</AmazonOrderID>
<AmazonSessionID>12-13141516-171819</AmazonSessionID>
<OrderDate>2024-03-18T16:59:49-07:00</OrderDate>
<OrderPostedDate>2024-03-18T16:59:49-07:00</OrderPostedDate>
<BillingData>
<BuyerEmailAddress>7f032r5qjxxxxxx@marketplace.amazon.com</BuyerEmailAddress>
<BuyerName>John Doe</BuyerName>
<BuyerPhoneNumber>123-456-7891</BuyerPhoneNumber>
</BillingData>
<FulfillmentData>
<FulfillmentMethod>Ship</FulfillmentMethod>
<FulfillmentServiceLevel>Standard</FulfillmentServiceLevel>
<Address>
<Name>Denise Park</Name>
<AddressFieldOne>1 Main Street</AddressFieldOne>
<City>Bellevue</City>
<StateOrRegion>WI</StateOrRegion>
<PostalCode>53189-6553</PostalCode>
<CountryCode>US</CountryCode>
<PhoneNumber>+1 123-456-7891</PhoneNumber>
</Address>
</FulfillmentData>
<IsBusinessOrder>true</IsBusinessOrder>
<PurchaseOrderNumber>PO12345</PurchaseOrderNumber>
<Item>
<AmazonOrderItemCode>123456789</AmazonOrderItemCode>
<SKU>12-3456-789</SKU>
<Title>Marshmallows</Title>
<Quantity>2</Quantity>
<ProductTaxCode>A1_FB_CANDY17</ProductTaxCode>
<ItemPrice>
<Component>
<Type>Principal</Type>
<Amount currency="USD">20.90</Amount>
</Component>
<Component>
<Type>Shipping</Type>
<Amount currency="USD">0.00</Amount>
</Component>
<Component>
<Type>Tax</Type>
<Amount currency="USD">1.04</Amount>
</Component>
<Component>
<Type>ShippingTax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
</ItemPrice>
<ItemFees>
<Fee>
<Type>Commission</Type>
<Amount currency="USD">-1.68</Amount>
</Fee>
</ItemFees>
<SignatureConfirmationRecommended>false</SignatureConfirmationRecommended>
</Item>
</OrderReport>
</Message>
ステップ 6:発注書番号を取得
レポートでは、発注書番号は PurchaseOrderNumber
フィールド。レスポンスペイロードの例については、前のステップを参照してください。
チュートリアル:発注書番号を配送業者に渡す
次のチュートリアルでは、発注書番号を UPS、FedEx、および USPS に渡す方法を示します。
-
UPS: Call the UPS
Shipment
operation. In theReferenceNumber
array, include an element withCode
equal to"PO"
andValue
equal to the purchase order number.1回の出荷で許可されるパッケージレベルの参照番号は最大5つで、ラベルには最初の2つの参照番号のみが印刷されています。
-
FedEx: Call the FedEx
CreateShipment
operation. In therequestedShipment
object, in therequestedPackageLineItems
.customerReferences
array, include an element withcustomerReferenceType
equal to"P_O_NUMBER"
andvalue
equal to the purchase order number. For a list of customer reference types, refer to Customer Reference Types. -
USPS: Call the USPS eVS Label API. Use the
CustomerRefNo
field or theCustomerRefNo2
field to pass the purchase order number. Set thePrintCustomerRefNo
field totrue
.
Updated 27 days ago