Tutorial: Recuperar y pasar un número de orden de compra a un transportista

Usa la API de socio vendedor para recuperar y transferir un número de orden de compra a UPS, FedEx o USPS.

Los pedidos de empresa a empresa (B2B) suelen incluir números de orden de compra en las etiquetas de envío. Las etiquetas de envío que recuperas a través de Seller Central o mediante la API de socios vendedores incluyen automáticamente el número de pedido de compra.

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.

Estos tutoriales muestran cómo obtener el número de orden de compra y, a continuación, pasarlo a UPS, FedEx y USPS.

Tutorial: Recuperar un número de orden de compra mediante la API de pedidos

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.

Paso 1. Llamar a la operación getOrder

Call the getOrder operation. Include the orderId in the path.

Paso 2. Compruebe el IsBusinessOrder campo

En la respuesta, compruebe si IsBusinessOrder el campo es true. Si el IsBusinessOrder el campo es false o está ausente, la respuesta no incluye el número de la orden de compra.

El siguiente ejemplo muestra una carga útil de respuesta que contiene el IsBusinessOrder campo establecido en 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 } }

Paso 3. Obtenga el número de orden de compra

El número de la orden de compra se encuentra en PurchaseOrderNumber campo en el BuyerInfo objeto en la respuesta. Consulta el paso anterior para ver un ejemplo de la carga útil de una respuesta.

Tutorial: Recuperar un número de orden de compra mediante la API de informes

The following tutorial shows how to retrieve a purchase order number by using the Reports API.

Paso 1. Llamar a la operación 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

Paso 2. Compruebe si el informe está terminado

Sondee periódicamente la cola de Amazon SQS para ver si REPORT_PROCESSING_FINISHED evento, que proporciona información cuando se procesa el informe CANCELLED, DONE, o FATAL. Si los datos del informe están disponibles, el evento incluye un valor para reportDocumentId campo.

For details, refer to Verify that Report Processing is Complete.

Paso 3. Obtenga el informe

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.

Paso 2. Descargar el informe

Descarga el informe desde la URL que encontraste en el paso anterior.

Paso 5. Compruebe el IsBusinessOrder campo

En el informe, compruebe si el IsBusinessOrder el campo es true. Si el IsBusinessOrder el campo es false o está ausente, el informe no incluye el número de la orden de compra.

El siguiente ejemplo muestra un informe que contiene la IsBusinessOrder campo establecido en true.

<?xml version="1.0" encoding="UTF-8"?> <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>

Paso 6. Obtenga el número de la orden de compra

En el informe, el número de la orden de compra se encuentra en PurchaseOrderNumber campo. Consulta el paso anterior para ver un ejemplo de carga útil de respuesta.

Tutorial: Pasar un número de orden de compra a un transportista

El siguiente tutorial muestra cómo pasar el número de orden de compra a UPS, FedEx y USPS.

  • UPS: Call the UPS Shipment operation. In the ReferenceNumber array, include an element with Code equal to "PO" and Value equal to the purchase order number.

    Se permite un máximo de cinco números de referencia a nivel de paquete por envío y solo los dos primeros números de referencia están impresos en la etiqueta.

  • FedEx: Call the FedEx CreateShipment operation. In the requestedShipment object, in the requestedPackageLineItems.customerReferences array, include an element with customerReferenceType equal to "P_O_NUMBER" and value 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 the CustomerRefNo2 field to pass the purchase order number. Set the PrintCustomerRefNo field to true.


¿Te ha ayudado esta página?