---
title: "Validate the coupon code for a service"
method: POST
path: "/service/{serviceId}/validate-coupon"
tags: ["Service"]
---

# Validate the coupon code for a service

`POST /service/{serviceId}/validate-coupon`

## Headers

- `X-Fields` string, mask

## Request body

- CartCoupon
  - `code` string, required — Coupon code

## Response `200`

Success

- ValidateCartCouponDump
  - `clientId` integer — The unique client account ID.
  - `coupon` CartCouponDump
    - `accountApplicableCredit` boolean — Account applicable credit
    - `active` boolean — Coupon active
    - `allowOtherDiscounts` boolean, required — Allow other discounts
    - `applicableToOnSale` boolean — Applicable to on sale products
    - `canApplyCreditToCart` boolean — Can apply credit to cart
    - `clientIds` integer[] — Clients ids the coupon will be available
    - `code` string, required — Coupon code
    - `created` string, date-time
    - `customerEligibility` string, required — Coupon customer eligibility all|rules|specific
    - `customerEligibilityRules` string[] — Eligible client rules to use this coupon block_enterprise_client|block_reseller|block_partner|has_no_purchase|has_one_purchase|has_multiple_purchase|account_created_recently
    - `end` string, date — Coupon end date
    - `excludedProductIds` integer[] — Products ids the coupon will be excluded
    - `expireType` string, required — Coupon expire type first_billing_period|number_of_days|never_expire
    - `expireValue` integer — Coupon expire value
    - `extraData` CouponExtraData
      - `retentionDuration` integer — Duration ( depending on retentionDurationUnit ) due to retention during cancellation
      - `retentionDurationUnit` string — Duration unit (e.g., 'days', 'months') due to retention during cancellation
      - `retentionPriority` integer — Priority of the retention cancellation
      - `retentionTerms` string — Retention terms accepted during cancellation process
    - `hasEndDate` boolean, required — Set end date
    - `id` integer
    - `isPrivate` boolean — Is private
    - `isRetentionCoupon` boolean — Suggest on cancellation
    - `maxUsageLimit` integer — Coupon max uses
    - `maxUseSameCart` integer — Max use same cart
    - `maxUseSameCartUseType` string — Coupon max use same cart use type first_item|highest_price
    - `maximumPurchaseAmount` number — Maximum purchase requirement max
    - `minimumItemPurchaseAmount` number — Minimum item purchase requirement
    - `minimumPurchaseAmount` number — Minimum purchase requirement
    - `name` string, required — Coupon name
    - `productIds` integer[] — Products ids the coupon will be available
    - `serviceEligibility` string — Coupon service eligibility none|all
    - `start` string, date, required — Coupon start date
    - `type` string, required — Coupon type %|$|credit
    - `usageStatistics` CartCouponUsageStatisticsDump
      - `totalAbandonedCarts` integer — Coupon total abandoned carts
      - `totalAccountCredits` integer — Total of the coupon applied to accounts
      - `totalCarts` integer — Total of carts with coupon
      - `totalCompletedCarts` integer — Total of completed carts with coupon
      - `totalRemaining` integer — Coupon total remaining
      - `totalServices` integer — Total of the coupon applied to existing services
      - `totalUses` integer — Coupon total uses
    - `usageTypeLimit` string[] — Coupon usage type limit max_total|one_per_user|one_per_user_in_24_hours|one_per_service
    - `userLoginRequired` object
    - `value` number, required — Coupon value
  - `couponCode` string, required — The coupon code to validate.
  - `error` string — Error message if coupon is invalid.
  - `isValid` boolean — Whether the coupon is valid.

## Other responses

- `403` — You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission.
- `404` — Service not found

---

[API](https://skmtc.net/hivelocity/apis/hivelocity-api.md) · [All operations](https://skmtc.net/hivelocity/apis/hivelocity-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hivelocity/hivelocity-api/revisions/ee6b717b5015/schema)
