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

# Onboard a consumer on Paylead platform

> Create a consumer by providing it's `consumer_id`



## OpenAPI

````yaml /program/api/openapi/legacy/1.1.2/injector.json post /consumers
openapi: 3.1.0
info:
  title: Thub API
  description: >+

    ## Welcome to PayLead Thub API Documentation!
        
    - Release Version: **None**

    - API Version: **1.1.2**


    This documentation is designed to help you go through the phases of

    basic implementation, and help you understand the basic steps to follow to

    reach your objectives via our API.


    ## Getting Started


    Our API is a RESTful API.


    A RESTful API explicitly takes advantage of HTTP methodologies defined by

    the RFC 2616 protocol. We use:


    - `GET` to retrieve a resource


    - `PUT`  to change the state of or update a resource, which can be an

    object, file or block


    - `POST` to create that resource


    - `DELETE` to remove it



    You can use the API to access all endpoints, such as the Transactions

    endpoint to post transactions, or the banks endpoint to get the list of

    available banks.



    The API is organized around REST. JSON is returned by all API responses,

    including errors. In all API requests, you must set `the content-type` HTTP

    header to application/JSON. All API requests must be made over HTTPS. Calls

    made over HTTP will fail.


    To access and work with our API, make sure you have been provided the

    following elements by our Ops team:


    - A developers Shift account 

    - Defined a bank mapping



    ## Versioning


    Our API supports versioning, so be sure to set the right version in the

    header, using the `X-Api-Version`



    ex: `X-Api-Version = 1.0.0`


    ## Base URL


    All API URLs referenced in this documentation start with the following base
    URL: `https://api.sandbox.paylead.fr/`


    ## 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 | Unauthorized          | Missing API Key or
    invalid                                                                        
    |

    | 403 | Forbidden             | Access is
    forbidden                                                                               
    |

    | 404 | Not Found             | Resource does not
    exist                                                                           
    |

    | 405 | Method not allowed    | he method is not allowed for the requested
    URL.                                                    |

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

    | 500 | Internal server error | Something went wrong with the PayLead
    API                                                          |

    | 503 | Internal server error | Some service are
    unavailable                                                                      
    |

  version: 1.1.2
servers: []
security: []
tags:
  - name: Health
    description: Route used to health-check the app
  - name: Consumers
    description: Routes used to query consumers resources
  - name: Bank
    description: Routes used to query banks resources
  - name: Bank Connection
    description: Routes used to query banks connections resources
  - name: Bank Account
    description: Routes used to query bank account resources
  - name: Bulk Transaction
    description: Routes used to create transactions with a bulk insert
  - name: Transaction
    description: >-
      Routes used to query transactions resources based on the transaction id or
      unique id that you defined
  - name: Atomic Transaction
    description: >-
      Routes used to query transactions resources based on the bank connection
      id, bank account id and transaction id
paths:
  /consumers:
    post:
      tags:
        - Consumers
      summary: Onboard a consumer on Paylead platform
      description: Create a consumer by providing it's `consumer_id`
      operationId: post--consumers
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsumerCreateSchema'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumerOutSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              example:
                message: Bad Request
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                message: Missing or invalid Authorization Header.
        '403':
          description: Forbidden
          content:
            application/json:
              example:
                message: You don’t have permission to access this resource.
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                message: Internal Server Error
      security:
        - Authentication Token: []
