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

# Link Pay Create

> Create a redirect link for app-to-app or browser-to-app payment flow.



## OpenAPI

````yaml POST /v1/payments/linkPayCreate
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/linkPayCreate:
    post:
      tags:
        - Payments
      summary: Create Link Pay Order (App-to-App or Browser Redirect)
      description: >-
        Create a payment order that returns redirect URLs for app-to-app or
        browser-to-app payment flows. The user is redirected to the Rebell
        SuperApp to authorize the payment.
      operationId: linkPayCreate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkPayCreateRequest'
            examples:
              example:
                value:
                  productCode: '51051000101000100054'
                  paymentRequestId: checkout-20240321-987
                  paymentAmount:
                    currency: EUR
                    value: 499
                  order:
                    orderDescription: Monthly subscription - Premium plan
                    merchant:
                      store:
                        externalStoreId: STORE-77
                  settlementStrategy:
                    settlementCurrency: EUR
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkPayCreateResponse'
        '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/linkPayCreate \
              -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 '{
                "productCode": "51051000101000100054",
                "paymentRequestId": "checkout-20240321-987",
                "paymentAmount": {
                  "currency": "EUR",
                  "value": 499
                },
                "order": {
                  "orderDescription": "Monthly subscription - Premium plan"
                },
                "settlementStrategy": {
                  "settlementCurrency": "EUR"
                }
              }'
        - lang: JavaScript
          label: Node.js
          source: >-
            const response = await
            fetch('https://api.rebellapp.com/v1/payments/linkPayCreate', {
              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({
                productCode: '51051000101000100054',
                paymentRequestId: `checkout-${orderId}-${Date.now()}`,
                paymentAmount: { currency: 'EUR', value: 499 },
                order: { orderDescription: 'Monthly subscription - Premium plan' },
                settlementStrategy: { settlementCurrency: 'EUR' }
              })
            });


            const data = await response.json();

            // Redirect user to Rebell app

            window.location.href = data.appLinks.ios.shortUrl; // or android
        - lang: Python
          label: Python
          source: |-
            import requests

            response = requests.post(
                'https://api.rebellapp.com/v1/payments/linkPayCreate',
                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={
                    'productCode': '51051000101000100054',
                    'paymentRequestId': f'checkout-{order_id}-{int(time.time())}',
                    'paymentAmount': {'currency': 'EUR', 'value': 499},
                    'order': {'orderDescription': 'Monthly subscription - Premium plan'},
                    'settlementStrategy': {'settlementCurrency': 'EUR'}
                }
            )

            data = response.json()
            # Return redirect URLs to frontend
            redirect_url = data['redirectUrl']
            app_links = data['appLinks']
components:
  schemas:
    LinkPayCreateRequest:
      type: object
      properties:
        productCode:
          type: string
          description: Payment product type assigned by Rebell
        paymentRequestId:
          type: string
          description: >-
            Merchant-generated unique ID (idempotency key). Must be unique per
            transaction.
        paymentAmount:
          $ref: '#/components/schemas/Amount'
        order:
          $ref: '#/components/schemas/Order'
        paymentNotifyUrl:
          type: string
          format: uri
          description: Payment result notification URL.
        paymentRedirectUrl:
          type: string
          format: uri
          description: Redirect URL after payment completion.
        settlementStrategy:
          $ref: '#/components/schemas/SettlementStrategy'
      required:
        - productCode
        - paymentRequestId
        - paymentAmount
        - order
    LinkPayCreateResponse:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/Result'
        redirectUrl:
          type: string
          description: Deep link to open Rebell SuperApp directly
        appLinks:
          $ref: '#/components/schemas/AppLinks'
        acquirementId:
          type: string
          description: Unique platform payment order ID, used for inquiry or reconciliation
        merchantTransId:
          type: string
          description: Echo of the merchant-provided transaction ID from the request
      required:
        - result
        - merchantTransId
    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
    SettlementStrategy:
      type: object
      properties:
        settlementCurrency:
          type: string
          description: Settlement currency (e.g., EUR)
    Result:
      type: object
      properties:
        resultStatus:
          type: string
          enum:
            - S
            - F
            - U
            - A
        resultCode:
          type: string
        resultMessage:
          type: string
      required:
        - resultStatus
    AppLinks:
      type: object
      properties:
        android:
          $ref: '#/components/schemas/AppLinkPlatform'
        ios:
          $ref: '#/components/schemas/AppLinkPlatform'
      description: Platform-specific app link metadata
    Merchant:
      type: object
      properties:
        store:
          $ref: '#/components/schemas/Store'
    AppLinkPlatform:
      type: object
      properties:
        applicationId:
          type: string
          description: Android application ID or iOS bundle ID
        bundleId:
          type: string
          description: iOS bundle ID
        targetPath:
          type: string
          description: Deep link path within the app
        shortUrl:
          type: string
          format: uri
          description: Short URL for the redirect
    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).

````