younifyd
Menu

Update Custom Discount For Cart Item

Update Custom Discount For Cart Item

PUT/v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}

Use it in a workflow

  1. Add a step and choose the Elastic Path connector.
  2. Pick the Update Custom Discount For Cart Item action (under Carts).
  3. Fill in the fields below, then reference the result from later steps as {{updateCustomDiscountForCartItem.response.data}}.

Request

Path parameters

cartIDstringrequired

Specifies the ID for the cart.

cartitemIDstringrequired

Specifies the ID for the cart item.

customdiscountIDstringrequired

Specifies the ID for the custom discount to be updated.

Request body

Enter the body as JSON in the step's Body field.

dataobject
amountobject3 fields
descriptionstring

Specifies a description for the custom discount.

discount_codestring

Specifies the discount code used for the custom discount.

discount_enginestring

Specifies from where the custom discount is applied. For example, Talon.one.

external_idstring

Specifies an external id for the custom discount.

typestring

Specifies the type of the resource. Always `custom_discount`.

idstring (uuid)

Specifies the UUID of the custom discount.

relationshipsobject1 fields

Relationships to other resources like cart items

json
{
  "data": {
    "amount": {
      "amount": 0,
      "currency": "string",
      "formatted": "string"
    },
    "description": "string",
    "discount_code": "string",
    "discount_engine": "string",
    "external_id": "string",
    "type": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "relationships": {
      "item": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "cart_item"
        }
      }
    }
  }
}

Response

Returns 200 with an object. Read it in later steps with {{updateCustomDiscountForCartItem.response.data.<field>}}.

dataobject
amountobjectrequired
descriptionstringrequired

Specifies a description for the custom discount.

discount_codestringrequired

Specifies the discount code used for the custom discount.

discount_enginestringrequired

Specifies from where the custom discount is applied. For example, Talon.one.

external_idstringrequired

Specifies an external id for the custom discount.

typestringrequired

Specifies the type of the resource. Always `custom_discount`.

idstring (uuid)

Specifies the UUID of the custom discount.

relationshipsobject1 fields

Relationships to other resources like cart items

json
{
  "data": {
    "amount": {},
    "description": "string",
    "discount_code": "string",
    "discount_engine": "string",
    "external_id": "string",
    "type": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "relationships": {
      "item": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "cart_item"
        }
      }
    }
  }
}

Need more? See the Elastic Path guide for connection setup and behaviour shared by every action.