Prerequisites
The following prerequisites must be completed sequentially to configure a fulfillment.- Create a cart.
- Create a destination address if the fulfillment type is
SHIP_TO
. - Create an origin address if the fulfillment type is
BOPIS
orROPIS
.
Fulfillment Initialization
After you create a cart with Create a cart, you will see the fulfillment resource in the cart response. The following code sample provides the structure of fulfillment object in a cart response:Click to expand the JSON example.
Click to expand the JSON example.
fulfillmentId
by making POST request to the {cartId}/fulfillments
endpoint.
The following code sample provides how the request is structured in a request payload:
POST Response
Click to expand the curl example.
Click to expand the curl example.
carts/{cartId}/fulfillments/{fulfillmentId}
endpoint.
The following code sample provides the structure of fulfillment object in the response:
Click to expand the JSON example.
Click to expand the JSON example.
Examples
Adding a fulfillment with a single cost to multiple items
-
Create a fulfillment curl.
Click to see fulfillment curl and response examples
Response -
Create multiple items with same fulfillment using the add items endpoint.
Click to expand
Adding a fulfillment with a custom cost to an item
-
Create a fulfillment curl.
Click to see the curl and the JSON response
Response: -
Add a custom cost to the item using the add item endpoint.
Click to see the curl and the JSON response
The example shows adding an additional $5.00 as the fulfillment cost for the item.price.fulfillments
accepts both the fulfillment cost and any additional fulfillment amount added to the item.Response:
Adding a fulfillment with the type BOPIS
or ROPIS
requires a locationId
Use the add fulfillment endpoint to add a location when creating a fulfillment as in the following example:
Click to see curl example.
Click to see curl example.
Adding the same destination address to different fulfillments for multiple items
Use the add fulfillment endpoint to create multiple fulfillment with the same addresses as in the following example:Click to see curl example.
Click to see curl example.