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

# Create Consumer

> 
Create a consumer by providing:
- its id (consumer_id)
- its levels of consent he wants to opt-in in addition to the implicit defined in current privacy policy (extra_levels).
- its levels of consent he wants to opt-out (removed_consents).
Multiple choices are allowed and possible choices are: TRANSACTION_TRIGGERS, TARGETING, STATISTICS, SMART_RANKING and WEB_ANALYTICS.
- its associated account ids under linked banks (banks).

You can choose any consumer ID you want, as long as it is not already used by an existing consumer in your
program.

If success, the route answers back with the new consumer ID.




## OpenAPI

````yaml /program/api/openapi/legacy/1.1.9/connector.json post /connectors/consumers
openapi: 3.0.2
info:
  description: >
    ## Welcome to PayLead API Documentation !

    With this documentation, we will help you go through the phases of

    basic implementation, and help you understand the basic steps to let you
    reach your objectives through our API.

    ## Versioning

    Our API supports versioning, so be sure to set the right version in the
    header, using the Client-Api-Version field :


    ex : X-Api-Version = 1.0.0

    ## Response code

    Our API returns standard HTTP response codes to indicate success or failure
    of the API requests. For

    errors, we also return a customized error message inside the JSON response.
    You can see the returned

    HTTP status codes below.


    |Code|Title|Description

    |------|------|------|

    |200|OK|Request successful

    |201|Created|Resource successfully created

    |204|No Content|Request successful with no content returned

    |400|Bad Request|Request was unacceptable

    |401|Unauthorised|API key provided is invalid

    |402|Request Failed|Valid parameters but the request failed

    |403|Forbidden|Access is forbidden.

    |404|Not Found|Resource does not exist

    |409|Conflict|The request could not be completed due to a conflict with the
    current state of the target resource

    |429|Too Many Requests|The user has sent too many requests in a given amount
    of time ("rate limiting").

    |500, 502, 503, 504|Server Errors|Something went wrong with the PayLead API


    ## Error handling

    In case of error our API returns errors based on JSON API principles,
    especially for 4xx errors.

    An error response contains an unique id which can be used for investigation.

    In addition, you will find a message explaining the error, a readable code
    and a meta object containing more details.


    You can see an example below.


    >> ~~~~

    >> {

    >>     'errors': {

    >>             'target_account': [

    >>                 {

    >>                 'code': 'FORMAT_ERROR',

    >>                 'message': 'Invalid IBAN; it should be 4-34 characters,
    only upper-case letters and digits.',

    >>                 'meta': {

    >>                     'value': 'SOME-INVALID-IBAN'

    >>                 }

    >>             }

    >>         ]

    >>     },

    >>     'id': '784db0c2-0e87-40d4-aa62-3e801135ccf7'

    >> }

    >> ~~~~

    ## Language — Content Negotiation

    If your program has been configured to support multiple languages, the API
    will respect the `Accept-Language` header as defined in
    [RFC7231](https://tools.ietf.org/html/rfc7231#section-5.3.5).


    For each incoming request, the best language will be selected by matching
    the list of languages accepted by the client with the list of languages
    supported by the program.


    For example, with a header of `Accept-Language: fr-FR,en-GB;q=0.8,en;q=0.3`:

      * If supported languages are `fr-FR, en-GB`, the best match is `fr-FR`;
      * If supported languages are `en-GB, fr-FR`, the best match is `fr-FR`;
      * If supported languages are `fr-BE, nl-BE`, the best match is `fr-BE`;
      * If supported languages are `it-IT, en-US`, the best match is `en-US`;
      * If supported languages are `de-CH, it-CH`, the best match is `de-CH`.


    The selected language will be exposed through the `Content-Language` header.


    *Note:* If some fields haven't been translated yet, they will be returned in
    the program's primary language.
  title: PayLead API
  version: 1.1.9
servers:
  - url: https://api.sandbox.paylead.tech
security:
  - ApiKeyAuth: []
paths:
  /connectors/consumers:
    post:
      tags:
        - User
      summary: Create Consumer
      description: >

        Create a consumer by providing:

        - its id (consumer_id)

        - its levels of consent he wants to opt-in in addition to the implicit
        defined in current privacy policy (extra_levels).

        - its levels of consent he wants to opt-out (removed_consents).

        Multiple choices are allowed and possible choices are:
        TRANSACTION_TRIGGERS, TARGETING, STATISTICS, SMART_RANKING and
        WEB_ANALYTICS.

        - its associated account ids under linked banks (banks).


        You can choose any consumer ID you want, as long as it is not already
        used by an existing consumer in your

        program.


        If success, the route answers back with the new consumer ID.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                banks:
                  description: >-
                    optional array of banks, containing bank_id and accounts ids
                    associated.
                extra_consents:
                  description: >-
                    optional array of explicit consent levels the consumer wants
                    to opt-in.
                  items:
                    enum:
                      - TRANSACTION_TRIGGERS
                      - TARGETING
                      - STATISTICS
                      - SMART_RANKING
                  type: array
                id:
                  type: string
                removed_consents:
                  description: >-
                    optional array of consent levels the consumer wants to
                    opt-out.
                  items:
                    enum:
                      - TRANSACTION_TRIGGERS
                      - TARGETING
                      - STATISTICS
                      - SMART_RANKING
                  type: array
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumerId'
          description: Created
          links:
            get.AccountListResource:
              operationId: get.AccountListResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.AffiliationCashbackConsumerList:
              operationId: get.AffiliationCashbackConsumerList.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.AggregatedUniverseList:
              operationId: get.AggregatedUniverseList.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.BankConnectionListingResource:
              operationId: get.BankConnectionListingResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.CashbackListResource:
              operationId: get.CashbackListResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.ConnectionStatusListing:
              operationId: get.ConnectionStatusListing.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.ConsumerBrandAggregatedOfferList:
              operationId: get.ConsumerBrandAggregatedOfferList.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.Global:
              operationId: get.Global.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.Monthly:
              operationId: get.Monthly.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.OfferListResource:
              operationId: get.OfferListResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.PFMBanksResource:
              operationId: get.PFMBanksResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.PoolResource:
              operationId: get.PoolResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.RewardListResource:
              operationId: get.RewardListResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.RewardsCashbackListResource:
              operationId: get.RewardsCashbackListResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            get.VoucherModelListResource:
              operationId: get.VoucherModelListResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            post.DeactivateResource:
              operationId: post.DeactivateResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            post.KYCListResource:
              operationId: post.KYCListResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            post.PaymentAccountListResource:
              operationId: post.PaymentAccountListResource.impersonate
              parameters:
                consumer_id: $response.body#/id
            post.WebviewAccountResource:
              operationId: post.WebviewAccountResource.impersonate
              parameters:
                consumer_id: $response.body#/id
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Not allowed to access the resource
        '404':
          description: Not found
        '405':
          description: Method not allowed
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessError'
          description: Conflict
        '415':
          description: Unsupported Media Type
        '422':
          description: Unprocessable Entity
components:
  schemas:
    ConsumerId:
      properties:
        id:
          description: The consumer_id of the created consumer.
          example: ConsumerId123
          readOnly: true
          type: string
      type: object
    ValidationError:
      properties:
        errors:
          additionalProperties:
            items:
              $ref: '#/components/schemas/Error'
            type: array
          description: Errors during the validation process.
          type: object
        id:
          description: Unique ID of the object.
          example: e2c32b4b-de61-459b-accf-a75f76247946
          format: uuid
          type: string
      type: object
    ProcessError:
      properties:
        errors:
          additionalProperties:
            items:
              $ref: '#/components/schemas/Error'
            type: array
          description: Errors of the processing.
          type: object
        id:
          description: Unique ID of the object.
          example: e2c32b4b-de61-459b-accf-a75f76247946
          format: uuid
          type: string
      type: object
    Error:
      properties:
        code:
          description: Error code.
        message:
          description: Error message.
          type: string
        meta:
          description: Meta information of the error.
      required:
        - message
      type: object
  securitySchemes:
    ApiKeyAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````