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

# Retrieve one purchase detail

> This operation will return the purchase detail for given id



## OpenAPI

````yaml purchase-detail get /v1/{id}
openapi: 3.0.3
info:
  description: API to manage purchase details
  version: '1'
  title: Purchase Details API
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
  x-logo:
    url: https://developer.enfuce.com/images/enfuce.svg
    altText: Enfuce logo
servers:
  - url: >-
      https://integration-api-cat2.{{environment}}.ext.{{realm}}.cia.enfuce.com/purchase-detail
  - url: https://integration-api-cat2.live.ext.prod.cia.enfuce.com/purchase-detail
    description: Live environment
security: []
tags:
  - name: Create purchase details
    description: Endpoint for creating purchase details
  - name: Update purchase details
    description: Endpoints for updating purchase details
  - name: Get purchase details
    description: Endpoints for fetching purchase details
  - name: Trigger repricing
    description: Endpoints for triggering repricing
paths:
  /v1/{id}:
    get:
      tags:
        - Get purchase details
      summary: Retrieve one purchase detail
      description: This operation will return the purchase detail for given id
      operationId: retrievePurchaseDetailUsingGET
      parameters:
        - name: id
          in: path
          description: The id of the purchase detail you want to fetch
          required: true
          schema:
            type: string
        - name: auditUser
          in: query
          description: The audit user to log the request
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/fuelPurchaseDetailResponse'
                  - $ref: '#/components/schemas/otherPurchaseDetailResponse'
        '401':
          $ref: '#/components/responses/error401'
        '403':
          $ref: '#/components/responses/error403'
        '404':
          $ref: '#/components/responses/error404'
        '500':
          $ref: '#/components/responses/error500'
      deprecated: false
components:
  schemas:
    fuelPurchaseDetailResponse:
      allOf:
        - $ref: '#/components/schemas/item'
        - $ref: '#/components/schemas/basePurchaseDetailResponse'
    otherPurchaseDetailResponse:
      allOf:
        - $ref: '#/components/schemas/item'
        - $ref: '#/components/schemas/basePurchaseDetailResponse'
    item:
      type: object
      properties:
        amount:
          $ref: '#/components/schemas/money'
          description: Purchase amount of given purchase detail.
        code:
          type: string
          maxLength: 64
          description: >-
            Issuer defined code for purchase detail. Code can e.g. represent a
            product category like “newspapers”. Code is utilised if item is
            processed through repricing.
        description:
          type: string
          maxLength: 255
          description: >-
            Issuer defined description of purchase detail. The description is
            set when creating purchase details and is available when fetching
            purchase details via API and in the invoicing file.
        externalId:
          type: string
          maxLength: 64
          description: >-
            Issuer defined external id. Issuer can store an external id to each
            purchase detail as a common key between Enfuce and issuer systems.
        matchingAttributes:
          type: array
          maxItems: 6
          items:
            $ref: '#/components/schemas/keyValuePair'
          description: >-
            Attributes that enable Enfuce to link purchase detail to a financial
            transaction. The most suitable matching attributes are agreed with
            issuer during implementation.
        promptedData:
          type: array
          items:
            $ref: '#/components/schemas/keyValuePair'
          description: Prompted data linked to the purchase detail
        quantity:
          type: number
          description: >-
            The quantity purchased. This can be a number or in combination with
            unit define e.g. how many liters or kilograms have been purchased.
        transactionId:
          type: string
          maxLength: 64
          description: >-
            Id of the financial transaction the purchase detail is linked to.
            The transactionId is updated by Enfuce after a match is found
            between financial transaction and purchase detail.
        type:
          type: string
          description: The type of item
          enum:
            - FUEL
            - OTHER
        unitPrice:
          type: number
          description: Price per unit
        VAT:
          $ref: '#/components/schemas/VATValues'
          description: The applicable value-add tax of the purchase detail.
        unit:
          type: string
          description: >-
            Unit of measurement of quantity. Obsolete in cases where the
            purchase detail represents one item or a number of the same items.
          enum:
            - KG
            - KWH
            - LITRE
            - GALLON
    basePurchaseDetailResponse:
      allOf:
        - properties:
            id:
              type: string
              description: Unique id that represents this purchase detail
    errorResponse:
      type: object
      properties:
        code:
          type: string
          description: An error code indicating what kind of error. I.e. HTTP error code
        message:
          type: string
          description: Error message in human-readable format
        id:
          type: string
          format: uuid
          description: Unique error identifier
        errorCode:
          type: string
          description: Enfuce code for a specific error type
        errorType:
          type: string
          description: Error type
          enum:
            - STATIC_VALIDATION_ERROR
            - DYNAMIC_VALIDATION_ERROR
            - INTEGRATION_ERROR
            - SECURITY_ERROR
            - UNEXPECTED_ERROR
        errorReason:
          type: string
          description: Free-form text explaing reason of error
        timestamp:
          type: string
          format: date-time
          description: Datetime when error occured
    money:
      description: Amount including currency
      type: object
      properties:
        amount:
          type: number
          example: 3.14
        currency:
          $ref: '#/components/schemas/currency'
    keyValuePair:
      type: object
      required:
        - key
        - value
      properties:
        key:
          maxLength: 64
          type: string
        value:
          maxLength: 64
          type: string
    VATValues:
      type: object
      properties:
        percentage:
          type: number
        amount:
          $ref: '#/components/schemas/money'
    currency:
      type: string
      description: A valid ISO 4217 currency code
      pattern: '[A-Z]{3}'
      example: EUR
  responses:
    error401:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error403:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error404:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error500:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'

````