Coins.ph Order History API

Order history and details

OpenAPI Specification

coinsph-order-history-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: TRADING Account Order History API
  version: 1.0.0
  description: API reference for Account management — Coins.ph
servers:
- url: https://api.pro.coins.ph
  description: Production
- url: https://api.9001.pl-qa.coinsxyz.me
  description: Sandbox
tags:
- name: Order History
  description: Order history and details
paths:
  /openapi/fiat/v1/details:
    get:
      tags:
      - Order History
      summary: Get Order Details
      description: Retrieves information about a specific fiat currency order.
      operationId: getOrderDetails
      parameters:
      - name: internalOrderId
        in: query
        required: true
        schema:
          type: string
        description: ID of the order for which the user wishes to retrieve details.
      - name: recvWindow
        in: query
        required: false
        schema:
          type: integer
          format: int64
        description: Validity duration of the request in milliseconds after the timestamp.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/FiatBaseResponse'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/OrderDetailsResponse'
  /openapi/fiat/v2/history:
    post:
      tags:
      - Order History
      summary: Fiat Order History V2 (USER_DATA)
      description: 'This endpoint is used to query all fiat related history.


        **Weight:** 1


        Parameters are passed as a JSON body.'
      operationId: getFiatOrderHistoryV2
      parameters:
      - name: timestamp
        in: query
        required: true
        schema:
          type: integer
          format: int64
        description: Unix timestamp in milliseconds.
      - name: signature
        in: query
        required: true
        schema:
          type: string
        description: HMAC-SHA256 signature.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                pageNum:
                  type: string
                  description: Page number default 1.
                  example: '1'
                pageSize:
                  type: string
                  description: Page size, default 10.
                  example: '10'
                externalOrderId:
                  type: string
                  description: Coins internal ID.
                internalOrderId:
                  type: string
                  description: The unique order id generated by the server.
                transactionType:
                  type: string
                  description: 'Order Transaction Type 1: cash-in, -1: cash-out.'
                  example: '1'
                transactionChannel:
                  type: string
                  description: Transaction channel, the optional values are INSTAPAY, SWIFTPAY_PESONET.
                  example: INSTAPAY
                transactionSubject:
                  type: string
                  description: Secondary channels, such as Gcash supported under instapay.
                status:
                  type: string
                  enum:
                  - PENDING
                  - SUCCEEDED
                  - FAILED
                  - CANCEL
                  description: 'Indicates the current state of the order.

                    - PENDING: The order is still being processed and is not in a final state.

                    - SUCCEEDED: The order has been successfully processed.

                    - FAILED: The order processing has failed.

                    - CANCEL: The order has been canceled by the user and is considered equivalent to a failure.


                    Only orders in a final state (SUCCEEDED, FAILED, or CANCEL) are considered complete and reliable for further actions. Avoid relying on orders in a non-final state (PENDING) as their status may change.'
                fiatCurrency:
                  type: string
                  description: Fiat currency.
                  example: PHP
                startDate:
                  type: string
                  description: The order's create time will be between startDate and endDate. Accepts ISO 8601 format (UTC) (e.g., "2016-10-20T13:00:00.000000Z") or a time delta (e.g., "1w 3d 2h 32m 5s").
                  example: '2023-07-01T00:00:00.000000Z'
                endDate:
                  type: string
                  description: The order's create time will be between startDate and endDate. Accepts ISO 8601 format (UTC) (e.g., "2016-10-20T13:00:00.000000Z") or a time delta (e.g., "1w 3d 2h 32m 5s").
                  example: '2023-08-01T00:00:00.000000Z'
                startTime:
                  type: integer
                  format: int64
                  description: The order's create time will be between startTime and endTime. Works when both startDate and endDate are empty. The server time zone is UTC+0.
                endTime:
                  type: integer
                  format: int64
                  description: The order's create time will be between startTime and endTime. Works when both startDate and endDate are empty. The server time zone is UTC+0.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 0
                  error:
                    type: string
                    example: OK
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        externalOrderId:
                          type: string
                          description: Coins internal ID, query not supported yet; ignore it.
                        internalOrderId:
                          type: string
                          description: The unique order id generated by the server.
                        paymentOrderId:
                          type: string
                          description: The payment order id generated by the channel.
                        fiatCurrency:
                          type: string
                          description: PHP as it is the only currency currently supported.
                        fiatAmount:
                          type: string
                          description: The order amount.
                        transactionType:
                          type: string
                          description: 1 mean cash in, -1 mean cash out.
                        transactionChannel:
                          type: string
                          description: The first-level channel to order it belongs.
                        transactionSubject:
                          type: string
                          description: The channel code of order.
                        transactionSubjectType:
                          type: string
                          description: Channel type.
                        transactionChannelName:
                          type: string
                          description: First level channel Name.
                        transactionSubjectName:
                          type: string
                          description: Channel Name.
                        feeCurrency:
                          type: string
                          description: PHP as it is the only currency currently supported.
                        channelFee:
                          type: string
                          description: The fee of order always 0. Deprecated, see platformFee.
                        platformFee:
                          type: string
                          description: The fee of order.
                        status:
                          type: string
                          enum:
                          - PENDING
                          - SUCCEEDED
                          - FAILED
                          - CANCEL
                          description: 'Indicates the current state of the order.

                            - PENDING: The order is still being processed and is not in a final state.

                            - SUCCEEDED: The order has been successfully processed.

                            - FAILED: The order processing has failed.

                            - CANCEL: The order has been canceled by the user and is considered equivalent to a failure.


                            Only orders in a final state (SUCCEEDED, FAILED, or CANCEL) are considered complete and reliable for further actions. Avoid relying on orders in a non-final state (PENDING) as their status may change.'
                        errorCode:
                          type: string
                          description: Order fail with errorCode.
                        errorMessage:
                          type: string
                          description: Order fail with error message.
                        completedTime:
                          type: string
                          description: The time of order completed.
                        source:
                          type: string
                          description: Order create client Type, such as WEB, ANDROID, IOS, open-api.
                        createdAt:
                          type: string
                          description: The time of order created.
                        orderExtendedMap:
                          type: object
                          description: The order extend data.
                        dealCancel:
                          type: boolean
                          description: If order can be canceled, value will be true.
                  total:
                    type: integer
                    description: Total number of records.
                    example: 2
              example:
                status: 0
                error: OK
                data:
                - externalOrderId: '1476829580936625682'
                  internalOrderId: '1476829580936625681'
                  paymentOrderId: 000008
                  fiatCurrency: PHP
                  fiatAmount: '11111'
                  transactionType: 1
                  transactionChannel: INSTAPAY
                  transactionSubject: allbank
                  transactionChannelName: instapay
                  transactionSubjectName: AllBank (A Thrift Bank), Inc.
                  transactionSubjectType: bank
                  feeCurrency: PHP
                  channelFee: '0'
                  platformFee: '0'
                  status: SUCCEEDED
                  errorCode: SUCCEEDED
                  errorMessage: ''
                  completedTime: '2023-07-31T07:16:47.000+00:00'
                  source: WEBHOOK
                  createdAt: '2023-07-31T07:16:46.000+00:00'
                  orderExtendedMap:
                    channelReferenceNo: 000008
                    senderAccountNumber: '8613989193526'
                  dealCancel: false
                - externalOrderId: '1476829580936625686'
                  internalOrderId: '1474038775754799133'
                  paymentOrderId: '2023072799'
                  fiatCurrency: PHP
                  fiatAmount: '100'
                  transactionType: 1
                  transactionChannel: SWIFTPAY_PESONET
                  transactionSubject: aub
                  transactionChannelName: swiftpay_pesonet
                  transactionSubjectName: Asia United Bank
                  transactionSubjectType: e-wallet
                  feeCurrency: PHP
                  channelFee: '0'
                  platformFee: '10'
                  status: SUCCEEDED
                  errorCode: SUCCEEDED
                  errorMessage: ''
                  completedTime: '2023-07-27T10:52:41.000+00:00'
                  source: WEBHOOK
                  createdAt: '2023-07-27T10:52:40.000+00:00'
                  orderExtendedMap:
                    channelReferenceNo: 000008
                    senderAccountNumber: '8613989193526'
                  dealCancel: false
                total: 2
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - invalid or missing API key
        '500':
          description: Internal server error
