Elastic Path Transactions API

Methods to allow you to modify and view a products stock via transactions.

OpenAPI Specification

elastic-path-transactions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: 25.1126.6886238
  x-version-timestamp: 2025-11-26 19:10:23+00:00
  title: Addresses Introduction Account Addresses Transactions API
  description: 'The Addresses API allows you to organize account addresses. Addresses are a sub-resource of `account` resources, an account can have multiple addresses, such as home, work, and neighbour.


    You can use an account address with either [client_credentials access token](/docs/api/authentication/create-an-access-token) or a combination of [implicit access token](/docs/api/authentication/create-an-access-token) and [Account Management authentication](/docs/api/accounts/post-v-2-account-members-tokens) token.

    '
  contact:
    name: Elastic Path
    url: https://www.elasticpath.com
    email: support@elasticpath.com
  license:
    url: https://elasticpath.dev
    name: MIT
servers:
- url: https://useast.api.elasticpath.com
  description: US East
- url: https://euwest.api.elasticpath.com
  description: EU West
security:
- BearerToken: []
tags:
- name: Transactions
  description: Methods to allow you to modify and view a products stock via transactions.
paths:
  /inventories/{product_uuid}/transactions:
    parameters:
    - name: product_uuid
      in: path
      description: The unique identifier of the product.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      parameters:
      - $ref: '#/components/parameters/PageOffset'
      - $ref: '#/components/parameters/PageLimit'
      summary: Get Stock Transactions for Product
      description: Returns the transactions recorded for the specified product.
      tags:
      - Transactions
      operationId: GetStockTransactions
      responses:
        '200':
          description: Success. Returns the stock for the given product
          content:
            application/json:
              schema:
                type: object
                properties:
                  meta:
                    $ref: '#/components/schemas/Meta'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Transaction'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      summary: Create Stock Transaction on Product
      tags:
      - Transactions
      operationId: UpdateProductStock
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - data
              properties:
                data:
                  $ref: '#/components/schemas/TransactionCreate'
      responses:
        '200':
          description: Success. Stock was successfully modified for product
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Transaction'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/UnprocessableEntityError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /inventories/{product_uuid}/transactions/{transaction_uuid}:
    parameters:
    - name: product_uuid
      in: path
      description: The unique identifier of the product.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    - name: transaction_uuid
      in: path
      description: The unique identifier of the transaction.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      summary: Get Single Stock Transaction for Product
      description: Returns the specific transaction with transaction_uuid for product_uuid
      tags:
      - Transactions
      operationId: GetSingleStockTransaction
      responses:
        '200':
          description: Success. Returns the stock transaction for the given product
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Transaction'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    TransactionCreate:
      required:
      - action
      - type
      properties:
        product_id:
          description: The ID of the product to perform the transaction against
          type: string
          format: uuid
          example: b9ad64bd-fc21-4918-b6ec-768809f4a1e9
        type:
          description: The type of object being returned. Always `stock-transaction`.
          type: string
          enum:
          - stock-transaction
          default: stock-transaction
          example: stock-transaction
        action:
          description: "The type of action being performed by this transaction.\n\n - **increment** - use this when you want to make products available for purchase, for example, when you have received stock from a supplier.\n\n - **decrement** - Use this when you want to remove stock from product inventory.\n\n - **allocate** - Use this when you want to allocate stock, normally to a reseller who sells on the stock.\n\n - **deallocate** - Use this when you want to deallocate any previously allocated stock.\n"
          type: string
          enum:
          - increment
          - decrement
          - allocate
          - deallocate
          example: allocate
        quantity:
          description: The amount of stock affected by the stock transaction.
          type: integer
          format: int64
          example: 5
          minimum: 1
    UUID:
      type: string
      description: The unique identifier.
      x-go-type: uuid.UUID
      x-go-type-import:
        name: uuid
        path: github.com/google/uuid
      example: 00000000-0000-0000-0000-000000000000
    Timestamps:
      properties:
        updated_at:
          description: The date and time a resource was updated.
          type: string
          example: '2017-01-10T11:41:19.244842Z'
        created_at:
          description: The date and time a resource was created.
          type: string
          example: '2017-01-10T11:41:19.244842Z'
    Error:
      type: object
      required:
      - status
      - title
      properties:
        status:
          type: string
          description: The HTTP response code of the error.
          example: 500
        title:
          type: string
          description: A brief summary of the error.
          example: Internal server error
        detail:
          type: string
          description: Optional additional detail about the error.
          example: An internal error has occurred.
        meta:
          type: object
          description: Additional supporting meta data for the error.
          example:
            missing_ids:
            - e7d50bd5-1833-43c0-9848-f9d325b08be8
    Meta:
      allOf:
      - $ref: '#/components/schemas/Timestamps'
    ErrorResponse:
      type: object
      required:
      - errors
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    Transaction:
      required:
      - type
      properties:
        id:
          description: The unique identifier for the stock transaction.
          type: string
          example: f976dace-450f-4a5d-8877-d119c5a550a1
        type:
          description: The type represents the object being returned. Always `stock-transaction`.
          type: string
          example: stock-transaction
          enum:
          - stock-transaction
          default: stock-transaction
        action:
          description: 'The type of action performed by this transaction.


            - **increment** - use this when you want to make products available for purchase, for example, when you have received stock from a supplier.


            - **decrement** - Use this when you want to remove stock from product inventory.


            - **allocate** - Use this when you want to allocate stock, normally to a reseller who sells on the stock.


            - **deallocate** - Use this when you want to deallocate any previously allocated stock.

            '
          type: string
          enum:
          - increment
          - decrement
          - allocate
          - deallocate
          example: allocate
        product_id:
          description: The product identifier that this stock transaction is for.
          type: string
          example: 86b84d3e-0a86-43d6-a347-78ba4adacca2
        quantity:
          description: The amount of stock affected by the stock transaction.
          type: integer
          format: int64
          example: 5
        timestamps:
          $ref: '#/components/schemas/Timestamps'
  parameters:
    PageOffset:
      name: page[offset]
      description: The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
      in: query
      required: false
      schema:
        type: integer
        format: int
        minimum: 0
        maximum: 10000
        example: 10
    PageLimit:
      description: The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](https://elasticpath.dev/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
      name: page[limit]
      in: query
      required: false
      schema:
        type: integer
        format: int
        minimum: 0
        example: 100
  responses:
    NotFoundError:
      description: Not found. The requested entity does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            not-found:
              value:
                errors:
                - title: Not Found
                  status: '404'
                  detail: No stock found
    UnprocessableEntityError:
      description: The request was understood, but could not be processed by the server
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing-name:
              value:
                errors:
                - title: Cannot complete request
                  status: '422'
                  detail: Your request could not be completed due to insufficient stock levels
    InternalServerError:
      description: Internal server error. There was a system failure in the platform.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal-server-error:
              value:
                errors:
                - title: Internal Server Error
                  status: '500'
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer