This guide provides instructions to help you get started with fabric Carts API, from initial setup to basic usage.

Target Audience

  • Third-party developers who set up Carts on behalf of merchants.
  • The fabric developers who work with Carts.

Knowledge and Skill Requirements

The target audience should:

  • Understand REST APIs, in the context of e-commerce.
  • Get familiar with fabric APIs.
  • Know the cart configuration and merge behaviors.
  • Have access to development tools capable of interacting with HTTP-based APIs, such as Postman or cURL for testing.

Workflow

The following steps outline the Carts process, from creating a cart to generating an order draft:

  1. Create an empty cart for shoppers to add products for purchase. You can customize the cart settings by sending configuration details in the request body. Otherwise, the default settings apply. For more information about cart configuration behaviors, see Configuration Behaviors section. If the initial request is successful, a response body containing cart information, such as cartId and configurations is returned.
  2. Create a destination address to fulfill the order in the cart. You can delete or update the address. If the initial request is successful, a response body that contains the address information is returned.
  3. Create all the necessary fulfillment information for the cart.
    You can partially update or delete fulfillment attributes, fully update fulfillments, or delete them entirely if needed. If the initial request is successful, a response body containing fulfillment information is returned.
  4. Add items to the cart.
    You can update or delete items in the cart. If the initial request is successful, a response body that contains the cart information, including the items that are added, is returned.
  5. (Optional) Apply any eligible coupons for the cart.
    Use remove the coupon endpoint to remove coupons if necessary. If the initial request is successful, a response body that contains the cart information, including the coupon information, is returned.
  6. Add tax rules for the cart. Look up the usage as tax rates vary by location. You must apply the appropriate taxes for each area.
    If the initial request is successful, a response body that contains cart information with the updated tax rates is returned.
  7. Add a payment method for the cart.
    You can partially update or delete payment attributes and fully update or delete payment methods entirely. If the initial request is successful, a response body containing payment information is returned.
  8. Create an order draft. If the payment is authorized, then the order is shipped.
    If the initial request is successful, the response containing all the necessary information for an order to ship is returned. Before submitting the order details, ensure that all the information for the order is correct.