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

# Get purchase by receiptId.

> Returns the purchase data if available.



## OpenAPI

````yaml openapi/purchase-v1.json GET /v1/purchases/{receiptId}
openapi: 3.0.1
info:
  title: PurchaseLoad.Api
  description: "Enabler service for storing POS transactions (purchases). Enables other services to have purchase-triggered logic via subscription\r\n                                        to message broker topic. (e.g. Bonus Calculation service listens to 'PurchaseLoadedEvent' in order to calculate and \r\n                                        load bonus to member's bonus account for each member's purchase. There are separate topics for member and non-member purchases. "
  version: v1
servers:
  - url: https://{host}/purchase
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security: []
paths:
  /v1/purchases/{receiptId}:
    get:
      tags:
        - Purchases
      summary: Get purchase by receiptId.
      description: Returns the purchase data if available.
      parameters:
        - name: receiptId
          in: path
          description: Globally unique purchase ID.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PurchaseLoad.Api.CQRS.Query.GetPurchase_Response
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
components:
  schemas:
    PurchaseLoad.Api.CQRS.Query.GetPurchase_Response:
      required:
        - currencyCode
        - products
        - purchaseBusinessDateTime
        - purchaseDateTimeUtc
        - receiptId
        - storeId
        - totalAmount
        - totalTaxAmount
      type: object
      properties:
        receiptId:
          minLength: 1
          type: string
          description: Globally unique purchase ID.
        storeId:
          minLength: 1
          type: string
          description: Id of store where payment is done.
        memberId:
          type: string
          description: Id of member who performed payment.
          nullable: true
        externalDiscountCardId:
          type: string
          description: "External discount card identifier, which is not linked to the loyalty app.\r\nUsed by customer to apply some fixed discount on the purchase."
          nullable: true
        loyaltyCardId:
          type: string
          description: "Loyalty card identifier.\r\nUsed for member identification in case if memberId is not specified."
          nullable: true
        currencyCode:
          maxLength: 3
          minLength: 3
          type: string
          description: "Local store currency code.\r\nISO-4217 currency code - 3 characters, for example, DKK, ISK, EUR etc."
        totalAmount:
          type: number
          description: "Total price of purchased products with discounts and taxes applied.\r\nCan be negative in case when total price of returned items is greater than total price of purchased items.\r\nDecimal amount with '.' as float separator.\r\n Example: 105.55"
          format: double
        amountForBonusCalculation:
          type: number
          description: "Total amount used for calculating bonus. Doesn't include lottery, bus tickets, tax-free etc.\r\nDecimal amount with '.' as float separator.\r\n Example: 10.25"
          format: double
          nullable: true
        totalTaxAmount:
          type: number
          description: "Total amount of taxes (VAT) included in price.\r\nThis amount should be included in PurchaseLoad.Api.CQRS.Query.GetPurchase.Response.TotalAmount.\r\nDecimal amount with '.' as float separator."
          format: double
        purchaseDateTimeUtc:
          type: string
          description: "Date and time of the purchase in UTC.\r\n Example:'2020-04-14T11:00:00Z'."
          format: date-time
        purchaseBusinessDateTime:
          type: string
          description: "Date and time of the purchase in store local timezone.\r\n Example:'2020-04-14T13:00:00'."
          format: date-time
        paymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseLoad.Contract.Common.PaymentMethod'
          description: All payment methods which user used to cover the purchase.
          nullable: true
        products:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseLoad.Contract.Common.Product'
          description: The list of purchased products.
        discounts:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseLoad.Contract.Common.Discount'
          description: "List of discounts applied to purchase/products.\r\nOptional. If no discounts were applied it should be missed."
          nullable: true
        taxes:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseLoad.Contract.Common.Tax'
          description: List of summarized tax details.
          nullable: true
        shipping:
          $ref: '#/components/schemas/PurchaseLoad.Contract.Common.ShippingInfo'
        paymentLocation:
          type: string
          description: The place where the purchase was made.
          nullable: true
        checkoutType:
          $ref: '#/components/schemas/PurchaseLoad.Contract.Common.CheckoutType'
        metadata:
          type: object
          additionalProperties: {}
          description: Customer specific fields
          nullable: true
        posId:
          type: string
          description: Id of POS where payment was done
          nullable: true
        phone:
          type: string
          description: Member's phone number
          nullable: true
        withFailedValidation:
          type: boolean
          description: >-
            Indicates the purchase was not stored due to failed validation, but
            was saved for receipt display.
          nullable: true
      additionalProperties: false
    LoopFoundation.Commons.Contracts.WebServiceError:
      required:
        - message
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        message:
          minLength: 1
          type: string
        details:
          nullable: true
      additionalProperties: false
    PurchaseLoad.Contract.Common.PaymentMethod:
      type: object
      properties:
        amount:
          type: number
          format: double
        currencyCode:
          type: string
          nullable: true
        conversionRate:
          type: number
          format: double
          nullable: true
        paymentType:
          $ref: '#/components/schemas/PurchaseLoad.Contract.Common.PaymentType'
        cardPan:
          type: string
          nullable: true
        rounding:
          type: number
          format: double
          nullable: true
        displayName:
          type: string
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
      additionalProperties: false
    PurchaseLoad.Contract.Common.Product:
      type: object
      properties:
        id:
          type: string
          nullable: true
        sequenceNumber:
          type: integer
          format: int32
        name:
          type: string
          nullable: true
        categoryId:
          type: string
          nullable: true
        originalReceiptId:
          type: string
          nullable: true
        disposalItem:
          $ref: '#/components/schemas/PurchaseLoad.Contract.Common.DisposalItem'
        unitPrice:
          type: number
          format: double
          nullable: true
        quantity:
          $ref: '#/components/schemas/PurchaseLoad.Contract.Common.Quantity'
        originalPrice:
          type: number
          format: double
        price:
          type: number
          format: double
        isReturned:
          type: boolean
          nullable: true
        isCancelled:
          type: boolean
          nullable: true
        taxIncludedInPrice:
          type: boolean
          nullable: true
        taxes:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseLoad.Contract.Common.Tax'
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
        discountAllocations:
          type: array
          items:
            $ref: >-
              #/components/schemas/PurchaseLoad.Contract.Common.DiscountAllocation
          nullable: true
      additionalProperties: false
    PurchaseLoad.Contract.Common.Discount:
      type: object
      properties:
        sequenceNumber:
          type: integer
          format: int32
          nullable: true
        name:
          type: string
          nullable: true
        totalDiscountAmount:
          type: number
          format: double
        couponId:
          type: string
          nullable: true
          deprecated: true
        couponIds:
          type: array
          items:
            type: string
          nullable: true
        appliedProducts:
          type: array
          items:
            type: integer
            format: int32
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
      additionalProperties: false
    PurchaseLoad.Contract.Common.Tax:
      type: object
      properties:
        type:
          type: string
          nullable: true
        taxableAmount:
          type: number
          format: double
          nullable: true
        amount:
          type: number
          format: double
        percentage:
          type: number
          format: double
          nullable: true
      additionalProperties: false
    PurchaseLoad.Contract.Common.ShippingInfo:
      type: object
      properties:
        refundAsBonus:
          type: boolean
        totalAmount:
          type: number
          format: double
      additionalProperties: false
    PurchaseLoad.Contract.Common.CheckoutType:
      enum:
        - Pos
        - SelfCheckout
        - ScanAndPay
        - Online
      type: string
    PurchaseLoad.Contract.Common.PaymentType:
      enum:
        - Card
        - Cash
        - LoyaltyApp
        - Other
      type: string
    PurchaseLoad.Contract.Common.DisposalItem:
      type: object
      properties:
        name:
          type: string
          nullable: true
        unitPrice:
          type: number
          format: double
        quantity:
          $ref: '#/components/schemas/PurchaseLoad.Contract.Common.Quantity'
        totalAmount:
          type: number
          format: double
      additionalProperties: false
    PurchaseLoad.Contract.Common.Quantity:
      type: object
      properties:
        unitOfMeasure:
          type: string
          nullable: true
        value:
          type: number
          format: double
      additionalProperties: false
    PurchaseLoad.Contract.Common.DiscountAllocation:
      type: object
      properties:
        discountSequenceNumber:
          type: integer
          format: int32
        discountAmount:
          type: number
          format: double
      additionalProperties: false

````