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

# Inquiry Payment

> Poll a payment to retrieve its latest status.



## OpenAPI

````yaml POST /v1/payments/inquiryPayment
openapi: 3.0.3
info:
  title: Rebell Payments API
  version: 0.2.0-draft
  description: >

    OpenAPI derived from "Rebell API Specifications – (Draft for estimate
    integration)".

    This spec covers authentication headers (RSA SHA256 signature), payment
    creation, inquiry, retail pay,

    and webhook notification payloads.


    ---

    ## Swagger UI local setup (dynamic headers)

    This API requires `Request-Time` (RFC 3339) and an RSA-SHA256 `Signature`
    computed **at request time** over:


    ```text

    METHOD + "\n" + HTTP_URI + "\n" + Client-Id + "\n" + Request-Time + "\n" +
    BODY

    ```


    **Recommended pattern (no cloud):**

    - Serve this spec with Swagger UI locally.

    - Use a `requestInterceptor` to set `Client-Id`, compute fresh
    `Request-Time`, and call a **local signer** (running on localhost) to
    produce the base64 signature.

    - Inject the resulting header: `Signature: algorithm=SHA256withRSA,
    keyVersion={keyVersion}, signature={base64}`.


    See `x-swagger-ui-requestInterceptor` in this spec for a drop-in snippet and
    the minimal Node.js signer.



    ### Note on Swagger UI layouts

    If you see `No layout defined for "StandaloneLayout"`, either:

    - include `SwaggerUIStandalonePreset` in your HTML and set `layout:
    "StandaloneLayout"`, **or**

    - simply use `layout: "BaseLayout"` (this spec's embedded snippet uses
    BaseLayout for compatibility).
servers:
  - url: https://api.rebellapp.com
    description: Production
  - url: https://sandbox-api.rebellapp.com
    description: Sandbox (testing)
security:
  - RebellSignature: []
    ClientId: []
    RequestTime: []
tags:
  - name: Authentication
    description: Signature and headers
  - name: Payments
  - name: Webhooks
paths:
  /v1/payments/inquiryPayment:
    post:
      tags:
        - Payments
      summary: Get Payment Information (Polling)
      operationId: inquiryPayment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InquiryRequest'
            examples:
              example:
                value:
                  paymentId: '20220914595540652867492'
                  paymentRequestId: REQ_abc_123
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InquiryResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - RebellSignature: []
          ClientId: []
          RequestTime: []
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl -X POST https://api.rebellapp.com/v1/payments/inquiryPayment \
              -H "Content-Type: application/json" \
              -H "Client-Id: YOUR_CLIENT_ID" \
              -H "Request-Time: 2024-01-10T12:00:00Z" \
              -H "Signature: algorithm=SHA256withRSA, keyVersion=1, signature=BASE64_SIGNATURE" \
              -d '{
                "paymentId": "20220914595540652867492",
                "paymentRequestId": "REQ_abc_123"
              }'
        - lang: JavaScript
          label: Node.js
          source: >-
            const response = await
            fetch('https://api.rebellapp.com/v1/payments/inquiryPayment', {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json',
                'Client-Id': 'YOUR_CLIENT_ID',
                'Request-Time': new Date().toISOString(),
                'Signature': 'algorithm=SHA256withRSA, keyVersion=1, signature=BASE64_SIGNATURE'
              },
              body: JSON.stringify({
                paymentId: '20220914595540652867492',
                paymentRequestId: 'REQ_abc_123'
              })
            });


            const data = await response.json();

            console.log(data.paymentStatus); // SUCCESS, PROCESSING, or FAIL
        - lang: Python
          label: Python
          source: |-
            import requests

            response = requests.post(
                'https://api.rebellapp.com/v1/payments/inquiryPayment',
                headers={
                    'Content-Type': 'application/json',
                    'Client-Id': 'YOUR_CLIENT_ID',
                    'Request-Time': '2024-01-10T12:00:00Z',
                    'Signature': 'algorithm=SHA256withRSA, keyVersion=1, signature=BASE64_SIGNATURE'
                },
                json={
                    'paymentId': '20220914595540652867492',
                    'paymentRequestId': 'REQ_abc_123'
                }
            )

            data = response.json()
            print(data['paymentStatus'])  # SUCCESS, PROCESSING, or FAIL
components:
  schemas:
    InquiryRequest:
      type: object
      description: Provide either paymentId or paymentRequestId (at least one required).
      properties:
        paymentId:
          type: string
          description: Wallet-generated payment ID.
        paymentRequestId:
          type: string
          description: Merchant-provided idempotency key from the original payment request.
    InquiryResponse:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/Result'
        paymentId:
          type: string
        paymentRequestId:
          type: string
        paymentStatus:
          type: string
          enum:
            - SUCCESS
            - PROCESSING
            - FAIL
        paymentTime:
          type: string
          format: date-time
        paymentAmount:
          $ref: '#/components/schemas/Amount'
      required:
        - result
        - paymentStatus
    ErrorResponse:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/Result'
      required:
        - result
    Result:
      type: object
      properties:
        resultStatus:
          type: string
          enum:
            - S
            - F
            - U
            - A
        resultCode:
          type: string
        resultMessage:
          type: string
      required:
        - resultStatus
    Amount:
      type: object
      properties:
        currency:
          type: string
        value:
          type: integer
      required:
        - currency
        - value
      description: Amount in minor units (e.g., cents).
  securitySchemes:
    RebellSignature:
      type: apiKey
      in: header
      name: Signature
      description: >-
        RSA SHA256 signature header. Example: `Signature:
        algorithm=SHA256withRSA, keyVersion=0, signature=BASE64...`
    ClientId:
      type: apiKey
      in: header
      name: Client-Id
      description: Rebell-assigned Client Id.
    RequestTime:
      type: apiKey
      in: header
      name: Request-Time
      description: RFC3339 timestamp (e.g., 2019-05-28T12:12:00+08:00).

````