> ## 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, by transaction

> Validates a coupon for a POS transaction.



## OpenAPI

````yaml /openapi.yaml post /pos/{posSystemId}/coupon/validate/byTransaction
openapi: 3.0.1
info:
  title: ClearLine POS API
  description: >-
    Point of Sale integration API for ClearLine Marketing Platform. This API
    enables POS systems to send transaction data, manage customer interactions,
    and integrate with marketing campaigns.
  version: v1
servers:
  - url: https://public-api-demo.clearline.me
    description: ClearLine API Server
security: []
paths:
  /pos/{posSystemId}/coupon/validate/byTransaction:
    post:
      tags:
        - Coupons
      summary: Validate coupon, by transaction
      description: Validates a coupon for a POS transaction.
      operationId: PosCoupon_ValidateTransactionCouponSession
      parameters:
        - name: posSystemId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        description: An instance of ClearLine.API.Dtos.ValidatePosTransactionCouponPostDto
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/ValidatePosTransactionCouponPostDto'
            example:
              sessionId: 9a19a987-7e0b-4bc2-8126-e92e3c6c7860
              campaignId: '12312'
              transactionId: e9762ba8-5571-4359-897e-b4e3002316b4
              couponUser:
                firstName: Test
                lastName: User
                gender: Male
                phone: '1111111111'
                email: mail@com.com
          application/json:
            schema:
              $ref: '#/components/schemas/ValidatePosTransactionCouponPostDto'
            example:
              sessionId: 9a19a987-7e0b-4bc2-8126-e92e3c6c7860
              campaignId: '12312'
              transactionId: e9762ba8-5571-4359-897e-b4e3002316b4
              couponUser:
                firstName: Test
                lastName: User
                gender: Male
                phone: '1111111111'
                email: mail@com.com
          text/json:
            schema:
              $ref: '#/components/schemas/ValidatePosTransactionCouponPostDto'
            example:
              sessionId: 9a19a987-7e0b-4bc2-8126-e92e3c6c7860
              campaignId: '12312'
              transactionId: e9762ba8-5571-4359-897e-b4e3002316b4
              couponUser:
                firstName: Test
                lastName: User
                gender: Male
                phone: '1111111111'
                email: mail@com.com
          application/*+json:
            schema:
              $ref: '#/components/schemas/ValidatePosTransactionCouponPostDto'
            example:
              sessionId: 9a19a987-7e0b-4bc2-8126-e92e3c6c7860
              campaignId: '12312'
              transactionId: e9762ba8-5571-4359-897e-b4e3002316b4
              couponUser:
                firstName: Test
                lastName: User
                gender: Male
                phone: '1111111111'
                email: mail@com.com
          application/xml:
            schema:
              $ref: '#/components/schemas/ValidatePosTransactionCouponPostDto'
            example:
              sessionId: 9a19a987-7e0b-4bc2-8126-e92e3c6c7860
              campaignId: '12312'
              transactionId: e9762ba8-5571-4359-897e-b4e3002316b4
              couponUser:
                firstName: Test
                lastName: User
                gender: Male
                phone: '1111111111'
                email: mail@com.com
          text/xml:
            schema:
              $ref: '#/components/schemas/ValidatePosTransactionCouponPostDto'
            example:
              sessionId: 9a19a987-7e0b-4bc2-8126-e92e3c6c7860
              campaignId: '12312'
              transactionId: e9762ba8-5571-4359-897e-b4e3002316b4
              couponUser:
                firstName: Test
                lastName: User
                gender: Male
                phone: '1111111111'
                email: mail@com.com
          application/*+xml:
            schema:
              $ref: '#/components/schemas/ValidatePosTransactionCouponPostDto'
            example:
              sessionId: 9a19a987-7e0b-4bc2-8126-e92e3c6c7860
              campaignId: '12312'
              transactionId: e9762ba8-5571-4359-897e-b4e3002316b4
              couponUser:
                firstName: Test
                lastName: User
                gender: Male
                phone: '1111111111'
                email: mail@com.com
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ValidateCouponSessionDtoPosApiResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateCouponSessionDtoPosApiResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ValidateCouponSessionDtoPosApiResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/ValidateCouponSessionDtoPosApiResponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/ValidateCouponSessionDtoPosApiResponse'
      security:
        - BearerAuth: []
        - ImplicitAuth: []
components:
  schemas:
    ValidatePosTransactionCouponPostDto:
      type: object
      properties:
        sessionId:
          type: string
          description: Coupon user session if exists
          nullable: true
        campaignId:
          type: string
          description: External coupon id
          nullable: true
        transactionId:
          type: string
          nullable: true
        couponUser:
          $ref: '#/components/schemas/CouponSessionUserGetDto'
      additionalProperties: false
      description: Validate pos coupon post dto
    ValidateCouponSessionDtoPosApiResponse:
      type: object
      properties:
        posStatus:
          $ref: '#/components/schemas/PosResponseStatus'
        data:
          $ref: '#/components/schemas/ValidateCouponSessionDto'
      additionalProperties: false
    CouponSessionUserGetDto:
      type: object
      properties:
        firstName:
          type: string
          description: User first name
          nullable: true
        lastName:
          type: string
          description: User last name
          nullable: true
        gender:
          type: string
          description: User gender
          nullable: true
        phone:
          type: string
          description: User phone number
          nullable: true
        email:
          type: string
          description: User email
          nullable: true
      additionalProperties: false
      description: Represent Coupon session user
    PosResponseStatus:
      enum:
        - Accepted
        - Disabled
        - NotAvailable
      type: string
    ValidateCouponSessionDto:
      type: object
      properties:
        externalSessionId:
          type: string
          description: External Coupon Session Id
          nullable: true
        status:
          type: string
          description: Coupon validation status
          nullable: true
        validationDate:
          type: string
          description: Validation date
          format: date-time
          nullable: true
        errorMessage:
          type: string
          description: Error message
          nullable: true
      additionalProperties: false
      description: Validate Coupon Session result Dto
  securitySchemes:
    BearerAuth:
      type: http
      description: |-

        JWT Authorization header using the Bearer scheme.

        Enter **_JWT Bearer token only_** in the text input below.
      scheme: bearer
      bearerFormat: JWT
    ImplicitAuth:
      type: oauth2
      description: Implicit scheme
      flows:
        implicit:
          authorizationUrl: https://logindemo.clearline.me/connect/authorize
          scopes:
            clearline_api: Grants access to Clearline API endpoints.

````