> ## 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 a bulk of historical transactions

> Inserts multiple historical transactions to consumer `consumer_id` using a bulk. Historical transactions will not be cashbacked.



## OpenAPI

````yaml /program/api/openapi/2.0.0/thub/openapi.json post /consumers/{consumer_id}/transactions/history
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: Consumers
  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: Rewards
    x-displayName: Rewards
  - description: Routes used to create transactions with a bulk insert
    name: Bulk Transaction
    x-displayName: Bulk Transaction
  - description: >-
      Routes used to query transactions resources based on the transaction id or
      unique id that you defined
    name: Transaction
    x-displayName: Transaction
paths:
  /consumers/{consumer_id}/transactions/history:
    post:
      tags:
        - Bulk Transaction
      summary: Create a bulk of historical transactions
      description: >-
        Inserts multiple historical transactions to consumer `consumer_id` using
        a bulk. Historical transactions will not be cashbacked.
      operationId: consumers__consumer_id__transactions__history__post
      parameters:
        - description: >-
            Unique ID of the consumer that you have registered when the user was
            onboarded.
          in: path
          name: consumer_id
          required: true
          schema:
            description: >-
              Unique ID of the consumer that you have registered when the user
              was onboarded.
            maxLength: 100
            minLength: 2
            title: Consumer Id
            type: string
        - 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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Thub_BucketCreateSchema'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Thub_EmptySchema'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    Thub_BucketCreateSchema:
      properties:
        banks:
          description: >-
            List of bank connections and their associated accounts in the
            bucket.
          items:
            $ref: '#/components/schemas/Thub_BucketBankSchema'
          title: Banks
          type: array
      required:
        - banks
      title: BucketCreateSchema
      type: object
    Thub_EmptySchema:
      properties: {}
      title: EmptySchema
      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
    Thub_BucketBankSchema:
      properties:
        accounts:
          description: Bank accounts attached to this bank connection.
          items:
            $ref: '#/components/schemas/Thub_BucketAccountSchema'
          title: Accounts
          type: array
        bank_id:
          description: >-
            Identifier of the bank, as agreed in the bank mapping defined with
            the Ops team.
          examples:
            - bank_id
          title: Bank Id
          type: string
        id:
          anyOf:
            - description: Unique identifier for the resource on your system
              type: string
            - type: 'null'
          description: Identifier of the bank connection on your system.
          examples:
            - '1'
          title: Id
        status:
          anyOf:
            - $ref: '#/components/schemas/Thub_BankConnectionStatus'
            - type: 'null'
          description: Status of the bank connection. Mainly used for programs with AISP.
          examples:
            - SUCCESS
      required:
        - bank_id
        - accounts
      title: BucketBankSchema
      type: object
    Thub_BucketAccountSchema:
      properties:
        iban:
          anyOf:
            - maxLength: 34
              title: IBAN
              type: string
            - type: 'null'
          description: IBAN of the bank account, validated against the IBAN format.
          examples:
            - FR7630006000011234567890189
          title: Iban
        id:
          description: Unique identifier for the resource on your system
          examples:
            - acc_9876543210
          title: Id
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: Display name of the bank account.
          examples:
            - exemple_account
          title: Name
        transactions:
          description: Transactions carried by this account in the bucket.
          items:
            $ref: '#/components/schemas/Thub_BucketTransactionSchema'
          title: Transactions
          type: array
      required:
        - id
      title: BucketAccountSchema
      type: object
    Thub_BankConnectionStatus:
      description: Bank Connection Status enum
      enum:
        - UNKNOWN
        - DISABLED
        - ERROR
        - CHALLENGE_REQUIRED
        - SCRAPPING
        - SUCCESS
        - SCA_REQUIRED
        - WEBAUTH_REQUIRED
        - WRONG_PASS
        - ACTION_NEEDED
        - WAITING_FOR_VALIDATION
      title: BankConnectionStatus
      type: string
    Thub_BucketTransactionSchema:
      properties:
        account_id:
          anyOf:
            - description: Unique identifier for the resource on your system
              type: string
            - type: 'null'
          description: Identifier of the account this transaction belongs to.
          examples:
            - acc_9876543210
          title: Account Id
        acquirer_reference_number:
          anyOf:
            - description: >-
                Alphanumeric (accepts spaces, _ and -) acquirer reference
                number, unique identifier assigned to a card transaction by the
                acquirer, max 23 characters
              examples:
                - '74999912345678901234567'
              maxLength: 23
              minLength: 1
              pattern: ^[a-zA-Z0-9 _-]{1,23}$
              type: string
            - type: 'null'
          title: Acquirer Reference Number
        amount:
          description: >-
            Signed transaction amount in the transaction currency; negative for
            debits, positive for credits.
          examples:
            - -85.5
          title: Amount
          type: number
        authorization_id_response:
          anyOf:
            - description: >-
                Alphanumeric (accepts spaces, _ and -) reference number assigned
                by the issuer in response to a transaction authorization
                request, max 6 characters
              examples:
                - 1A2B3C
              maxLength: 6
              minLength: 1
              type: string
            - type: 'null'
          title: Authorization Id Response
        brand:
          anyOf:
            - $ref: '#/components/schemas/Thub_BrandSchema'
            - type: 'null'
          description: Brand metadata resolved for the transaction.
        category:
          anyOf:
            - type: string
            - type: 'null'
          description: Category of the transaction as classified by the bank.
          examples:
            - shopping
          title: Category
        channel:
          anyOf:
            - $ref: '#/components/schemas/Thub_TransactionChannel'
            - type: 'null'
          description: Channel through which the transaction was made.
        currency:
          description: ISO 4217 currency code (alpha-3 or numeric)
          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
          examples:
            - EUR
            - '978'
          maxLength: 3
          minLength: 3
          title: Currency
          type: string
        deleted:
          anyOf:
            - format: date-time
              type: string
            - format: date
              type: string
            - type: 'null'
          description: >-
            ISO 8601 timestamp at which the transaction was deleted, when
            applicable.
          title: Deleted
        executed_at:
          anyOf:
            - format: date-time
              type: string
            - format: date
              type: string
          description: ISO 8601 date/datetime at which the transaction was executed.
          examples:
            - '2023-07-15T14:32:45'
          title: Executed At
        id:
          description: Unique identifier for the resource on your system
          examples:
            - tx_12345678abcdef
          title: Id
          type: string
        is_realtime:
          default: false
          description: >-
            Whether the transaction was pushed in real time (e.g. at
            authorization).
          title: Is Realtime
          type: boolean
        label:
          anyOf:
            - type: string
            - type: 'null'
          description: Cleaned, human-readable descriptor of the transaction.
          examples:
            - PURCHASE NIKE STORE
          title: Label
        raw_label:
          description: Raw descriptor as received from the bank, before any cleaning.
          examples:
            - PURCHASE NIKE STORE PARIS
          title: Raw Label
          type: string
        retrieval_reference_number:
          anyOf:
            - description: >-
                Alphanumeric (accepts spaces, _ and -) retrieval reference
                number, unique identifier assigned to a card transaction during
                the authorization, max 12 characters
              examples:
                - 1A2B3C4D5E6F
              maxLength: 12
              minLength: 1
              pattern: ^[a-zA-Z0-9 _-]{1,12}$
              type: string
            - type: 'null'
          title: Retrieval Reference Number
        scheme:
          anyOf:
            - type: string
            - type: 'null'
          description: The network used for the transaction
          examples:
            - visa
            - mastercard
          title: Scheme
        scheme_id:
          anyOf:
            - description: >-
                Alphanumeric (accepts spaces, _ and -) scheme identifier
                assigned to a card transaction by the card network
              examples:
                - '019876543210987'
              minLength: 1
              pattern: ^[a-zA-Z0-9 _-]+$
              type: string
            - type: 'null'
          title: Scheme Id
        state:
          anyOf:
            - $ref: '#/components/schemas/Thub_TransactionState'
            - type: 'null'
          description: Settlement state of the transaction.
        store:
          anyOf:
            - $ref: '#/components/schemas/Thub_StoreSchema'
            - type: 'null'
          description: Store metadata resolved for the transaction.
        truncated_dpan:
          anyOf:
            - description: >-
                Last 4 digits of the device token, must be a string without null
                bytes, and match 4 digits
              examples:
                - 1A2B
              maxLength: 4
              minLength: 4
              type: string
            - type: 'null'
          title: Truncated Dpan
        truncated_pan:
          anyOf:
            - description: >-
                Last 4 digits of the card number, must be a string without null
                bytes, and match 4 digits
              examples:
                - 1A2B
              maxLength: 4
              minLength: 4
              type: string
            - type: 'null'
          title: Truncated Pan
        type:
          $ref: '#/components/schemas/Thub_TransactionType'
          description: Nature of the transaction as reported by the bank.
      required:
        - id
        - amount
        - raw_label
        - executed_at
        - type
        - currency
      title: BucketTransactionSchema
      type: object
    Thub_BrandSchema:
      properties:
        address:
          anyOf:
            - type: string
            - type: 'null'
          description: Street address of the brand.
          examples:
            - 1 Rue de la Paix
          title: Address
        category_code:
          anyOf:
            - type: string
            - type: 'null'
          description: Category label of the brand's activity.
          examples:
            - CLOTHING
          title: Category Code
        city:
          anyOf:
            - type: string
            - type: 'null'
          description: City of the brand address.
          examples:
            - Paris
          title: City
        country:
          anyOf:
            - type: string
            - type: 'null'
          description: ISO 3166-1 alpha-2 country code of the brand.
          examples:
            - FR
          title: Country
        id:
          anyOf:
            - type: string
            - type: 'null'
          description: Identifier of the brand on your system.
          examples:
            - brand_nike
          title: Id
        mcc:
          anyOf:
            - type: string
            - type: 'null'
          description: ISO 18245 Merchant Category Code associated with the brand.
          examples:
            - '5941'
          title: Mcc
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: Display name of the brand.
          examples:
            - Nike
          title: Name
        post_code:
          anyOf:
            - type: string
            - type: 'null'
          description: Postal code of the brand address.
          examples:
            - '75001'
          title: Post Code
        public_reference:
          anyOf:
            - type: string
            - type: 'null'
          description: Legal company registration number of the brand (e.g. RCS/SIREN).
          examples:
            - FR0123456789
          title: Public Reference
      title: BrandSchema
      type: object
    Thub_TransactionChannel:
      description: >-
        Channel through which the transaction was made: in a physical ``store``
        or ``online``.
      enum:
        - store
        - online
      title: TransactionChannel
      type: string
    Thub_TransactionState:
      description: >-
        Settlement state of the transaction: ``authorization`` (pending) or
        ``cleared`` (settled).
      enum:
        - cleared
        - authorization
      title: TransactionState
      type: string
    Thub_StoreSchema:
      properties:
        address:
          anyOf:
            - type: string
            - type: 'null'
          description: Street address of the store.
          examples:
            - 1 Rue de la Paix
          title: Address
        category_code:
          anyOf:
            - type: string
            - type: 'null'
          description: Category label of the store's activity.
          examples:
            - Clothing
          title: Category Code
        city:
          anyOf:
            - type: string
            - type: 'null'
          description: City of the store address.
          examples:
            - Paris
          title: City
        country:
          anyOf:
            - type: string
            - type: 'null'
          description: ISO 3166-1 alpha-2 country code of the store.
          examples:
            - FR
          title: Country
        id:
          anyOf:
            - type: string
            - type: 'null'
          description: Identifier of the physical store on your system.
          examples:
            - store_123456
          title: Id
        merchant_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Acquirer merchant identifier (card acceptor ID).
          examples:
            - merchant_nike_fr
          title: Merchant Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: Display name of the store.
          examples:
            - Nike Store
          title: Name
        post_code:
          anyOf:
            - type: string
            - type: 'null'
          description: Postal code of the store address.
          examples:
            - '75001'
          title: Post Code
        public_reference:
          anyOf:
            - type: string
            - type: 'null'
          description: Legal company registration number of the store (e.g. RCS/SIREN).
          examples:
            - RCS987654321
          title: Public Reference
        terminal_id:
          anyOf:
            - description: >-
                Alphanumeric (accepts spaces, _ and -) terminal identifier, max
                8 characters
              examples:
                - TERM1234
              maxLength: 8
              minLength: 1
              pattern: ^[a-zA-Z0-9 _-]{1,8}$
              type: string
            - type: 'null'
          title: Terminal Id
      title: StoreSchema
      type: object
    Thub_TransactionType:
      description: >-
        Nature of the transaction as reported by the bank (payment instrument or
        operation type).
      enum:
        - bank
        - card
        - check
        - deferred_card
        - deposit
        - loan_payment
        - order
        - payback
        - summary_card
        - transfer
        - unknown
        - withdrawal
      title: TransactionType
      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

````