> ## 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.

# Create QR Order

> Initiate online payment with a merchant-presented QR code.



## OpenAPI

````yaml POST /v1/payments/createQROrder
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/createQROrder:
    post:
      tags:
        - Payments
      summary: Initiate Online Payment with QR Code (Merchant Presented QR)
      operationId: createQROrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQROrderRequest'
            examples:
              example:
                value:
                  bizType: ORDER_CODE
                  productCode: '51051000101000100048'
                  codeType: CGCP
                  paymentRequestId: '20220914595540652867492'
                  paymentAmount:
                    currency: EUR
                    value: 1000
                  order:
                    orderDescription: Latte x2
                    orderMemo: No sugar
                    latitude: '45.0703'
                    longitude: '7.6869'
                    transactionAddress: Torino||Corso Duca degli Abruzzi,24||10129||IT||Italy
                    merchant:
                      store:
                        externalStoreId: STORE_001
                  paymentNotifyUrl: https://merchant.example.com/rebell/webhook
                  extendInfo: '{"key":"value"}'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateQROrderResponse'
        '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/createQROrder \
              -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 '{
                "bizType": "ORDER_CODE",
                "productCode": "51051000101000100048",
                "codeType": "CGCP",
                "paymentRequestId": "REQ_abc_123",
                "paymentAmount": {
                  "currency": "EUR",
                  "value": 1000
                },
                "order": {
                  "orderDescription": "Latte x2"
                },
                "paymentNotifyUrl": "https://merchant.example.com/webhook"
              }'
        - lang: JavaScript
          label: Node.js
          source: >-
            const response = await
            fetch('https://api.rebellapp.com/v1/payments/createQROrder', {
              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({
                bizType: 'ORDER_CODE',
                productCode: '51051000101000100048',
                codeType: 'CGCP',
                paymentRequestId: 'REQ_abc_123',
                paymentAmount: { currency: 'EUR', value: 1000 },
                order: { orderDescription: 'Latte x2' },
                paymentNotifyUrl: 'https://merchant.example.com/webhook'
              })
            });


            const data = await response.json();

            console.log(data.qrCode); // Display QR code to customer
        - lang: Python
          label: Python
          source: |-
            import requests

            response = requests.post(
                'https://api.rebellapp.com/v1/payments/createQROrder',
                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={
                    'bizType': 'ORDER_CODE',
                    'productCode': '51051000101000100048',
                    'codeType': 'CGCP',
                    'paymentRequestId': 'REQ_abc_123',
                    'paymentAmount': {'currency': 'EUR', 'value': 1000},
                    'order': {'orderDescription': 'Latte x2'},
                    'paymentNotifyUrl': 'https://merchant.example.com/webhook'
                }
            )

            data = response.json()
            print(data['qrCode'])  # Display QR code to customer
components:
  schemas:
    CreateQROrderRequest:
      type: object
      properties:
        bizType:
          type: string
          enum:
            - ORDER_CODE
        productCode:
          type: string
        codeType:
          type: string
          enum:
            - CGCP
        paymentRequestId:
          type: string
        paymentAmount:
          $ref: '#/components/schemas/Amount'
        order:
          $ref: '#/components/schemas/Order'
        paymentNotifyUrl:
          type: string
          format: uri
        extendInfo:
          type: string
          description: JSON string e.g. {"key":"value"}
      required:
        - bizType
        - productCode
        - paymentRequestId
        - paymentAmount
        - order
    CreateQROrderResponse:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/Result'
        paymentRequestId:
          type: string
        paymentId:
          type: string
        qrCode:
          type: string
      required:
        - result
    ErrorResponse:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/Result'
      required:
        - result
    Amount:
      type: object
      properties:
        currency:
          type: string
        value:
          type: integer
      required:
        - currency
        - value
      description: Amount in minor units (e.g., cents).
    Order:
      type: object
      properties:
        orderDescription:
          type: string
        orderMemo:
          type: string
        latitude:
          type: string
        longitude:
          type: string
        transactionAddress:
          type: string
          description: >-
            Merchant store address separated by '||'. Example: 'Torino||Corso
            Duca degli Abruzzi,24||10129||IT||Italy'
        merchant:
          $ref: '#/components/schemas/Merchant'
      required:
        - orderDescription
    Result:
      type: object
      properties:
        resultStatus:
          type: string
          enum:
            - S
            - F
            - U
            - A
        resultCode:
          type: string
        resultMessage:
          type: string
      required:
        - resultStatus
    Merchant:
      type: object
      properties:
        store:
          $ref: '#/components/schemas/Store'
    Store:
      type: object
      properties:
        externalStoreId:
          type: string
      required:
        - externalStoreId
  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).

````