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

# Add transactions



## OpenAPI

````yaml api.yaml POST /v1/transactions
openapi: 3.0.1
info:
  title: ingest/v1/ingest.proto
  version: version not set
  description: API for ingesting billing data into Slicker
servers:
  - url: https://api.slickerhq.com/ingest
security:
  - bearerAuth: []
tags:
  - name: IngestService
    description: Services for ingesting billing data into Slicker
paths:
  /v1/transactions:
    post:
      tags:
        - IngestService
      summary: Ingest transactions into the system
      description: |
        Upload one or more transactions to be processed by Slicker.
        Requires authentication with a valid API key passed as a Bearer token.
        Maximum of 200 transactions per request.
      operationId: IngestService_IngestTransactions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionsRequest'
            example:
              transactions:
                - id: txn_12345678
                  paymentGatewayTransactionId: ch_1a2b3c4d5e
                  state: TRANSACTION_STATE_PAID
                  customerId: cus_87654321
                  subscriptionId: sub_12345678
                  invoiceId: inv_12345678
                  businessEntity: ACME Inc.
                  amount: 2500
                  currency: USD
                  createdAt: '2023-01-15T10:15:00Z'
                  updatedAt: '2023-01-15T10:20:00Z'
                  paymentMethodType: card
                  paymentGatewayId: pg_stripe
                  paymentGatewayName: Stripe
                  paymentGatewayType: credit_card
                  paymentGatewayStatus: succeeded
                  cardBrand: visa
                  cardBin: '411111'
                  cardFingerprint: Xt5EWLLDS7FJjR1c
                  cardCountry: US
                - id: txn_87654321
                  paymentGatewayTransactionId: ch_5e4d3c2b1a
                  state: TRANSACTION_STATE_FAILED
                  customerId: cus_12345678
                  subscriptionId: sub_87654321
                  invoiceId: inv_87654321
                  businessEntity: ACME Inc.
                  amount: 5000
                  currency: USD
                  createdAt: '2023-01-20T09:15:00Z'
                  updatedAt: '2023-01-20T09:20:00Z'
                  paymentMethodType: card
                  paymentGatewayId: pg_stripe
                  paymentGatewayName: Stripe
                  paymentGatewayType: credit_card
                  paymentGatewayStatus: failed
                  paymentGatewayErrorCode: card_declined
                  paymentGatewayErrorMessage: Your card was declined
                  cardBrand: mastercard
                  cardBin: '511111'
                  cardFingerprint: R7GsJL9FmKj3dN2q
                  cardCountry: UK
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionsResponse'
        '400':
          description: Bad Request - The request contains invalid parameters or payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 400
                message: 'Invalid transaction data: missing required fields'
                details: []
        '401':
          description: Unauthorized - Authentication credentials are missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 401
                message: 'Unauthorized: missing or invalid API key in Bearer token'
                details: []
        '403':
          description: >-
            Forbidden - The authenticated user doesn't have permission to access
            this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 403
                message: 'Forbidden: insufficient permissions to ingest transactions'
                details: []
        '429':
          description: Too Many Requests - The rate limit has been exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 429
                message: 'Rate limit exceeded: try again later'
                details: []
        '500':
          description: Internal Server Error - An unexpected server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 500
                message: Internal server error
                details: []
        default:
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionsResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    TransactionsRequest:
      type: object
      description: >-
        Request to ingest transaction data. Maximum of 200 transactions per
        request.
      properties:
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
    TransactionsResponse:
      type: object
      properties:
        requestId:
          type: string
          description: Unique identifier for tracking the request through the system
          example: req_2uqkAo1bwllmzrgV2qtGv48DtGI
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    Transaction:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the transaction
          example: txn_12345678
        paymentGatewayTransactionId:
          type: string
          description: Transaction identifier from the payment gateway
          example: ch_1a2b3c4d5e
        state:
          $ref: '#/components/schemas/TransactionState'
          description: Current state of the transaction
          example: TRANSACTION_STATE_PAID
        customerId:
          type: string
          description: Unique identifier for the customer
          example: cus_87654321
        subscriptionId:
          type: string
          description: Unique identifier for the associated subscription, if applicable
          example: sub_12345678
        invoiceId:
          type: string
          description: Unique identifier for the associated invoice, if applicable
          example: inv_12345678
        businessEntity:
          type: string
          description: Business entity associated with this record
          example: ACME Inc.
        amount:
          type: integer
          format: int32
          description: Monetary amount in smallest unit (e.g., cents)
          example: 2500
        currency:
          type: string
          description: Three-letter ISO 4217 currency code
          example: USD
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the transaction was created
          example: '2023-01-15T10:15:00Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the transaction was last updated
          example: '2023-01-15T10:20:00Z'
        paymentMethodType:
          type: string
          description: Type of payment method used
          example: card
        paymentGatewayId:
          type: string
          description: Identifier for the payment gateway
          example: pg_stripe
        paymentGatewayName:
          type: string
          description: Name of the payment gateway
          example: Stripe
        paymentGatewayType:
          type: string
          description: Type of the payment gateway
          example: credit_card
        paymentGatewayStatus:
          type: string
          description: Status reported by the payment gateway
          example: succeeded
        paymentGatewayErrorCode:
          type: string
          description: Error code from the payment gateway, if applicable
          example: card_declined
        paymentGatewayErrorMessage:
          type: string
          description: Error message from the payment gateway, if applicable
          example: Your card was declined
        cardBrand:
          type: string
          description: Brand of the credit card used for payment
          example: visa
        cardBin:
          type: string
          description: Bank Identification Number (first 6 digits of card number)
          example: '411111'
        cardFingerprint:
          type: string
          description: Unique fingerprint for the card
          example: Xt5EWLLDS7FJjR1c
        cardCountry:
          type: string
          description: ISO 3166-1 alpha-2 country code of the card
          example: US
      required:
        - id
        - amount
        - currency
        - createdAt
        - state
        - customerId
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties:
        type: object
    TransactionState:
      type: string
      default: TRANSACTION_STATE_UNSPECIFIED
      enum:
        - TRANSACTION_STATE_UNSPECIFIED
        - TRANSACTION_STATE_PAID
        - TRANSACTION_STATE_FAILED
        - TRANSACTION_STATE_PENDING
        - TRANSACTION_STATE_REFUNDED
        - TRANSACTION_STATE_CHARGEBACK
        - TRANSACTION_STATE_VOID
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: |
        API key authentication using a Bearer token in the Authorization header.
        Example: `Authorization: Bearer YOUR_API_KEY`

````