# Generate QR Code

{% hint style="warning" %}
DEPRECATED&#x20;
{% endhint %}

RKFL system provides API to generate transaction and in response provides transaction id and qrString which can be useful for merchant.

API endpoint: POST /purchase/qr/generate

```
// Headers
Authorization: "Bearer" + merchant access token
x-transaction-source: qr-code-api
```

```
// Here is the sample of the request payload. 
POST /purchase/qr/generate
{
    "amount":"1.00",
    "currency":"USD",
    "cryptoCurrency":"ETH",
    "orderId":"ABCD123",
    "cart":[
        {
            "id":"1",                   //Required
            "name":"Bag",          //Required
            "price":1,                  //Required
            "quantity":1,               //Required
            //only add the below, if the product is a subscription item.
            "isSubscription": "",            //Optional
            "frequency": "",                 //Optional
            "subscriptionPeriod":""          //Optional
            "merchantSubscriptionId": ""     //Optional
        }
    ],
    "customerInfo": {
        name: required (string)
        email: required (string)
        phone: optional (string)
        address: optional (string)
    },
    //"customParameter" is optional field
    "customParameter": {
        "returnMethod": "POST/GET",
        "params": [
          {
            "name": "var",
            "value": "1302*6649c8793fa687fe708618ae52344e26*1685*2*1*128*76"
          },
          {
              "name": "custom",
              "value": "1302|6649c8793fa687fe708618ae52344e26|2|1|128|2|1685"
          }
        ]
    }
}

// isSubscription: true/false 
// subscriptionPeriod: [number][period] - for example 1y, 2m, 3w
// frequency: weekly/monthly/quarterly/half-yearly/yearly
// merchantSubscriptionId: Subscription id for merchant system. This key will use to communicate the recurring payment status.
```

```
// Here is the sample of the response payload.
200:Ok   Success
{
    "ok": true,
    "result": {
        "totalAmount": "0.17800800",
        "currency": "USD",
        "crytoCurrency": "ETH",
        "id": "ee802a07-d857-4792-ae48-619775daf85b",
        "meta": {
            "offerId": "ABCD123",
            "receiverAddress": "0xB5d71af0A642ef800E013B996E8116318EF9B520",
            "qrString": "ethereum:0xB5d71af0A642ef800E013B996E8116318EF9B520?amount=0.21360960&value=0.21360960"
        }
    }
}
```

#### Payment Status

* 10 = QR code/receiving wallet address generated for shopper
* 0 = pending
* 1/2/3/4 = successful
* -1 = failed
* 101 = partial
* 19 = timedout


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rocketfuel.inc/developer-guides/api-reference/payins/custom-ui-integration/generate-qr-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
