> ## 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.

# Send a consumer's reconciliation data (hashed email).

> Stores data that lets PayLead reconcile the consumer with other data sources. Only the `email` key is supported: send the SHA-256 hash of the consumer's email address, never the address itself. Before hashing, remove all whitespace from the address and convert it to lowercase. A stored value is never overwritten: when the consumer already has one, the call answers `409` and keeps it. To change it, delete it first (`DELETE /perks/consumers/{consumer_id}/reconciliation/email`), then send the new one.



## OpenAPI

````yaml /program/api/openapi/2.0.0/perks/openapi.json post /perks/consumers/{consumer_id}/reconciliation
openapi: 3.1.0
info:
  description: |
    Paylead Program API.
    You can find complete documentation in https://docs.paylead.fr/
  license:
    name: Proprietary
    url: https://docs.paylead.fr/
  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:
  - name: Brands
    x-displayName: Brands
  - description: Routes used to query consumers resources
    name: Consumers
    x-displayName: Consumers
  - name: UPM
    x-displayName: UPM
  - name: KYC
    x-displayName: KYC
  - name: Offers
    x-displayName: Offers
  - name: Rewards
    x-displayName: Rewards
  - name: Segments
    x-displayName: Segments
  - name: Universes
    x-displayName: Universes
  - name: Voucher Orders
    x-displayName: Voucher Orders
paths:
  /perks/consumers/{consumer_id}/reconciliation:
    post:
      tags:
        - Consumers
      summary: Send a consumer's reconciliation data (hashed email).
      description: >-
        Stores data that lets PayLead reconcile the consumer with other data
        sources. Only the `email` key is supported: send the SHA-256 hash of the
        consumer's email address, never the address itself. Before hashing,
        remove all whitespace from the address and convert it to lowercase. A
        stored value is never overwritten: when the consumer already has one,
        the call answers `409` and keeps it. To change it, delete it first
        (`DELETE /perks/consumers/{consumer_id}/reconciliation/email`), then
        send the new one.
      operationId: perks__consumers__consumer_id__reconciliation__post
      parameters:
        - in: path
          name: consumer_id
          required: true
          schema:
            example: consumer-12345
            examples:
              - consumer-12345
            maxLength: 100
            minLength: 2
            pattern: ^[a-zA-Z0-9_-]+$
            title: Consumer Id
            type: string
        - examples:
            default:
              value: 2.0.0
          in: header
          name: x-api-version
          required: true
          schema:
            default: 2.0.0
            title: X-Api-Version
            type: string
      requestBody:
        content:
          application/json:
            schema:
              description: >-
                Reconciliation data: the format of `reconciliation_value`
                depends on `reconciliation_key`.
              discriminator:
                mapping:
                  email: '#/components/schemas/Perks_EmailReconciliationToCreateSchema'
                propertyName: reconciliation_key
              oneOf:
                - $ref: '#/components/schemas/Perks_EmailReconciliationToCreateSchema'
              title: Reconciliation
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Perks_ConsumerReconciliationSchema'
          description: The value is stored for the consumer.
        '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
        '404':
          content:
            application/json:
              examples:
                PL-404-02:
                  summary: Consumer Not Enrolled
                  value:
                    code: PL-404-02
                    status: 404
                    title: Consumer Not Enrolled
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              examples:
                PL-409-16:
                  summary: Reconciliation Already Exists
                  value:
                    code: PL-409-16
                    status: 409
                    title: Reconciliation Already Exists
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
components:
  schemas:
    Perks_EmailReconciliationToCreateSchema:
      properties:
        reconciliation_key:
          const: email
          description: 'Kind of reconciliation data: the consumer''s email address.'
          example: email
          examples:
            - email
          title: Reconciliation Key
          type: string
        reconciliation_value:
          description: >-
            SHA-256 hash of the consumer's email address, as 64 hexadecimal
            characters. Hash the address once all whitespace is removed and it
            is in lowercase: the example is the hash of `jane.doe@example.com`.
          example: 86e0b9e56c17cc4d12387e1949b85053fbe73bc3ce5a1188713a9d300cc6133d
          examples:
            - 86e0b9e56c17cc4d12387e1949b85053fbe73bc3ce5a1188713a9d300cc6133d
          pattern: ^[0-9a-fA-F]{64}$
          title: Reconciliation Value
          type: string
      required:
        - reconciliation_key
        - reconciliation_value
      title: EmailReconciliationToCreateSchema
      type: object
    Perks_ConsumerReconciliationSchema:
      properties:
        reconciliation_key:
          $ref: '#/components/schemas/Perks_ReconciliationKey'
          description: Kind of reconciliation data.
          example: email
          examples:
            - email
        reconciliation_value:
          description: >-
            Stored SHA-256 hash of the consumer's email address, in lowercase
            hexadecimal.
          example: 86e0b9e56c17cc4d12387e1949b85053fbe73bc3ce5a1188713a9d300cc6133d
          examples:
            - 86e0b9e56c17cc4d12387e1949b85053fbe73bc3ce5a1188713a9d300cc6133d
          title: Reconciliation Value
          type: string
      required:
        - reconciliation_key
        - reconciliation_value
      title: ConsumerReconciliationSchema
      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:
          description: Error code describing the issue
          example: PL-4XX-YY
          title: Code
          type: string
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          default: null
          description: A list of individual error occurrences found
          example:
            - loc:
                - body
                - field
              msg: Field required
              type: missing
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: A URI reference to the problematic resource
          example: api/resource/424242
          title: Instance
        status:
          description: HTTP code returned by the API
          example: 400
          title: Status
          type: integer
        title:
          description: Description of the issue
          example: The request was invalid.
          title: Title
          type: string
      required:
        - code
        - title
        - status
      title: ErrorResponse
      type: object
    Perks_ReconciliationKey:
      description: Kind of consumer data a program sends to reconcile its consumers.
      enum:
        - email
      example: email
      title: ReconciliationKey
      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

````