教程:检索采购订单号并将其传递给承运人
使用销售合作伙伴 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。
教程:使用订单 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
响应中的对象。有关响应负载示例,请参阅前面的步骤。
教程:使用报告 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. 下载报告
从您在上一步中找到的网址下载报告。
第 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.每次货件最多允许有五个包裹级别参考编号,标签上仅印有前两个参考编号。
-
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