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

# Enroll a consumer into the perks program (accept CGU).



## OpenAPI

````yaml /program/api/openapi/2.0.0/perks/openapi.json post /perks/consumers
openapi: 3.1.0
info:
  description: |
    Paylead Program API.
    You can find complete documentation in https://docs.paylead.com/
  license:
    name: Proprietary
    url: https://docs.paylead.com/
  title: Perks
  version: 2.0.0
servers:
  - description: Sandbox
    url: https://api-{programRef}.sandbox.paylead.tech
    variables:
      programRef:
        default: changeme
        description: Program reference provided by Paylead
security:
  - oauth2: []
tags:
  - description: Routes used to query consumers resources
    name: Consumers
    x-displayName: Consumers
  - name: UPM
    x-displayName: UPM
  - name: KYC
    x-displayName: KYC
  - name: Rewards
    x-displayName: Rewards
  - name: Segments
    x-displayName: Segments
  - name: Voucher Orders
    x-displayName: Voucher Orders
paths:
  /perks/consumers:
    post:
      tags:
        - Consumers
      summary: Enroll a consumer into the perks program (accept CGU).
      operationId: perks__consumers__post
      parameters:
        - examples:
            default:
              value: 2.0.0
          in: header
          name: x-api-version
          required: false
          schema:
            default: 2.0.0
            title: X-Api-Version
            type: string
        - in: header
          name: Authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Perks_ConsumerToCreateSchema'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Perks_CreatedConsumerSchema'
          description: Successful Response
        '400':
          content:
            application/json:
              example:
                code: PL-400-00
                errors:
                  - loc:
                      - body
                      - field
                    msg: Field required
                    type: missing
                instance: /path/of/the/request
                status: 400
                title: Bad Request
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              examples:
                PL-401-00:
                  summary: Unauthorized
                  value:
                    code: PL-401-00
                    status: 401
                    title: Unauthorized
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '409':
          content:
            application/json:
              examples:
                PL-409-09:
                  summary: Consumer Not Enrolled On Platform
                  value:
                    code: PL-409-09
                    status: 409
                    title: Consumer Not Enrolled On Platform
                PL-409-10:
                  summary: Consumer Already Enrolled
                  value:
                    code: PL-409-10
                    status: 409
                    title: Consumer Already Enrolled
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
components:
  schemas:
    Perks_ConsumerToCreateSchema:
      properties:
        extra_consents:
          default: []
          items:
            $ref: '#/components/schemas/Perks_PrivacyPolicyLevel'
          title: Extra Consents
          type: array
        id:
          maxLength: 100
          minLength: 2
          pattern: ^[a-zA-Z0-9_.-]*$
          title: Id
          type: string
        removed_consents:
          default: []
          items:
            $ref: '#/components/schemas/Perks_PrivacyPolicyLevel'
          title: Removed Consents
          type: array
      required:
        - id
      title: ConsumerToCreateSchema
      type: object
    Perks_CreatedConsumerSchema:
      properties:
        id:
          title: Id
          type: string
      required:
        - id
      title: CreatedConsumerSchema
      type: object
    ErrorResponse:
      additionalProperties: false
      description: >-
        An error response object (PayLead profile).


        Extension members (e.g. ``errors`` for validation) are allowed and
        serialised as

        top-level keys.
      properties:
        code:
          title: Code
          type: string
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          default: null
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Instance
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
      required:
        - code
        - title
        - status
      title: ErrorResponse
      type: object
    Perks_PrivacyPolicyLevel:
      enum:
        - BASIC
        - TRANSACTION_TRIGGERS
        - TARGETING
        - STATISTICS
        - SMART_RANKING
        - WEB_ANALYTICS
      title: PrivacyPolicyLevel
      type: string
  securitySchemes:
    oauth2:
      flows:
        clientCredentials:
          scopes:
            ALL: Full access to all resources (wildcard).
            LOYALTIES: Access to loyalties features.
            PERKS: Access to perks features.
            TX_INJECTION: Access to transaction sharing.
          tokenUrl: /tokens
      type: oauth2

````