This doc page has moved! You should be automatically redirected to the resources page for the eBay Fulfillment API. If you are not redirected automatically, follow this link to the Fulfillment API.

eBay Fulfillment APIVersion 1.2.0

Create a Shipping Fulfillment

POST /order/{orderId}/shipping_fulfillment

When you group an order's line items into one or more packages, each package requires a corresponding plan for handling, addressing, and shipping; this is a shipping fulfillment. For each package, execute this call once to generate a shipping fulfillment associated with that package.

Note: A single line item in an order can consist of multiple units of a purchased item, and one unit can consist of multiple parts or components. Although these components might be provided by the manufacturer in separate packaging, the seller must include all components of a given line item in the same package. Before using this call for a given package, you must determine which line items are in the package. If the package has been shipped, you should provide the date of shipment in the request. If not provided, it will default to the current date and time.

Input

See also Samples.

Resource URI (production)

POST https://api.ebay.com/sell/fulfillment/v1/order/{orderId}/shipping_fulfillment

URI parameters

Parameter Type Required? Meaning
orderId string Required The unique identifier of the order. This value was returned by the getOrders call in the orders.orderId field; for example, 170009092860-9849164007!140000000544476.


HTTP request headers

All requests made to eBay REST operations require you to provide the authorization HTTP header for authentication.
See HTTP request headers for details.



OAuth request scope

This request requires a user access token with the following scope:

https://api.ebay.com/oauth/api_scope/sell.fulfillment

See Getting Access Tokens for more information.



Payload model

The following lists all fields that could be included in the request.

{ /* ShippingFulfillmentDetails */
"lineItems": [
    { /* LineItemReference */
    "lineItemId": string,
    "quantity": integer
    }
    /* More LineItemReference nodes here */
  ],
"shippedDate": string,
"shippingCarrierCode": string,
"trackingNumber": string
}

Request field descriptions



Input Container/Field Type Occurrence Meaning
lineItems array of LineItemReference Required Contains a list of the line items (or their components) to which the fulfillment applies.
lineItems.lineItemId string Required The globally unique eBay-generated identifier of the line item.

Note: A single line item can consist of multiple units of a purchased item, and one unit can consist of multiple parts or components. Although these components might be provided by the manufacturer in separate packaging, the seller cannot distribute them among multiple shipping packages. Thus, each line item ID will appear in exactly one fulfillment.
lineItems.quantity integer Optional This field is reserved for internal or future use.
shippedDate string Optional The date and time that the fulfillment package was shipped.

Default: The current date and time.
shippingCarrierCode string Conditional The code identifying the shipping carrier for this fulfillment.

This field and the trackingNumber field are mutually dependent. If you include one, you must also include the other.

Note: The Trading API's ShippingCarrierCodeType enumeration contains the most current list of eBay shipping carrier codes and the countries served by each carrier. See ShippingCarrierCodeType.
trackingNumber string Conditional The tracking number provided by the shipping carrier for this fulfillment.

This field and the shippingCarrierCode field are mutually dependent. If you include one, you must also include the other.

Note: If you include trackingNumber (and shippingCarrierCode) in the request, the resulting fulfillment's ID (returned in the HTTP location code) is the tracking number. If you do not include the tracking number, the resulting fulfillment ID will default to an arbitrary number such as 999.

Output

See also Samples.

HTTP status codes

This call can return one of the following HTTP status codes. See the HTTP Status Code Registry for a complete overview of HTTP status codes.

Status Meaning
201 Created. The call also returns the following location code:

{ENV}/sell/fulfillment/v1/order/{ORDERID}/fulfillment/{FULFILLMENTID}

The ENV string is the HTTP path to the same eBay supported environment in which this call was issued. The ORDERID parameter is the unique identifier of the order addressed by this call; for example, 170009092860-9849164007!140000000544476. The FULFILLMENTID parameter identifies the newly created fulfillment; for example, 9405509699937003457459. Use this Get Fulfillment URI to retrieve the contents of the new fulfillment.
400 Bad Request
500 Internal Server Error.

Note: In some cases, this call may succeed if you issue it once more after receiving this error.

Payload model

This call has no response payload.



Error Codes

Code Domain Category Nature Meaning
30500 API_FULFILLMENT APPLICATION ERROR System error
32100 API_FULFILLMENT REQUEST ERROR Invalid order Id
32200 API_FULFILLMENT REQUEST ERROR Invalid line item id
32300 API_FULFILLMENT REQUEST ERROR Invalid shipment tracking number or carrier
32400 API_FULFILLMENT REQUEST ERROR Requested user is suspended
32500 API_FULFILLMENT REQUEST ERROR Invalid shipped date
32600 API_FULFILLMENT REQUEST ERROR Invalid input data



Samples

Note: Some item IDs, user IDs, or other data in these samples might no longer be active on eBay. If necessary, you can substitute current eBay data in your requests.

Sample: Create a Shipping Fulfillment

Generate a new shipping fulfillment for a set of line items in a specified order.

Description

This sample creates a new shipping fulfillment with an eBay-generated fulfillment ID, containing the specified line items.

Input

Use the orderid parameter to specify the order for which you are creating a shipping fulfillment. Identify the lineItems included in the package, as well as the shipping information if the package has been shipped.

URL format. See also the non-wrapped version of this URL.

POST https://api.ebay.com/sell/fulfillment/v1/order/6498414015!260000000562911/shipping_fulfillment
{
    "lineItems": [
        { 
          "lineItemId": "6254458011", 
          "quantity": 1 
        }
    ],
    "shippedDate": "2016-07-20T00:00:00.000Z",
    "shippingCarrierCode": "USPS",
    "trackingNumber": "910453194076740012"
} 

Output

A successful call returns an HTTP status code of 201 (Created). It also returns a location code for the newly created shipping fulfillment resource, including its fulfillment ID:

https://api.ebay.com/sell/fulfillment/v1/order/6498414015!260000000562911/shipping_fulfillment/1Z50992656936

JSON format.
This call has no response payload.



Change History

Change Date Description
1.0.0
2016-10-19
  • Call (added): New call.