Remove discount code
Removes a previously applied discount code from the cart and recalculates
totals. The discount_code to remove is required in the body. Access is
scoped by the cart_token in the path — the endpoint itself does not
require authentication. In Fluid’s recommended server-side integration you
send a company bearer token (Authorization: Bearer <company_token>) on
every cart request; it is optional at the endpoint but drives cart
attribution and wallet resolution for companies using isolated payment
tokens (see the Headless Commerce guide). Returns 422 when the code is not
applied, 404 when the cart is not found, and 410 when the cart is
already completed.
curl --request DELETE \
--url https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount \
--header 'Content-Type: application/json' \
--data '
{
"discount_code": "<string>"
}
'import requests
url = "https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount"
payload = { "discount_code": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({discount_code: '<string>'})
};
fetch('https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'discount_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount"
payload := strings.NewReader("{\n \"discount_code\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount")
.header("Content-Type", "application/json")
.body("{\n \"discount_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"discount_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cart": {
"id": 123,
"cart_token": "<string>",
"state": "<string>",
"state_revision": 1,
"type": "<string>",
"email": "<string>",
"phone": "<string>",
"language_iso": "<string>",
"currency_code": "<string>",
"currency_symbol": "<string>",
"currency_decimal_places": 123,
"customer_id": 123,
"buyer_rep_id": 123,
"enrollment_pack_id": 123,
"processed": true,
"email_marketing": true,
"sms_marketing": true,
"cv_total": "<string>",
"qv_total": "<string>",
"amount_total": 123,
"sub_total": 123,
"tax_total": 123,
"shipping_total": 123,
"discount_total": 123,
"subtotal_after_discounts": 123,
"transaction_fee": 123,
"enrollment_fee": 123,
"inclusive_shipping_tax": 123,
"shipping_discount": 123,
"remaining_cart_amount_after_points": 123,
"amount_total_in_currency": "<string>",
"sub_total_in_currency": "<string>",
"tax_total_in_currency": "<string>",
"shipping_total_in_currency": "<string>",
"discount_total_in_currency": "<string>",
"subtotal_after_discounts_in_currency": "<string>",
"transaction_fee_in_currency": "<string>",
"enrollment_fee_in_currency": "<string>",
"customer_total_points_in_currency": "<string>",
"points_applied_amount_in_currency": "<string>",
"remaining_customer_points_amount_in_currency": "<string>",
"remaining_cart_amount_after_points_in_currency": "<string>",
"tax_total_for_display": "<string>",
"shipping_total_for_display": "<string>",
"tax_exempt": true,
"digital_only": true,
"immutable_items": true,
"points_enabled": true,
"price_inclusive_of_tax": true,
"requires_3ds": true,
"requires_payment_method": true,
"vault_without_charge": true,
"valid_for_checkout": true,
"valid_for_checkout_pre_payment": true,
"payment_method_auto_assignable": true,
"customer_total_points": 123,
"points_applied": 123,
"remaining_customer_points": 123,
"max_applicable_points": 123,
"total_creditable_points": 123,
"totals": {
"gross_subtotal": "<string>",
"gross_subtotal_in_currency": "<string>",
"net_subtotal": "<string>",
"net_subtotal_in_currency": "<string>",
"item_tax": "<string>",
"item_tax_in_currency": "<string>",
"shipping_net": "<string>",
"shipping_net_in_currency": "<string>",
"shipping_tax": "<string>",
"shipping_tax_in_currency": "<string>",
"total_tax": "<string>",
"total_tax_in_currency": "<string>",
"price_inclusive_of_tax": true,
"tax_label": "<string>"
},
"price_inclusive_tax_name": "<string>",
"payment_account": "<string>",
"discount_codes": [
"<string>"
],
"product_discount_codes": [
"<string>"
],
"shipping_discount_codes": [
"<string>"
],
"buyer_rep": {
"id": 123,
"email": "<string>",
"full_name": "<string>",
"image_url": "<string>",
"external_id": "<string>"
},
"volume_rep": {
"id": 123,
"email": "<string>",
"full_name": "<string>",
"image_url": "<string>"
},
"shipping_method": {
"id": "<string>",
"name": "<string>"
},
"discount_breakdown": {
"internal_discounts": 123,
"external_discounts": 123,
"total_discounts": 123
},
"available_shipping_methods": [
{
"id": 123,
"title": "<string>",
"price": 123,
"delivery_time_estimate": "<string>",
"price_label": "<string>"
}
],
"metadata": {},
"messages": "<string>",
"payment_method": {
"id": 123,
"type": "<string>",
"payment_method_type": "<string>",
"card_network": "<string>",
"last_four": "<string>",
"exp_month": "<string>",
"exp_year": "<string>",
"logo_url": "<string>",
"status": "<string>",
"affirm_id": "<string>",
"checkout_id": "<string>",
"created": "<string>",
"auth_expiration": "<string>",
"currency": "<string>",
"amount": 123,
"session_id": "<string>",
"intent": "<string>",
"customer_details": {}
},
"available_payment_methods": [
{
"id": 123,
"uuid": "<string>",
"type": "<string>",
"name": "<string>",
"image_url": "<string>",
"test": true,
"sandbox": true,
"customer_details_schema": {},
"collect_billing_address": true,
"supported_brands": [
"<string>"
],
"token_provider": "<string>",
"tokenize_path": "<string>",
"bogus_gateway": true,
"apple_pay": true,
"apple_pay_recurring_supported": true,
"apple_pay_merchant_identifier": "<string>",
"client_id": "<string>",
"merchant_id": "<string>",
"sdk_type": "<string>",
"decrypted_apple_pay_via_paypal": true,
"integration_key": "<string>"
}
],
"external_discount": {
"total": 123,
"calculated_at": "2023-11-07T05:31:56Z",
"sources": {}
},
"shipping_address": {
"name": "<string>",
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"subdivision_code": "<string>",
"phone": "<string>"
},
"billing_address": {
"name": "<string>",
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"subdivision_code": "<string>",
"phone": "<string>"
},
"items": [
{
"id": 123,
"title": "<string>",
"quantity": 123,
"price": 123,
"discount_amount": 123,
"tax": 123,
"cv": "<string>",
"qv": "<string>",
"cv_total": "<string>",
"qv_total": "<string>",
"total": 123,
"total_after_discounts": 123,
"enrollment_pack_id": 123,
"subscription": true,
"display_to_customer": true,
"image_url": "<string>",
"price_in_currency": "<string>",
"tax_in_currency": "<string>",
"discount_amount_in_currency": "<string>",
"total_in_currency": "<string>",
"total_after_discounts_in_currency": "<string>",
"line_total_in_currency": "<string>",
"line_total_after_discounts_in_currency": "<string>",
"unit_price_display_authoritative": true,
"free_item": true,
"allow_subscription": true,
"enrollment": true,
"creditable_points": 123,
"product_title": "<string>",
"subscription_plan_id": 123,
"subscription_only": true,
"subscription_interval": 123,
"subscription_interval_unit": "<string>",
"subscription_interval_unit_identifier": "<string>",
"subscription_price": 123,
"subscription_price_in_currency": "<string>",
"subscription_start": "<string>",
"subscribe_and_save": 123,
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>",
"metadata": {},
"errors": [
{}
],
"subscription_plans": [
{
"id": 123,
"name": "<string>",
"billing_interval": 123,
"billing_interval_unit": "<string>",
"billing_interval_unit_identifier": "<string>",
"billing_frequency_in_words": "<string>",
"shipping_interval": 123,
"shipping_interval_unit": "<string>",
"volume_interval": 123,
"volume_interval_unit": "<string>",
"trial_period": 123,
"trial_period_unit": "<string>",
"split_volume": true,
"allow_max_billing_cycles": true,
"max_billing_cycles": 123,
"savings_display_mode": "<string>",
"savings_label": "<string>",
"company_default": true,
"products_count": 123,
"subscribers_count": 123,
"price": 123,
"price_in_currency": "<string>",
"subscription_start": "2023-11-07T05:31:56Z",
"subscribe_and_save": 123,
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>"
}
],
"bundled_items": [
{
"variant_id": 123,
"product_id": 123,
"product_title": "<string>",
"variant_title": "<string>",
"option_titles": [
"<string>"
],
"quantity": 123,
"display_to_customer": true,
"product_bundle_group_id": 123,
"group_title": "<string>",
"price": 123,
"subscription": true,
"subscription_plan_id": 123
}
],
"product": {
"id": 123,
"title": "<string>",
"image_url": "<string>",
"image_path": "<string>",
"cv": "<string>",
"tax": 123,
"sku": "<string>",
"external_id": "<string>",
"canonical_url": "<string>",
"introduction": "<string>",
"price": 123,
"price_in_currency": "<string>",
"tax_in_currency": "<string>",
"subscription_price": 123,
"metadata": {},
"metafields": [
{
"id": 123,
"namespace": "<string>",
"key": "<string>",
"value": "<string>",
"value_type": "<string>",
"description": "<string>",
"owner_type": "<string>",
"owner_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"metafield_definition": {
"id": 123,
"company_id": 123,
"namespace": "<string>",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"value_type": "<string>",
"validation_rules": "<string>",
"owner_resource": "<string>",
"pinned": true,
"position": 123,
"locked": true,
"list_type": true,
"reference_type": true,
"supported_validations": [
"<string>"
],
"validation_description": "<string>",
"category_ids": [
123
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
],
"metafields_collection": [
{
"key": "<string>",
"value": "<string>"
}
],
"product_bundle_groups": [
{
"id": 123,
"title": "<string>",
"description": "<string>",
"group_type": "<string>",
"purpose": "<string>",
"min_selections": 123,
"max_selections": 123,
"selection_type": "<string>",
"pricing_config": {
"pricing_type": "<string>",
"fixed_price": 123,
"min_price": 123,
"hidden": true,
"country_pricing": [
{
"country_code": "<string>",
"enabled": true,
"price": "<string>",
"wholesale": "<string>",
"subscription_price": "<string>",
"wholesale_subscription_price": "<string>",
"points": "<string>",
"cv": 123,
"qv": 123,
"wholesale_cv": 123,
"wholesale_qv": 123
}
]
},
"allow_subscriptions": true,
"force_subscriptions": true,
"sort_order": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"images": [
{
"id": 123,
"image_url": "<string>",
"image_path": "<string>",
"position": 123,
"dam_asset_code": "<string>"
}
],
"bundle_group_items": [
{
"id": 123,
"quantity": 123,
"sort_order": 123,
"config": {
"price": 123,
"pc_price": 123,
"resolved_price": "<string>",
"resolved_wholesale_price": "<string>",
"resolved_cv": "<string>",
"resolved_qv": "<string>",
"resolved_wholesale_cv": "<string>",
"resolved_wholesale_qv": "<string>",
"cv": "<string>",
"qv": "<string>",
"pc_cv": "<string>",
"pc_qv": "<string>",
"is_default": true,
"quantity": 123,
"max_quantity": 123,
"allow_subscription": true,
"force_subscription": true,
"has_subscription_plans": true,
"subscription_plans": [
{
"id": 123,
"subscription_price_in_currency": "<string>",
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>",
"wholesale_subscription_price_in_currency": "<string>",
"wholesale_subscribe_and_save_in_currency": "<string>",
"wholesale_subscribe_and_save_for_display": "<string>"
}
],
"image_url": "<string>",
"available_country_codes": [
"<string>"
],
"country_prices": {}
},
"variant": {
"id": 123,
"title": "<string>",
"display_name": "<string>",
"image_url": "<string>",
"image_path": "<string>",
"sku": "<string>",
"primary_image": "<string>",
"price": 123,
"price_in_currency": "<string>",
"currency_code": "<string>",
"customer_limit": 123,
"active_variant_countries": [
"<string>"
],
"options": [
{
"title": "<string>",
"value": "<string>"
}
],
"product": {
"id": 123,
"title": "<string>",
"image_url": "<string>",
"image_path": "<string>",
"cv": "<string>",
"cv_in_currency": "<string>",
"tax": 123,
"tax_in_currency": "<string>",
"sku": "<string>",
"external_id": "<string>",
"canonical_url": "<string>",
"introduction": "<string>",
"price": 123,
"price_in_currency": "<string>",
"metadata": {}
}
}
}
]
}
]
},
"variant": {
"id": 123,
"title": "<string>",
"display_name": "<string>",
"image_url": "<string>",
"image_path": "<string>",
"sku": "<string>",
"primary_image": "<string>",
"price": 123,
"price_in_currency": "<string>",
"currency_code": "<string>",
"options": [
{
"title": "<string>",
"value": "<string>"
}
],
"physical": true,
"unit_of_size": "<string>",
"height": 123,
"width": 123,
"length": 123,
"unit_of_weight": "<string>",
"weight": "<string>",
"hs_code": "<string>"
}
}
],
"ship_to": {
"address1": "<string>",
"address2": null,
"address3": null,
"city": "<string>",
"country_code": "<string>",
"country_num_code": 123,
"default": true,
"id": 123,
"name": "<string>",
"phone": "<string>",
"postal_code": "<string>",
"state": "<string>",
"subdivision_code": null
},
"bill_to": {
"address1": "<string>",
"address2": null,
"address3": null,
"city": "<string>",
"country_code": "<string>",
"country_num_code": 123,
"default": true,
"id": 123,
"name": "<string>",
"phone": "<string>",
"postal_code": "<string>",
"state": "<string>",
"subdivision_code": null
},
"attribution": {
"id": 123,
"email": 123,
"fluid_rep_id": 123,
"external_id": 123,
"share_guid": 123,
"username": 123
},
"agreements": [
{
"id": 123,
"title": "<string>",
"show_at_checkout": true,
"default_checked": true,
"show_path": "<string>",
"enrollment_pack_id": 123,
"required": true
}
],
"country": {
"currency_code": "<string>",
"currency_symbol": "<string>",
"id": 123,
"iso": "<string>",
"iso3": "<string>",
"iso_name": "<string>",
"name": "<string>",
"price_inclusive_of_tax": true,
"price_inclusive_tax_name": "<string>",
"province_required": true,
"tax_enabled": true,
"tax_standard_rate": 123
},
"company": {
"bundle_subscriptions": true,
"checkout_primary_button_color": "<string>",
"checkout_primary_text_color": "<string>",
"checkout_secondary_button_color": "<string>",
"checkout_secondary_text_color": "<string>",
"collect_email_marketing": true,
"collect_phone": true,
"collect_sms_marketing": true,
"favicon_url": "<string>",
"fluid_shop": "<string>",
"id": 123,
"isolated_payment_tokens": true,
"kount_environment": "sandbox",
"kount_client_id": "150953359757648",
"logo_url": "<string>",
"name": "<string>",
"order_on_behalf": true,
"primary_domain_hostname": "<string>",
"require_billing_zip": true,
"require_phone": true,
"reward_points_apply_to_subtotal": true,
"reward_points_enabled": true,
"reward_points_label_singular": "<string>",
"reward_points_label_plural": "<string>",
"subdomain": "<string>"
},
"recurring": [
{
"subtotal": 123,
"subtotal_in_currency": "<string>",
"interval": 123,
"interval_unit": "<string>",
"interval_unit_identifier": "<string>",
"subtotal_for_display": "<string>",
"start_date": "<string>"
}
],
"enrollment_pack": {
"enrollment_pack_id": 123,
"slug": "<string>",
"token": "<string>",
"title": "<string>",
"description": "<string>",
"enrollment_fee": 123,
"additional_volume": 123,
"canonical_url": "<string>",
"enrollment_fee_in_currency": "<string>",
"price": "<string>",
"price_in_currency": "<string>",
"subscription_price": "<string>",
"subscription_price_in_currency": "<string>",
"images": [
{
"id": 123,
"external_id": "<string>",
"image_path": "<string>",
"image_url": "<string>",
"image_url_i18n": {},
"position": 123,
"relateable_id": 123,
"relateable_type": "<string>",
"uuid_v7": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"items": [
{
"id": 123,
"title": "<string>",
"quantity": 123,
"price": 123,
"tax": 123,
"cv": "<string>",
"qv": "<string>",
"cv_total": "<string>",
"qv_total": "<string>",
"cv_in_currency": "<string>",
"qv_in_currency": "<string>",
"total": 123,
"total_after_discounts": 123,
"enrollment_pack_id": 123,
"subscription": true,
"display_to_customer": true,
"price_in_currency": "<string>",
"tax_in_currency": "<string>",
"total_in_currency": "<string>",
"total_after_discounts_in_currency": "<string>",
"line_total_in_currency": "<string>",
"line_total_after_discounts_in_currency": "<string>",
"unit_price_display_authoritative": true,
"allow_subscription": true,
"enrollment": true,
"creditable_points": 123,
"product_title": "<string>",
"subscription_plan_id": 123,
"subscription_only": true,
"subscription_interval": 123,
"subscription_interval_unit": "<string>",
"subscription_interval_unit_identifier": "<string>",
"subscription_price": 123,
"subscription_price_in_currency": "<string>",
"subscription_start": "<string>",
"subscribe_and_save": 123,
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>",
"metadata": {},
"errors": [
{}
],
"subscription_plans": [
{
"id": 123,
"name": "<string>",
"billing_interval": 123,
"billing_interval_unit": "<string>",
"billing_interval_unit_identifier": "<string>",
"billing_frequency_in_words": "<string>",
"shipping_interval": 123,
"shipping_interval_unit": "<string>",
"volume_interval": 123,
"volume_interval_unit": "<string>",
"trial_period": 123,
"trial_period_unit": "<string>",
"split_volume": true,
"allow_max_billing_cycles": true,
"max_billing_cycles": 123,
"savings_display_mode": "<string>",
"savings_label": "<string>",
"company_default": true,
"products_count": 123,
"subscribers_count": 123,
"price": 123,
"price_in_currency": "<string>",
"subscription_start": "2023-11-07T05:31:56Z",
"subscribe_and_save": 123,
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>"
}
]
}
]
}
},
"meta": {
"shop_url": "<string>",
"checkout_url": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"totals_stale": true
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"shop_url": "<string>",
"cart": "<unknown>"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Path Parameters
Cart token
Body
Discount code to remove
Response
Success
Cart response wrapper (CartBlueprinter with_associations view). Scalar totals, flags, and points are strictly typed; genuinely dynamic fields (metadata, processor-specific payment payloads) and nested associations (items, addresses, country, company) are typed as open pockets and tightened in follow-up work.
curl --request DELETE \
--url https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount \
--header 'Content-Type: application/json' \
--data '
{
"discount_code": "<string>"
}
'import requests
url = "https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount"
payload = { "discount_code": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({discount_code: '<string>'})
};
fetch('https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'discount_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount"
payload := strings.NewReader("{\n \"discount_code\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount")
.header("Content-Type", "application/json")
.body("{\n \"discount_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/checkout/v2026-04/carts/{cart_token}/discount")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"discount_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cart": {
"id": 123,
"cart_token": "<string>",
"state": "<string>",
"state_revision": 1,
"type": "<string>",
"email": "<string>",
"phone": "<string>",
"language_iso": "<string>",
"currency_code": "<string>",
"currency_symbol": "<string>",
"currency_decimal_places": 123,
"customer_id": 123,
"buyer_rep_id": 123,
"enrollment_pack_id": 123,
"processed": true,
"email_marketing": true,
"sms_marketing": true,
"cv_total": "<string>",
"qv_total": "<string>",
"amount_total": 123,
"sub_total": 123,
"tax_total": 123,
"shipping_total": 123,
"discount_total": 123,
"subtotal_after_discounts": 123,
"transaction_fee": 123,
"enrollment_fee": 123,
"inclusive_shipping_tax": 123,
"shipping_discount": 123,
"remaining_cart_amount_after_points": 123,
"amount_total_in_currency": "<string>",
"sub_total_in_currency": "<string>",
"tax_total_in_currency": "<string>",
"shipping_total_in_currency": "<string>",
"discount_total_in_currency": "<string>",
"subtotal_after_discounts_in_currency": "<string>",
"transaction_fee_in_currency": "<string>",
"enrollment_fee_in_currency": "<string>",
"customer_total_points_in_currency": "<string>",
"points_applied_amount_in_currency": "<string>",
"remaining_customer_points_amount_in_currency": "<string>",
"remaining_cart_amount_after_points_in_currency": "<string>",
"tax_total_for_display": "<string>",
"shipping_total_for_display": "<string>",
"tax_exempt": true,
"digital_only": true,
"immutable_items": true,
"points_enabled": true,
"price_inclusive_of_tax": true,
"requires_3ds": true,
"requires_payment_method": true,
"vault_without_charge": true,
"valid_for_checkout": true,
"valid_for_checkout_pre_payment": true,
"payment_method_auto_assignable": true,
"customer_total_points": 123,
"points_applied": 123,
"remaining_customer_points": 123,
"max_applicable_points": 123,
"total_creditable_points": 123,
"totals": {
"gross_subtotal": "<string>",
"gross_subtotal_in_currency": "<string>",
"net_subtotal": "<string>",
"net_subtotal_in_currency": "<string>",
"item_tax": "<string>",
"item_tax_in_currency": "<string>",
"shipping_net": "<string>",
"shipping_net_in_currency": "<string>",
"shipping_tax": "<string>",
"shipping_tax_in_currency": "<string>",
"total_tax": "<string>",
"total_tax_in_currency": "<string>",
"price_inclusive_of_tax": true,
"tax_label": "<string>"
},
"price_inclusive_tax_name": "<string>",
"payment_account": "<string>",
"discount_codes": [
"<string>"
],
"product_discount_codes": [
"<string>"
],
"shipping_discount_codes": [
"<string>"
],
"buyer_rep": {
"id": 123,
"email": "<string>",
"full_name": "<string>",
"image_url": "<string>",
"external_id": "<string>"
},
"volume_rep": {
"id": 123,
"email": "<string>",
"full_name": "<string>",
"image_url": "<string>"
},
"shipping_method": {
"id": "<string>",
"name": "<string>"
},
"discount_breakdown": {
"internal_discounts": 123,
"external_discounts": 123,
"total_discounts": 123
},
"available_shipping_methods": [
{
"id": 123,
"title": "<string>",
"price": 123,
"delivery_time_estimate": "<string>",
"price_label": "<string>"
}
],
"metadata": {},
"messages": "<string>",
"payment_method": {
"id": 123,
"type": "<string>",
"payment_method_type": "<string>",
"card_network": "<string>",
"last_four": "<string>",
"exp_month": "<string>",
"exp_year": "<string>",
"logo_url": "<string>",
"status": "<string>",
"affirm_id": "<string>",
"checkout_id": "<string>",
"created": "<string>",
"auth_expiration": "<string>",
"currency": "<string>",
"amount": 123,
"session_id": "<string>",
"intent": "<string>",
"customer_details": {}
},
"available_payment_methods": [
{
"id": 123,
"uuid": "<string>",
"type": "<string>",
"name": "<string>",
"image_url": "<string>",
"test": true,
"sandbox": true,
"customer_details_schema": {},
"collect_billing_address": true,
"supported_brands": [
"<string>"
],
"token_provider": "<string>",
"tokenize_path": "<string>",
"bogus_gateway": true,
"apple_pay": true,
"apple_pay_recurring_supported": true,
"apple_pay_merchant_identifier": "<string>",
"client_id": "<string>",
"merchant_id": "<string>",
"sdk_type": "<string>",
"decrypted_apple_pay_via_paypal": true,
"integration_key": "<string>"
}
],
"external_discount": {
"total": 123,
"calculated_at": "2023-11-07T05:31:56Z",
"sources": {}
},
"shipping_address": {
"name": "<string>",
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"subdivision_code": "<string>",
"phone": "<string>"
},
"billing_address": {
"name": "<string>",
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"subdivision_code": "<string>",
"phone": "<string>"
},
"items": [
{
"id": 123,
"title": "<string>",
"quantity": 123,
"price": 123,
"discount_amount": 123,
"tax": 123,
"cv": "<string>",
"qv": "<string>",
"cv_total": "<string>",
"qv_total": "<string>",
"total": 123,
"total_after_discounts": 123,
"enrollment_pack_id": 123,
"subscription": true,
"display_to_customer": true,
"image_url": "<string>",
"price_in_currency": "<string>",
"tax_in_currency": "<string>",
"discount_amount_in_currency": "<string>",
"total_in_currency": "<string>",
"total_after_discounts_in_currency": "<string>",
"line_total_in_currency": "<string>",
"line_total_after_discounts_in_currency": "<string>",
"unit_price_display_authoritative": true,
"free_item": true,
"allow_subscription": true,
"enrollment": true,
"creditable_points": 123,
"product_title": "<string>",
"subscription_plan_id": 123,
"subscription_only": true,
"subscription_interval": 123,
"subscription_interval_unit": "<string>",
"subscription_interval_unit_identifier": "<string>",
"subscription_price": 123,
"subscription_price_in_currency": "<string>",
"subscription_start": "<string>",
"subscribe_and_save": 123,
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>",
"metadata": {},
"errors": [
{}
],
"subscription_plans": [
{
"id": 123,
"name": "<string>",
"billing_interval": 123,
"billing_interval_unit": "<string>",
"billing_interval_unit_identifier": "<string>",
"billing_frequency_in_words": "<string>",
"shipping_interval": 123,
"shipping_interval_unit": "<string>",
"volume_interval": 123,
"volume_interval_unit": "<string>",
"trial_period": 123,
"trial_period_unit": "<string>",
"split_volume": true,
"allow_max_billing_cycles": true,
"max_billing_cycles": 123,
"savings_display_mode": "<string>",
"savings_label": "<string>",
"company_default": true,
"products_count": 123,
"subscribers_count": 123,
"price": 123,
"price_in_currency": "<string>",
"subscription_start": "2023-11-07T05:31:56Z",
"subscribe_and_save": 123,
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>"
}
],
"bundled_items": [
{
"variant_id": 123,
"product_id": 123,
"product_title": "<string>",
"variant_title": "<string>",
"option_titles": [
"<string>"
],
"quantity": 123,
"display_to_customer": true,
"product_bundle_group_id": 123,
"group_title": "<string>",
"price": 123,
"subscription": true,
"subscription_plan_id": 123
}
],
"product": {
"id": 123,
"title": "<string>",
"image_url": "<string>",
"image_path": "<string>",
"cv": "<string>",
"tax": 123,
"sku": "<string>",
"external_id": "<string>",
"canonical_url": "<string>",
"introduction": "<string>",
"price": 123,
"price_in_currency": "<string>",
"tax_in_currency": "<string>",
"subscription_price": 123,
"metadata": {},
"metafields": [
{
"id": 123,
"namespace": "<string>",
"key": "<string>",
"value": "<string>",
"value_type": "<string>",
"description": "<string>",
"owner_type": "<string>",
"owner_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"metafield_definition": {
"id": 123,
"company_id": 123,
"namespace": "<string>",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"value_type": "<string>",
"validation_rules": "<string>",
"owner_resource": "<string>",
"pinned": true,
"position": 123,
"locked": true,
"list_type": true,
"reference_type": true,
"supported_validations": [
"<string>"
],
"validation_description": "<string>",
"category_ids": [
123
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
],
"metafields_collection": [
{
"key": "<string>",
"value": "<string>"
}
],
"product_bundle_groups": [
{
"id": 123,
"title": "<string>",
"description": "<string>",
"group_type": "<string>",
"purpose": "<string>",
"min_selections": 123,
"max_selections": 123,
"selection_type": "<string>",
"pricing_config": {
"pricing_type": "<string>",
"fixed_price": 123,
"min_price": 123,
"hidden": true,
"country_pricing": [
{
"country_code": "<string>",
"enabled": true,
"price": "<string>",
"wholesale": "<string>",
"subscription_price": "<string>",
"wholesale_subscription_price": "<string>",
"points": "<string>",
"cv": 123,
"qv": 123,
"wholesale_cv": 123,
"wholesale_qv": 123
}
]
},
"allow_subscriptions": true,
"force_subscriptions": true,
"sort_order": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"images": [
{
"id": 123,
"image_url": "<string>",
"image_path": "<string>",
"position": 123,
"dam_asset_code": "<string>"
}
],
"bundle_group_items": [
{
"id": 123,
"quantity": 123,
"sort_order": 123,
"config": {
"price": 123,
"pc_price": 123,
"resolved_price": "<string>",
"resolved_wholesale_price": "<string>",
"resolved_cv": "<string>",
"resolved_qv": "<string>",
"resolved_wholesale_cv": "<string>",
"resolved_wholesale_qv": "<string>",
"cv": "<string>",
"qv": "<string>",
"pc_cv": "<string>",
"pc_qv": "<string>",
"is_default": true,
"quantity": 123,
"max_quantity": 123,
"allow_subscription": true,
"force_subscription": true,
"has_subscription_plans": true,
"subscription_plans": [
{
"id": 123,
"subscription_price_in_currency": "<string>",
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>",
"wholesale_subscription_price_in_currency": "<string>",
"wholesale_subscribe_and_save_in_currency": "<string>",
"wholesale_subscribe_and_save_for_display": "<string>"
}
],
"image_url": "<string>",
"available_country_codes": [
"<string>"
],
"country_prices": {}
},
"variant": {
"id": 123,
"title": "<string>",
"display_name": "<string>",
"image_url": "<string>",
"image_path": "<string>",
"sku": "<string>",
"primary_image": "<string>",
"price": 123,
"price_in_currency": "<string>",
"currency_code": "<string>",
"customer_limit": 123,
"active_variant_countries": [
"<string>"
],
"options": [
{
"title": "<string>",
"value": "<string>"
}
],
"product": {
"id": 123,
"title": "<string>",
"image_url": "<string>",
"image_path": "<string>",
"cv": "<string>",
"cv_in_currency": "<string>",
"tax": 123,
"tax_in_currency": "<string>",
"sku": "<string>",
"external_id": "<string>",
"canonical_url": "<string>",
"introduction": "<string>",
"price": 123,
"price_in_currency": "<string>",
"metadata": {}
}
}
}
]
}
]
},
"variant": {
"id": 123,
"title": "<string>",
"display_name": "<string>",
"image_url": "<string>",
"image_path": "<string>",
"sku": "<string>",
"primary_image": "<string>",
"price": 123,
"price_in_currency": "<string>",
"currency_code": "<string>",
"options": [
{
"title": "<string>",
"value": "<string>"
}
],
"physical": true,
"unit_of_size": "<string>",
"height": 123,
"width": 123,
"length": 123,
"unit_of_weight": "<string>",
"weight": "<string>",
"hs_code": "<string>"
}
}
],
"ship_to": {
"address1": "<string>",
"address2": null,
"address3": null,
"city": "<string>",
"country_code": "<string>",
"country_num_code": 123,
"default": true,
"id": 123,
"name": "<string>",
"phone": "<string>",
"postal_code": "<string>",
"state": "<string>",
"subdivision_code": null
},
"bill_to": {
"address1": "<string>",
"address2": null,
"address3": null,
"city": "<string>",
"country_code": "<string>",
"country_num_code": 123,
"default": true,
"id": 123,
"name": "<string>",
"phone": "<string>",
"postal_code": "<string>",
"state": "<string>",
"subdivision_code": null
},
"attribution": {
"id": 123,
"email": 123,
"fluid_rep_id": 123,
"external_id": 123,
"share_guid": 123,
"username": 123
},
"agreements": [
{
"id": 123,
"title": "<string>",
"show_at_checkout": true,
"default_checked": true,
"show_path": "<string>",
"enrollment_pack_id": 123,
"required": true
}
],
"country": {
"currency_code": "<string>",
"currency_symbol": "<string>",
"id": 123,
"iso": "<string>",
"iso3": "<string>",
"iso_name": "<string>",
"name": "<string>",
"price_inclusive_of_tax": true,
"price_inclusive_tax_name": "<string>",
"province_required": true,
"tax_enabled": true,
"tax_standard_rate": 123
},
"company": {
"bundle_subscriptions": true,
"checkout_primary_button_color": "<string>",
"checkout_primary_text_color": "<string>",
"checkout_secondary_button_color": "<string>",
"checkout_secondary_text_color": "<string>",
"collect_email_marketing": true,
"collect_phone": true,
"collect_sms_marketing": true,
"favicon_url": "<string>",
"fluid_shop": "<string>",
"id": 123,
"isolated_payment_tokens": true,
"kount_environment": "sandbox",
"kount_client_id": "150953359757648",
"logo_url": "<string>",
"name": "<string>",
"order_on_behalf": true,
"primary_domain_hostname": "<string>",
"require_billing_zip": true,
"require_phone": true,
"reward_points_apply_to_subtotal": true,
"reward_points_enabled": true,
"reward_points_label_singular": "<string>",
"reward_points_label_plural": "<string>",
"subdomain": "<string>"
},
"recurring": [
{
"subtotal": 123,
"subtotal_in_currency": "<string>",
"interval": 123,
"interval_unit": "<string>",
"interval_unit_identifier": "<string>",
"subtotal_for_display": "<string>",
"start_date": "<string>"
}
],
"enrollment_pack": {
"enrollment_pack_id": 123,
"slug": "<string>",
"token": "<string>",
"title": "<string>",
"description": "<string>",
"enrollment_fee": 123,
"additional_volume": 123,
"canonical_url": "<string>",
"enrollment_fee_in_currency": "<string>",
"price": "<string>",
"price_in_currency": "<string>",
"subscription_price": "<string>",
"subscription_price_in_currency": "<string>",
"images": [
{
"id": 123,
"external_id": "<string>",
"image_path": "<string>",
"image_url": "<string>",
"image_url_i18n": {},
"position": 123,
"relateable_id": 123,
"relateable_type": "<string>",
"uuid_v7": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"items": [
{
"id": 123,
"title": "<string>",
"quantity": 123,
"price": 123,
"tax": 123,
"cv": "<string>",
"qv": "<string>",
"cv_total": "<string>",
"qv_total": "<string>",
"cv_in_currency": "<string>",
"qv_in_currency": "<string>",
"total": 123,
"total_after_discounts": 123,
"enrollment_pack_id": 123,
"subscription": true,
"display_to_customer": true,
"price_in_currency": "<string>",
"tax_in_currency": "<string>",
"total_in_currency": "<string>",
"total_after_discounts_in_currency": "<string>",
"line_total_in_currency": "<string>",
"line_total_after_discounts_in_currency": "<string>",
"unit_price_display_authoritative": true,
"allow_subscription": true,
"enrollment": true,
"creditable_points": 123,
"product_title": "<string>",
"subscription_plan_id": 123,
"subscription_only": true,
"subscription_interval": 123,
"subscription_interval_unit": "<string>",
"subscription_interval_unit_identifier": "<string>",
"subscription_price": 123,
"subscription_price_in_currency": "<string>",
"subscription_start": "<string>",
"subscribe_and_save": 123,
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>",
"metadata": {},
"errors": [
{}
],
"subscription_plans": [
{
"id": 123,
"name": "<string>",
"billing_interval": 123,
"billing_interval_unit": "<string>",
"billing_interval_unit_identifier": "<string>",
"billing_frequency_in_words": "<string>",
"shipping_interval": 123,
"shipping_interval_unit": "<string>",
"volume_interval": 123,
"volume_interval_unit": "<string>",
"trial_period": 123,
"trial_period_unit": "<string>",
"split_volume": true,
"allow_max_billing_cycles": true,
"max_billing_cycles": 123,
"savings_display_mode": "<string>",
"savings_label": "<string>",
"company_default": true,
"products_count": 123,
"subscribers_count": 123,
"price": 123,
"price_in_currency": "<string>",
"subscription_start": "2023-11-07T05:31:56Z",
"subscribe_and_save": 123,
"subscribe_and_save_in_currency": "<string>",
"subscribe_and_save_for_display": "<string>"
}
]
}
]
}
},
"meta": {
"shop_url": "<string>",
"checkout_url": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"totals_stale": true
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"shop_url": "<string>",
"cart": "<unknown>"
}
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}