Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Elastic Path Custom Discounts API

With custom discounts, you can allow your shoppers to apply discounts from external services to their purchases. To apply custom discounts to carts and cart items, you need to set `custom_discounts_enabled` field to `true` in your [Cart Settings](/docs/api/carts/put-v-2-settings-cart).You cannot add custom discounts to an empty cart.:::caution- You can apply up to five custom discounts to cart and cart item.- The stores that use [simple calculation method](/guides/How-To/Carts/calculate-totals) do not support custom discounts.:::

Elastic Path Custom Discounts API is one of 100 APIs that Elastic Path publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Custom Discounts. The published artifact set on APIs.io includes an OpenAPI specification and API documentation.

This API exposes 7 operations across 4 paths, and defines 13 schemas. It is described by OpenAPI 3.1.0, at version 25.1126.6886238.

Requests are made against 2 base URLs: https://useast.api.elasticpath.com, https://euwest.api.elasticpath.com.

7 operations 4 paths 13 schemas 3 DELETE2 POST2 PUT

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.1.0
API Version
25.1126.6886238
Base URL
https://useast.api.elasticpath.com
Authentication
HTTP Bearer
License
Resource Areas
1

Authentication & Security 1

Elastic Path Custom Discounts API declares 1 security scheme for authenticating requests. It accepts HTTP bearer tokens (BearerToken). By default, every request must be authenticated.

Paths & Operations 7

Across 4 paths, the API surfaces 7 operations — 3 DELETE, 2 POST, 2 PUT. Each is listed below with its method, path, parameters, and response codes.

Custom Discounts 7

With custom discounts, you can allow your shoppers to apply discounts from external services to their purchases. To apply custom discounts to carts and cart items, you need to set…

POST
/v2/carts/{cartID}/custom-discounts
Bulk Add Custom Discounts to Cart
bulkAddCustomDiscountsToCart 1 param body → 201400422
DELETE
/v2/carts/{cartID}/custom-discounts
Bulk Delete Custom Discounts From Cart
bulkDeleteCustomDiscountsFromCart 1 param → 204
PUT
/v2/carts/{cartID}/custom-discounts/{customdiscountID}
Update Custom Discount For Cart
updateCustomDiscountForCart 2 params body → 200
DELETE
/v2/carts/{cartID}/custom-discounts/{customdiscountID}
Delete Custom Discount From Cart
deleteCustomDiscountFromCart 2 params → 204
POST
/v2/carts/{cartID}/items/{cartitemID}/custom-discounts
Add Custom Discount To Cart Item
addCustomDiscountToCartItem 2 params body → 201400422
PUT
/v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}
Update Custom Discount For Cart Item
updateCustomDiscountForCartItem 3 params body → 200
DELETE
/v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}
Delete Custom Discount From Cart Item
deleteCustomDiscountFromCartItem 3 params → 204

Schemas 13

The contract defines 13 schemas that model the data the API accepts and returns. The most detailed are CartsCustomDiscountsResponseObject (8 properties), CartsCustomDiscountsObject (8 properties), Response.ErrorItem (5 properties), CartsBulkCustomDiscounts (2 properties). Each schema is shown below with its type and property counts.

CartsCustomDiscountsEntityResponse
object
1 property
CartsCustomDiscountsResponseObject
object
8 properties
CartsBulkCustomDiscountsResponse
object
2 properties
CustomDiscountRelationshipsCartItemRequest
object
1 property
CartsCustomDiscountsObject
object
8 properties 6 required
Response.ErrorResponse
object
1 property 1 required
CartsCustomDiscountsCollectionResponse
object
1 property
CartsCustomDiscountsEntityRequest
object
1 property
Response.ErrorItem
object
5 properties 2 required
CartsBulkCustomDiscounts
object
2 properties
AddAllOrNothingOptionsObject
object
1 property
CartsBulkCustomDiscountsCollectionResponse
object
2 properties
CartItemBulkCustomDiscountObject
object

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

elastic-path-custom-discounts-api-openapi.yml Raw ↑

Other APIs Elastic Path publishes across the network.

Elastic Path GraphQL API
Elastic Path Account Addresses API
Elastic Path Account Authentication Settings API
Elastic Path Account Cart Associations API
Elastic Path Account Management Authentication API
Elastic Path Account Members API
Elastic Path Account Membership API
Elastic Path Account Membership Settings API
Elastic Path Account Tags API
Elastic Path Accounts API
Elastic Path Administrator Latest Releases Catalog API API
Elastic Path Application Keys API