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

# Query Order

> Query order data by order id



## OpenAPI

````yaml /openapi.yml get /api/v2/orders/{orderId}
openapi: 3.0.3
info:
  title: Gateway API
  version: v2
  contact:
    name: Support
    email: support@paybyrd.com
  license:
    name: Copyright © Paybyrd
  termsOfService: https://paybyrd.com/en/privacy
servers:
  - url: https://gateway.paybyrd.com
    description: Production
security:
  - authByApiKey: []
paths:
  /api/v2/orders/{orderId}:
    get:
      tags:
        - Orders
      summary: Query Order
      description: Query order data by order id
      operationId: api-orders-query
      parameters:
        - name: orderId
          in: path
          description: The order identifier generated by Paybyrd.
          schema:
            type: string
          required: true
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  $ref: '#/components/examples/OrderQueryResponseExample'
              schema:
                $ref: '#/components/schemas/OrderQueryResponse'
      deprecated: false
components:
  examples:
    OrderQueryResponseExample:
      description: This is an example of how the order response is returned
      value:
        orderId: 63a8a157-81c9-46ea-84b4-2bef6daad3fa
        orderDate: '2021-08-24T17:45:27Z'
        expiresAt: '2021-08-25T17:45:27Z'
        status: paid
        isoAmount: 5000
        currency: EUR
        orderRef: ABC123456
        shopper:
          shopperId: 676b5023-9624-4d19-bdd2-c61b1be803b7
          firstName: JHOSH
          lastName: JONES
          email: jhoshjs@dominio.com
          phoneCountryCode: 351
          phoneNumber: '123123123'
          ip: 111.111.111.111
        orderOptions:
          redirectUrl: https://your-site-url/payment-finished
          culture: en-US
          checkoutVersion: 2
          expiresIn: '00:15:00'
        paymentOptions:
          maxAttempts: 1
          sessionExpiresIn: '00:10:00'
          allowedPaymentMethods:
            - CARD
            - SIBS_MULTIBANCO
            - SEPA
            - IDEAL
            - MBWAY
          cardOptions:
            isPreAuth: false
          tokenOptions:
            customReference: ABC123456
            tokenizationIsRequired: false
            tokenizationMethod: cardOnFile
        index: 1
        transactions:
          currency: AOA
          orderRef: AMZ1962
          brand: MULTICAIXAEXPRESS
          operationType: Payment
          status: Success
          createdDate: '2021-05-31T22:01:57Z'
          transactionDate: '2021-05-31T22:01:57Z'
          initiatedFrom: HostedForm
          personId: 10
          index: 2
          externalSessionIdentifier: 20c7c4b3-95cc-4ead-aa0b-918b634df05a,
          externalTransactionIdentifier: 430f4c76-4eb8-40e0-bc80-562b2960a83f,
          externalCustomIdentifier: c9a625d4-d968-47a0-b237-e5d4f31dfcd4
          transactionId: c9a625d4-d968-47a0-b237-e5d4f31dfcd4
          amount: '300.10'
          multicaixaExpress:
            deeplink: >-
              mcxwallet://purchase?qrref=000201010212260700032205203742530497325406300.105802AO5908ProxyPay6006Luanda61081000-10062430532fe4eeddd078343c391d6d10721233a3207034446304F577
            deeplinkRedirect: >-
              https://api.sandbox.proxypay.co.ao/deeplink/LTvDt6U2WiFU0Ds_TScsbSbULbbCIbB2zrZsAS3r96hqDKVFMDAwMjAxMDEwMjEyMjYwNzAwMDMyMjA1MjAzNzQyNTMwNDk3MzI1NDA2MzAwLjEwNTgwMkFPNTkwOFByb3h5UGF5NjAwNkx1YW5kYTYxMDgxMDAwLTEwMDYyNDMwNTMyZmU0ZWVkZGQwNzgzNDNjMzkxZDZkMTA3MjEyMzNhMzIwNzAzNDQ0NjMwNEY1Nzc=
            qrCodeUrl: >-
              https://api.sandbox.proxypay.co.ao/qrcode/LTvDt6U2WiFU0Ds_TScsbSbULbbCIbB2zrZsAS3r96hqDKVFMDAwMjAxMDEwMjEyMjYwNzAwMDMyMjA1MjAzNzQyNTMwNDk3MzI1NDA2MzAwLjEwNTgwMkFPNTkwOFByb3h5UGF5NjAwNkx1YW5kYTYxMDgxMDAwLTEwMDYyNDMwNTMyZmU0ZWVkZGQwNzgzNDNjMzkxZDZkMTA3MjEyMzNhMzIwNzAzNDQ0NjMwNEY1Nzc=
            expiresAt: '2026-05-19T18:00:37'
  schemas:
    OrderQueryResponse:
      type: object
      properties:
        orderId:
          type: string
          description: This field contains the unique identifier that represents the order.
          format: guid
          example: e901d7fa-a41a-4c93-bc53-7a08cd72aff4
        isoAmount:
          type: integer
          description: Total amount for this order
          format: int64
        amount:
          type: string
          description: Total amount for this order, with the following pattern "0.00"
          example: '25.00'
        currency:
          type: string
          description: Valid ISO-4217 alpha code e.g EUR
          example: EUR
        orderRef:
          type: string
          description: Merchant reference for this order
          example: ABC123456
        status:
          $ref: '#/components/schemas/OrderStatus'
        orderDate:
          type: string
          description: Order creation date in UTC
          example: '2021-05-31T22:04:31Z'
        expiresAt:
          type: string
          description: Order expiration date in UTC
          example: '2021-05-31T22:04:31Z'
        canceledAt:
          type: string
          description: Order cancellation date in UTC
          example: '2021-05-31T22:04:31Z'
        lastTransactionId:
          type: string
          description: Identifier of the last transaction processed for this order
          example: 1c5a405d-1525-4ded-ae5b-d7dfded4a194
          format: guid
        refundedAmount:
          type: string
          description: >-
            Total refunded amount for this order, with the following pattern
            "0.00" 
          example: '25.00'
        shopper:
          $ref: '#/components/schemas/OrderShopper'
        orderOptions:
          $ref: '#/components/schemas/OrderOptions'
        paymentOptions:
          $ref: '#/components/schemas/PaymentOptions'
        index:
          type: integer
        transactions:
          $ref: '#/components/schemas/ReferencedTransactionResponse'
    OrderStatus:
      type: string
      description: >-
        Represents the status of the order.

        Created - Order has no payments associated to it or all payment attempts
        have failed.

        Pending - Order has a payment associated to it which is in progress but
        not concluded.

        Paid - Order has a payment associated to it with final status 'Success'.

        Canceled - This status can occur by system routines, shopper action by
        clicking on 'cancel payment' button in the hosted page or by calling the
        order cancel endpoint.

        Expired - This status occurs by system routines that checks for payment
        abandonment or in case an expiration date is sent in the create order
        request.

        Refunded - In case a successful payment is refunded, its order will have
        the 'Refunded' status.
      example: created
      enum:
        - created
        - paid
        - pending
        - refunded
        - canceled
        - expired
    OrderShopper:
      type: object
      properties:
        shopperId:
          type: string
          description: >-
            This field contains the unique identifier generated by Paybyrd and
            it is returned in the API response
          format: guid
          example: e901d7fa-a41a-4c93-bc53-7a08cd72aff4
          readOnly: true
        email:
          type: string
          description: The shopper's email address
          format: email
          example: shopper_email@mail.com
        firstName:
          type: string
          description: The shopper's first name
          example: Peter
        lastName:
          type: string
          description: The shopper's last name
          example: Park
        birthName:
          type: string
          description: The shopper's birth name
        birthDate:
          type: string
          description: The The shopper's birth date
          example: '1985-05-31'
        birthPostalCode:
          type: string
          description: The shopper's postal code associated with the birth address
        customReference:
          type: string
          description: A custom reference to the shopper
        civility:
          type: string
          description: The civility or title of the shopper
          example: Mr, Mrs, Ms
        phoneCountryCode:
          type: integer
          description: The shopper's phone country code
          format: int32
          example: 351
        phoneNumber:
          type: string
          description: The shopper's phone number without country code
          example: '123123123'
          maximum: 20
        shippingAddress:
          type: string
          description: The shopper's shipping address
        shippingPostalCode:
          type: string
          description: The shopper's shipping postal code
        shippingCity:
          type: string
          description: The shopper's shipping city
        shippingCountry:
          type: string
          description: The shopper's shipping country valid ISO-3166 alpha-3 code
          example: PRT
        shippingState:
          type: string
          description: The state or province of the shopper's shipping address
          example: SP
          maximum: 2
        shippingType:
          type: string
          description: The shopper's shipping type
          example: National, International, UrgentNational, UrgentInternational
        homeAddress:
          type: string
          description: The shopper's home address
        homePostalCode:
          type: string
          description: The postal code of the shopper's home address
        homeCity:
          type: string
          description: The city of the shopper's home address
        homeCountry:
          type: string
          description: The country of the shopper's home address
          example: PRT
        ipAddress:
          type: string
          description: The shopper's IP address
          format: 192.168.0.1
        documentNumber:
          type: string
          description: The shopper's document number
          example: ID card number, passport number...
        firstPurchaseDate:
          type: string
          description: The date and time of the first purchase made by the shopper
          example: '2021-05-10T12:30:00Z'
        lastPurchaseDate:
          type: string
          description: The date and time of the last purchase made by the shopper
          example: '2021-12-19T19:30:00Z'
    OrderOptions:
      type: object
      description: Defines settings for this order
      properties:
        redirectUrl:
          type: string
          description: >-
            This is the URL which the shopper will be redirected to after
            payment is concluded in Paybyrd Checkout. We will always concatenate
            relevant information of the payment as query string parameters in
            the URL provided.  The transactionId and orderId will always be
            available, so you can use this data to query the status of the order
            after redirection.
          example: https://your-site-url/payment-finished
          format: url
        culture:
          type: string
          description: >-
            The order culture defines which language will be used to present the
            order information to the customer.
          example: en-US
        expiresIn:
          type: string
          description: >-
            The order will expire according to the value given passed in this
            field in case its status is 'Created'.  In case you also send
            'sessionExpiresIn' in the request, the final expiration time will be
            the sum of both.
          format: timespan
          example: '00:15:00'
        notifyBy:
          type: object
          description: >-
            This is Paybyrd's paybylink feature. When 'notifyBy' is provided, a
            payment link will be sent to the channels defined inside this
            object.
          properties:
            email:
              type: object
              properties:
                address:
                  type: string
                  description: The email which the payment link will be sent to.
                  format: email
                  example: shopper_email@mail.com
            sms:
              type: object
              properties:
                phoneCountryCode:
                  type: integer
                  description: The phone country code which the link will be sent to.
                  format: int32
                  example: 351
                PhoneNumber:
                  type: string
                  description: The phone number which the link will be sent to.
                  example: '123123123'
                  maximum: 20
            whatsapp:
              type: object
              properties:
                phoneCountryCode:
                  type: integer
                  description: The phone country code which the link will be sent to.
                  format: int32
                  example: 351
                PhoneNumber:
                  type: string
                  description: The phone number which the link will be sent to.
                  example: '123123123'
                  maximum: 20
        checkoutVersion:
          type: integer
          description: >-
            Defines the Checkout version to be used for this order. Version 1
            uses the legacy hosted form, version 2 uses the new Checkout.
          enum:
            - 1
            - 2
          example: 2
    PaymentOptions:
      type: object
      description: Defines settings for payment.
      properties:
        maxAttempts:
          type: integer
          description: >-
            Indicates the max number of attempts that the shopper has to
            conclude the payment in Paybyrd Checkout. 
          format: int32
          example: 3
        sessionExpiresIn:
          type: string
          description: >-
            Defines the time that the shopper has to initiate the payment once
            the Checkout is open. Session restarts whenever the hosted page is
            closed and opened again.
          format: timespan
          example: '00:15:00'
        allowedPaymentMethods:
          type: array
          description: >-
            Indicates which payment methods will be available for the shopper to
            choose in Paybyrd Checkout form.
          items:
            $ref: '#/components/schemas/PaymentMethod'
          example:
            - CARD
            - MBWAY
        cardOptions:
          type: object
          properties:
            isPreAuth:
              type: boolean
              description: >-
                Indicates whether the payment will be processed as a
                pre-authorization or not if paid with card
        tokenOptions:
          type: object
          description: Defines the payment tokenization settings.
          required:
            - customReference
          properties:
            customReference:
              type: string
              description: >-
                Custom reference serves as a virtual wallet or identifier that
                allows you to group and manage multiple tokenized cards When an
                order is created using the custom reference, all the tokenized
                cards associated with that reference will be displayed in
                Paybyrd Checkout, allowing the customer to choose which
                tokenized card they want to use for the transaction. If there
                are no tokenized cards associated with the provided custom
                reference, the Paybyrd system will tokenize the payment card
                chosen by the shopper.
              maximum: 50
              example: ABC123456789
            tokenizationIsRequired:
              type: boolean
              description: >-
                Indicates whether the tokenization of the card payment is
                mandatory or not for the transaction. 
              example: false
            tokenizationMethod:
              type: string
              description: >-
                The value indicates what type of tokenization method should be
                used. At the moment, only card type payments can generate
                tokens. The value "cardOnFile" is generally used for one-click
                payment scenarios. The value "subscription' is used for
                recurring payments.
              enum:
                - cardOnFile
                - subscription
    ReferencedTransactionResponse:
      type: array
      items:
        type: object
        properties:
          transactionId:
            type: string
            description: The unique identifier of the transaction.
            example: c9a625d4-d968-47a0-b237-e5d4f31dfcd4
            format: guid
          attempt:
            type: integer
            description: >-
              The number of attempt that this transaction represents when
              associated to an order
            example: 1
            format: int32
          index:
            type: integer
            description: >-
              The position of this transaction in the list. You can order by
              this property if needed.
            example: 1
          amount:
            type: string
            description: The transaction amount.
            example: '13.00'
          isoAmount:
            type: integer
            description: The transaction amount.
            example: 1300
            format: int64
          acquirer:
            $ref: '#/components/schemas/Acquirer'
          brand:
            $ref: '#/components/schemas/Brand'
          paymentMethod:
            $ref: '#/components/schemas/PaymentMethod'
          capturedDate:
            type: string
            example: '2021-05-31T22:04:31Z'
          createdDate:
            type: string
            example: '2021-05-31T22:01:57Z'
          initiatedFrom:
            $ref: '#/components/schemas/PaymentMethod'
          currency:
            type: string
            example: EUR
          externalCustomIdentifier:
            type: string
            example: c9a625d4-d968-47a0-b237-e5d4f31dfcd4
          operationType:
            type: string
            example: PreAuth
          orderRef:
            type: string
            example: AMZ1962
          personId:
            type: integer
            example: 10
            default: 0
          status:
            type: string
            example: Paid
          subscriptionGuid:
            type: string
            example: 5b16391d-b8b8-45c9-8aa3-4f6f3ce5a656
          terminalId:
            type: string
            example: EM30X4X5X0
          transactionDate:
            type: string
            example: '2021-05-31T22:01:57Z'
          multicaixaExpress:
            type: object
            description: >-
              Multicaixa Express payment details. Only present when the
              transaction brand is MULTICAIXAEXPRESS.
            properties:
              deeplink:
                type: string
                format: uri
                description: Direct deeplink for the MultiCaixa Express app.
                example: >-
                  mcxwallet://purchase?qrref=000201010212260700032205203742530497325406300.105802AO5908ProxyPay6006Luanda61081000-10062430532fe4eeddd078343c391d6d10721233a3207034446304F577
              deeplinkRedirect:
                type: string
                format: uri
                description: >-
                  Redirect URL for mobile and browser flows to the MultiCaixa
                  Express app.
                example: >-
                  https://api.sandbox.proxypay.co.ao/deeplink/LTvDt6U2WiFU0Ds_TScsbSbULbbCIbB2zrZsAS3r96hq...
              qrCodeUrl:
                type: string
                format: uri
                description: QR Code image URL.
                example: >-
                  https://api.sandbox.proxypay.co.ao/qrcode/LTvDt6U2WiFU0Ds_TScsbSbULbbCIbB2zrZsAS3r96hq...
              expiresAt:
                type: string
                format: date-time
                description: Payment expiration timestamp in ISO 8601 format.
                example: '2026-05-19T18:00:37'
    PaymentMethod:
      type: string
      description: Represents the payment method of the transaction.
      example: CARD
      enum:
        - CARD
        - MBWAY
        - SIBS_MULTIBANCO
        - IDEAL
        - PAYPAL
        - MULTICAIXA_REF
        - SEPA
        - FLOA1XD
        - FLOA3X
        - FLOA4X
    Acquirer:
      type: string
      description: Indicates which acquirer the transaction was processed
      example: VALITOR
      enum:
        - SIBS
        - VALITOR
        - BAMBORA
        - PPRO
        - PAYPAY
        - REDE
        - PROXYPAY
        - PAYPAL
        - PAYWORKS
        - FLOA
        - SIMULATED
    Brand:
      type: string
      description: Represents the payment method brand of the transaction.
      example: VISA
      enum:
        - VISA
        - MASTER
        - AMEX
        - DINERS
        - DISCOVER
        - JCB
        - ELO
        - VPAY
        - DANKORT
        - MBWAY
        - SIBS_MULTIBANCO
        - IDEAL
        - PAYPAL
        - MULTICAIXA_REF
        - SEPA
        - FLOA1XD
        - FLOA3X
        - FLOA4X
  securitySchemes:
    authByApiKey:
      type: apiKey
      in: header
      name: x-api-key

````