components:
  schemas:
    FiatBaseResponse:
      type: object
      properties:
        status:
          type: integer
          description: 0 = success, non-zero = error code
          example: 0
        error:
          type: string
          example: OK
        params:
          type: object
          nullable: true
    OrderExtendedMap:
      type: object
      additionalProperties: true
      description: Extended order data, key-value pairs providing additional transaction details.
      properties:
        channelReferenceNo:
          type: string
          nullable: true
          description: Channel reference number.
          example: 000008
        senderAccountNumber:
          type: string
          nullable: true
          description: Sender's account number.
          example: '8613989193526'
        recipientName:
          type: string
          nullable: true
          description: Recipient's name.
          example: sandyopenapitest
        recipientAccountNumber:
          type: string
          nullable: true
          description: Recipient's account number.
          example: '123456789'
        recipientAddress:
          type: string
          nullable: true
          description: Recipient's address.
          example: 123 Main St, Mandaluyong
        remarks:
          type: string
          nullable: true
          description: Remarks or notes for the transaction.
          example: Payment for services
    OrderDetailsResponse:
      type: object
      properties:
        externalOrderId:
          type: string
        internalOrderId:
          type: string
        paymentOrderId:
          type: string
        fiatCurrency:
          type: string
        fiatAmount:
          type: string
        transactionType:
          type: integer
          description: 1 = cash in, -1 = cash out
        transactionChannel:
          type: string
        transactionSubject:
          type: string
        transactionSubjectType:
          type: string
        transactionChannelName:
          type: string
        transactionSubjectName:
          type: string
        feeCurrency:
          type: string
        channelFee:
          type: string
          deprecated: true
          description: Deprecated, see platformFee.
        platformFee:
          type: string
        status:
          type: string
          enum:
          - PENDING
          - SUCCEEDED
          - FAILED
          - CANCEL
        errorCode:
          type: string
        errorMessage:
          type: string
        completedTime:
          type: string
        source:
          type: string
          description: 'Order creation source: WEB, ANDROID, IOS, open-api'
        createdAt:
          type: string
        orderExtendedMap:
          $ref: '#/components/schemas/OrderExtendedMap'
        dealCancel:
          type: boolean
          description: If the order can be canceled.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-COINS-APIKEY
x-readme:
  proxy-enabled: false