components:
  schemas:
    ConsumerCreateSchema:
      properties:
        id:
          type: string
          maxLength: 100
          minLength: 2
          title: Id
          description: >-
            Unique identifier for a consumer on your system, alphanumeric string
            with optional dashes or underscores
        banks:
          anyOf:
            - items:
                $ref: '#/components/schemas/BucketBankSchema'
              type: array
            - type: 'null'
          title: Banks
      type: object
      required:
        - id
      title: ConsumerCreateSchema
    ConsumerOutSchema:
      properties:
        id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
          title: Id
          description: >-
            Unique identifier for a consumer on your system, alphanumeric string
            with optional dashes or underscores
      type: object
      required:
        - id
      title: ConsumerOutSchema
    BucketBankSchema:
      properties:
        id:
          anyOf:
            - type: string
              description: Unique identifier for the resource on your system
            - type: 'null'
          title: Id
        bank_id:
          type: string
          title: Bank Id
        status:
          anyOf:
            - $ref: '#/components/schemas/BankConnectionStatus'
            - type: 'null'
        accounts:
          items:
            $ref: '#/components/schemas/BucketAccountSchema'
          type: array
          title: Accounts
      type: object
      required:
        - bank_id
        - accounts
      title: BucketBankSchema
    BankConnectionStatus:
      type: string
      enum:
        - UNKNOWN
        - DISABLED
        - ERROR
        - CHALLENGE_REQUIRED
        - SCRAPPING
        - SUCCESS
        - SCA_REQUIRED
        - WEBAUTH_REQUIRED
        - WRONG_PASS
        - ACTION_NEEDED
        - WAITING_FOR_VALIDATION
      title: BankConnectionStatus
      description: Bank Connection Status enum
    BucketAccountSchema:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the resource on your system
        iban:
          anyOf:
            - type: string
              maxLength: 34
              title: IBAN
            - type: 'null'
          title: Iban
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        transactions:
          items:
            $ref: '#/components/schemas/BucketTransactionSchema'
          type: array
          title: Transactions
          default: []
      type: object
      required:
        - id
      title: BucketAccountSchema
    BucketTransactionSchema:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the resource on your system
        account_id:
          anyOf:
            - type: string
              description: Unique identifier for the resource on your system
            - type: 'null'
          title: Account Id
        amount:
          type: number
          title: Amount
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        raw_label:
          type: string
          title: Raw Label
          description: Unicode string that must not contain null bytes (\x00)
        executed_at:
          anyOf:
            - type: string
              format: date-time
            - type: string
              format: date
          title: Executed At
        type:
          $ref: '#/components/schemas/TransactionType'
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        deleted:
          anyOf:
            - type: string
              format: date-time
            - type: string
              format: date
            - type: 'null'
          title: Deleted
        currency:
          type: string
          enum:
            - AED
            - AFN
            - ALL
            - AMD
            - AOA
            - ARS
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BOV
            - BRL
            - BSD
            - BTN
            - BWP
            - BYN
            - BZD
            - CAD
            - CDF
            - CHE
            - CHF
            - CHW
            - CLF
            - CLP
            - CNY
            - COP
            - COU
            - CRC
            - CUP
            - CVE
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EGP
            - ERN
            - ETB
            - EUR
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - HTG
            - HUF
            - IDR
            - ILS
            - INR
            - IQD
            - IRR
            - ISK
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LYD
            - MAD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRU
            - MUR
            - MVR
            - MWK
            - MXN
            - MXV
            - MYR
            - MZN
            - NAD
            - NGN
            - NIO
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLE
            - SOS
            - SRD
            - SSP
            - STN
            - SVC
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - USD
            - USN
            - UYI
            - UYU
            - UYW
            - UZS
            - VED
            - VES
            - VND
            - VUV
            - WST
            - XAD
            - XAF
            - XCD
            - XCG
            - XOF
            - XPF
            - XSU
            - XUA
            - YER
            - ZAR
            - ZMW
            - ZWG
          maxLength: 3
          minLength: 3
          title: Currency
          description: ISO 4217 currency code (alpha-3 or numeric)
          examples:
            - EUR
            - '978'
        store:
          anyOf:
            - $ref: '#/components/schemas/StoreSchema'
            - type: 'null'
        brand:
          anyOf:
            - $ref: '#/components/schemas/BrandSchema'
            - type: 'null'
        state:
          anyOf:
            - $ref: '#/components/schemas/TransactionState'
            - type: 'null'
        channel:
          anyOf:
            - $ref: '#/components/schemas/TransactionChannel'
            - type: 'null'
        is_realtime:
          type: boolean
          title: Is Realtime
          default: false
        truncated_pan:
          anyOf:
            - type: string
              description: >-
                Last 4 digits of the card number, must be a string without null
                bytes, and match 4 digits
            - type: 'null'
          title: Truncated Pan
        truncated_dpan:
          anyOf:
            - type: string
              description: >-
                Last 4 digits of the device token, must be a string without null
                bytes, and match 4 digits
            - type: 'null'
          title: Truncated Dpan
        scheme:
          anyOf:
            - type: string
            - type: 'null'
          title: Scheme
          description: The network used for the transaction
          examples:
            - visa
            - mastercard
        authorization_id_response:
          anyOf:
            - type: string
              maxLength: 6
              minLength: 1
              description: >-
                Alphanumeric reference number assigned by the issuer in response
                to a transaction authorization request.
              example: 1A2B3C
            - type: 'null'
          title: Authorization Id Response
        retrieval_reference_number:
          anyOf:
            - type: string
              maxLength: 12
              minLength: 1
              pattern: ^[a-zA-Z0-9 ]{1,12}$
              description: >-
                Alphanumeric retrieval reference number, unique identifier
                assigned to a card transaction during the authorization
              example: 1A2B3C4D5E6F
            - type: 'null'
          title: Retrieval Reference Number
      type: object
      required:
        - id
        - amount
        - raw_label
        - executed_at
        - type
        - currency
      title: BucketTransactionSchema
    TransactionType:
      type: string
      enum:
        - bank
        - card
        - check
        - deferred_card
        - deposit
        - loan_payment
        - order
        - payback
        - summary_card
        - transfer
        - unknown
        - withdrawal
      title: TransactionType
    StoreSchema:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        post_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Post Code
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        category_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Category Code
        public_reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Public Reference
        merchant_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Merchant Id
      type: object
      title: StoreSchema
    BrandSchema:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        mcc:
          anyOf:
            - type: string
            - type: 'null'
          title: Mcc
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        post_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Post Code
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        category_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Category Code
        public_reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Public Reference
      type: object
      title: BrandSchema
    TransactionState:
      type: string
      enum:
        - cleared
        - authorization
      title: TransactionState
    TransactionChannel:
      type: string
      enum:
        - store
        - online
      title: TransactionChannel
  securitySchemes:
    Authentication Token:
      type: http
      description: |-

        Enter your "Injector" API Key

        See Authentication section for more information
            
      scheme: bearer

````