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

# Create transaction

> Create a new transaction and associate it with an existing customer.  

**Example 1:**  
To associate the transaction with the customer ID 42, set the `customer` property to be:  
`"customer": {
            "id": 42
}`

**Example 2:**  
To associate the transaction with the customer email "john@doe.com", set the `customer` property to be:  
`"customer": {
            "email": "john@doe.com"
}`



## OpenAPI

````yaml /openapi.json post /v3/transactions
openapi: 3.0.1
info:
  title: Kiflo Public API v3
  description: "The Kiflo API allows you to have control over your integration and create the best experiences.\r\n\r\n***\r\n\r\n## Format\r\n\r\nThe API follows the REST standard using JSON to format requests and responses.  \r\nDecimals are formatted using invariant culture, ie: using \".\" (dot) as a decimal sperator and no thousands separator.  \r\nDates are formatted using ISO standards, in UTC format, including the timezone. Ex:  2015-03-25T12:00:00Z\r\n\r\n***\r\n\r\n## Security\r\n\r\nThe API is secured using an API token.\r\n\r\n**How to generate an API Access Token**  \r\n 1. Open your [account settings page](https://app.kiflo.com/account/integration)\r\n 2. Go to the \"API Access Token\" section\r\n 3. Click \"Add\" button\r\n 4. Choose a name that will be used to identify the token and click \"Add\"\r\n 4. Copy the generate token\r\n   \r\n> **Note:** For security reason, the generated API Access Token won't be visible after you close the settings page. Be sure to copy the generated token otherwise you won't be able to get it later.\r\n  \r\n**How to authenticate on the API**  \r\n  \r\nTo authenticate on the API, send the generated token in the Authorization header using the Bearer scheme:  \r\n`Authorization: Bearer #YOUR_GENERATED_TOKEN_HERE#`\r\n"
  version: v3
servers: []
security: []
paths:
  /v3/transactions:
    post:
      tags:
        - Transactions
      summary: Create transaction
      description: "Create a new transaction and associate it with an existing customer.  \r\n\r\n**Example 1:**  \r\nTo associate the transaction with the customer ID 42, set the `customer` property to be:  \r\n`\"customer\": {\r\n            \"id\": 42\r\n}`\r\n\r\n**Example 2:**  \r\nTo associate the transaction with the customer email \"john@doe.com\", set the `customer` property to be:  \r\n`\"customer\": {\r\n            \"email\": \"john@doe.com\"\r\n}`"
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/TransactionCreateRequestDto'
            example:
              properties:
                name: Product A
                amount: 99.9
              currency: USD
              partner:
                name: Microsoft
              customer:
                email: john@doe.com
              deal: null
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionCreateRequestDto'
            example:
              properties:
                name: Product A
                amount: 99.9
              currency: USD
              partner:
                name: Microsoft
              customer:
                email: john@doe.com
              deal: null
          text/json:
            schema:
              $ref: '#/components/schemas/TransactionCreateRequestDto'
            example:
              properties:
                name: Product A
                amount: 99.9
              currency: USD
              partner:
                name: Microsoft
              customer:
                email: john@doe.com
              deal: null
          application/*+json:
            schema:
              $ref: '#/components/schemas/TransactionCreateRequestDto'
            example:
              properties:
                name: Product A
                amount: 99.9
              currency: USD
              partner:
                name: Microsoft
              customer:
                email: john@doe.com
              deal: null
      responses:
        '200':
          description: Transaction created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDto'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errorCode: Transactions.InvalidCustomerIdentifier
                errorMessage: You must specify one customer identifier
      security:
        - oauth2:
            - Transaction.Create
            - Api
components:
  schemas:
    TransactionCreateRequestDto:
      required:
        - currency
      type: object
      properties:
        properties:
          type: object
          additionalProperties:
            nullable: true
          description: The list of transaction properties.
          nullable: true
        currency:
          minLength: 1
          type: string
          description: >-
            The currency ISO 4217 code (EUR, USD, CAD, etc) for all currency
            properties.
          example: EUR
        partner:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: >-
            The partner selector used to search for a partner that must be
            attached to the transaction.
          nullable: true
        customer:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: >-
            The customer selector used to search for a customer that must be
            attached to the transaction.
          nullable: true
        deal:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: >-
            The deal selector used to search for a deal that must be attached to
            the transaction.
          nullable: true
      additionalProperties: false
    TransactionDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
        creationDate:
          type: string
          format: date-time
        properties:
          type: object
          additionalProperties:
            nullable: true
          nullable: true
        customerId:
          type: integer
          format: int32
          nullable: true
        partnerId:
          type: integer
          format: int32
          nullable: true
        dealId:
          type: integer
          format: int32
          nullable: true
        currency:
          type: string
          nullable: true
        isDeleted:
          type: boolean
        deletionDate:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        errorCode:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
      additionalProperties: false

````