> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clearline.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate Coupon via Transaction

# Coupon Validation Endpoint

This endpoint validates coupons used with a specific POS transaction (applied to a purchase).

**POST** [https://apitest.clearline.me/pos/\{posSystemId}/coupon/validate/byTransaction](https://apitest.clearline.me/pos/\{posSystemId}/coupon/validate/byTransaction)

### Input request

```
{
  "sessionId": "string",
  "campaignId": "string",
  "transactionId": "string",
  "couponUser": {
    "firstName": "string",
    "lastName": "string",
    "gender": "string",
    "phone": "string",
    "email": "string"
  }
}
```

### Input parameters

| Field name    | Description                                                                                                                                                                             |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sessionId     | Coupon ID that needs to be validated.This parameter is used if we Validate a coupon that was issued to the Client (ID received from this enpoint: Get Customer Coupons)                 |
| campaignId    | Coupon ID that needs to be validated.This parameter is used if we Validate a coupon that was Active on current Location (ID received from this enpoint: Get Active Coupons By Location) |
| transactionId | Transaction ID to which this coupon was applied                                                                                                                                         |
| couponUser    | Customer Data block                                                                                                                                                                     |
| firstName     | Customer First name                                                                                                                                                                     |
| lastName      | Customer Last name                                                                                                                                                                      |
| gender        | Customer gender                                                                                                                                                                         |
| email         | Customer email                                                                                                                                                                          |
| phone         | Customer phone                                                                                                                                                                          |

### Response

```
{
  "posStatus": "Accepted",
  "data": {
    "externalSessionId": "string",
    "status": "string",
    "validationDate": "2025-07-28T16:52:54.696Z",
    "errorMessage": "string"
  }
}
```

### Response parameters

| Field name        | Description                                                                                               |
| ----------------- | --------------------------------------------------------------------------------------------------------- |
| posStatus         | Only "Accepted" POS can validate a Coupon (POS must be registered with CMC in order to use this endpoint) |
| data              | Data Block                                                                                                |
| externalSessionId | Coupon ID that was validated (external or internal, depends on the Coupon provider)                       |
| status            | Operation status                                                                                          |
| validationDate    | Coupon validation date                                                                                    |
| errorMessage      | Error message                                                                                             |
