> For the complete documentation index, see [llms.txt](https://blufin360-api-documentation.gitbook.io/blufin360_api_documentation-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blufin360-api-documentation.gitbook.io/blufin360_api_documentation-docs/banking/collections.md).

# Collections

Generate UPI intent links, QR codes, or intent data to collect payments from payers into your merchant account.

The API includes:

* UPI Intent Link generation
* QR code collection
* Intent Data for in-app flows
* Payer account validation
* Configurable validity window

#### **Endpoints**

* **UAT / Staging**: <mark style="color:$primary;">`apidev.blufin360.com`</mark>
* **Production**: <mark style="color:$primary;">`api.blufin360.com`</mark>

**Path**

<mark style="color:$primary;">`POST /api/v1/banking/collection`</mark>

**Authentication**

Use a JWT access token in the `Authorization` header.

Generate the token using [<mark style="color:$primary;">Generate JWT Access Token (Merchant Login API)</mark>](/blufin360_api_documentation-docs/getting-started/authentication.md)<mark style="color:$primary;">.</mark> Generate the token using [<mark style="color:$primary;">Authentication</mark>](/blufin360_api_documentation-docs/getting-started/authentication.md).

### Example request

{% tabs %}
{% tab title="Shell" %}

```bash
curl --location 'https://api.blufin360.com/api/v1/banking/fund-transfer' \
  --header 'Authorization: Bearer <accessToken>' \
  --header 'Content-Type: application/json' \
  --data
{
  "api_request_id": "API_REQ_123",
  "merchant_ref_id": "MER_REF_123",
  "collection_details": 
{
    "vpa_id": "cbf2f90b-cdfd-4f27-afe5-8c58c64d0000",           
    "account_id": "550e8400-e29b-41d4-a716-446655440000",       
    "collection_mode": "INTENT_LINK",
    "amount": "11.00",
    "currency": "INR",
    "description": "Payment for Vendor",
    "target_device": "ANDROID",
    }
}
```

{% endtab %}

{% tab title="Node" %}

```javascript
const response = await fetch('https://api.blufin360.com/api/v1/banking/collections', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <accessToken>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    api_request_id: "API_REQ_123",
    merchant_ref_id: "MER_REF_123",
    collection_details: {
      vpa_id: "cbf2f90b-cdfd-4f27-afe5-8c58c64d0000",
      account_id: "550e8400-e29b-41d4-a716-446655440000",
      collection_mode: "INTENT_LINK",
      amount: "11.00",
      currency: "INR",
      description: "Payment for Vendor",
      target_device: "ANDROID",
    },
  }),
});

const data = await response.json();
console.log(data);
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://api.blufin360.com/api/v1/banking/fund-transfer"
access_token = "<accessToken>"

headers = {
    "Authorization": f"Bearer {access_token}",
    "Content-Type": "application/json"
}

payload = {
    "api_request_id": "API_REQ_123",
    "merchant_ref_id": "MER_REF_123",
    "collection_details": {
        "vpa_id": "cbf2f90b-cdfd-4f27-afe5-8c58c64d0000",
        "account_id": "550e8400-e29b-41d4-a716-446655440000",
        "collection_mode": "INTENT_LINK",
        "amount": "11.00",
        "currency": "INR",
        "description": "Payment for Vendor",
        "target_device": "ANDROID"
    }
}

try:
    response = requests.post(url, headers=headers, json=payload)
    print(f"HTTP Status: {response.status_code}")
    print(f"Response: {response.json()}")
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"log"
	"net/http"
)
type CollectionDetails struct {
	VpaId          string `json:"vpa_id"`
	AccountId      string `json:"account_id"`
	CollectionMode string `json:"collection_mode"`
	Amount         string `json:"amount"`
	Currency       string `json:"currency"`
	Description    string `json:"description"`
	TargetDevice   string `json:"target_device"`
}
type CollectionRequest struct {
	ApiRequestId      string            `json:"api_request_id"`
	MerchantRefId     string            `json:"merchant_ref_id"`
	CollectionDetails CollectionDetails `json:"collection_details"`
}

func main() {
	requestBody := CollectionRequest{
		ApiRequestId:  "API_REQ_123",
		MerchantRefId: "MER_REF_123",
		CollectionDetails: CollectionDetails{
			VpaId:          "cbf2f90b-cdfd-4f27-afe5-8c58c64d0000",
			AccountId:      "550e8400-e29b-41d4-a716-446655440000",
			CollectionMode: "INTENT_LINK",
			Amount:         "11.00",
			Currency:       "INR",
			Description:    "Payment for Vendor",
			TargetDevice:   "ANDROID",
		},
	}

	jsonData, err := json.Marshal(requestBody)
	if err != nil {
		log.Fatalf("Error occurred during marshaling: %v", err)
	}
	url := "https://api.blufin360.com/api/v1/banking/collections"
	req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
	if err != nil {
		log.Fatalf("Error occurred while creating request: %v", err)
	}
	req.Header.Set("Authorization", "Bearer <accessToken>")
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	response, err := client.Do(req)
	if err != nil {
		log.Fatalf("Error occurred while sending request: %v", err)
	}
	defer response.Body.Close()

	body, err := io.ReadAll(response.Body)
	if err != nil {
		log.Fatalf("Error occurred while reading response body: %v", err)
	}

	var data interface{}
	err = json.Unmarshal(body, &data)
	if err != nil {
		log.Fatalf("Error occurred while unmarshaling response: %v", err)
	}
	fmt.Println(data)
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class FundTransfer {

    public static void main(String[] args) {
        String url = "https://api.blufin360.com/api/v1/banking/fund-transfer";
        String accessToken = "<accessToken>";

        String requestBody = """
            {
                "api_request_id": "API_REQ_123",
                "merchant_ref_id": "MER_REF_123",
                "collection_details": {
                    "vpa_id": "cbf2f90b-cdfd-4f27-afe5-8c58c64d0000",
                    "account_id": "550e8400-e29b-41d4-a716-446655440000",
                    "collection_mode": "INTENT_LINK",
                    "amount": "11.00",
                    "currency": "INR",
                    "description": "Payment for Vendor",
                    "target_device": "ANDROID"
                }
            }
            """;

        try {
            HttpClient client = HttpClient.newHttpClient();

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(url))
                .header("Authorization", "Bearer " + accessToken)
                .header("Content-Type", "application/json")
                .POST(HttpRequest.BodyPublishers.ofString(requestBody))
                .build();

            HttpResponse<String> response = client.send(
                request,
                HttpResponse.BodyHandlers.ofString()
            );

            System.out.println("HTTP Status: " + response.statusCode());
            System.out.println("Response: " + response.body());

        } catch (Exception e) {
            System.err.println("Error: " + e.getMessage());
        }
    }
}
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$url = 'https://api.blufin360.com/api/v1/banking/fund-transfer';
$accessToken = '<accessToken>';

$data = [
    'api_request_id' => 'API_REQ_123',
    'merchant_ref_id' => 'MER_REF_123',
    'collection_details' => [
        'vpa_id'          => 'cbf2f90b-cdfd-4f27-afe5-8c58c64d0000',
        'account_id'      => '550e8400-e29b-41d4-a716-446655440000',
        'collection_mode' => 'INTENT_LINK',
        'amount'          => '11.00',
        'currency'        => 'INR',
        'description'     => 'Payment for Vendor',
        'target_device'   => 'ANDROID',
    ],
];

$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL            => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => json_encode($data),
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . $accessToken,
        'Content-Type: application/json',
    ],
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error    = curl_error($ch);

curl_close($ch);

if ($error) {
    echo 'cURL Error: ' . $error;
} else {
    echo 'HTTP Status: ' . $httpCode . PHP_EOL;
    echo 'Response: ' . $response . PHP_EOL;

    $result = json_decode($response, true);
    print_r($result);
}
```

{% endtab %}
{% endtabs %}

### Headers

| Header        | Type     | Required | Description                   | Format                                 |
| ------------- | -------- | -------- | ----------------------------- | -------------------------------------- |
| Authorization | `string` | ✅        | Access token for auth         | Authorization: Bearer `<access_token>` |
| Content-Type  | `string` | ✅        | Specifies request body format | application/json                       |

### Request Payload body

```json
{
  "api_request_id": "API_REQ_123",
  "merchant_ref_id": "MER_REF_123",
  "collection_details": {
    "vpa_id": "cbf2f90b-cdfd-4f27-afe5-8c58c64d0000",           
    "account_id": "550e8400-e29b-41d4-a716-446655440000",       
    "collection_mode": "INTENT_LINK",
    "amount": "11.00",
    "currency": "INR",
    "description": "Payment for Vendor",
    "target_device": "ANDROID",
```

### Body

<table><thead><tr><th width="171.71875">Field</th><th width="124.17578125">Type</th><th width="108.44921875">Required</th><th>Description</th></tr></thead><tbody><tr><td>api_request_id</td><td><code>string</code></td><td>✅</td><td>Unique request ID (6–50 chars)</td></tr><tr><td>merchant_ref_id</td><td><code>string</code></td><td>✅</td><td>Unique merchant reference ID for tracking (6–50 chars)</td></tr><tr><td>Collection Details</td><td>object</td><td>✅</td><td>Beneficiary information</td></tr></tbody></table>

### Collection Details

<table><thead><tr><th width="114.34375">Field</th><th width="115.6015625">Type</th><th width="108.12109375">Required</th><th>Description</th></tr></thead><tbody><tr><td>vpa_id</td><td><code>UUID</code></td><td>✅</td><td>Unique identifier of the VPA (Virtual Payment Address) configuration linked to your merchant account.</td></tr><tr><td>account_id</td><td><code>UUID</code></td><td>✅</td><td>Unique identifier of the merchant account into which the collected funds will be credited.</td></tr><tr><td>Collection mode</td><td><code>string</code></td><td>✅</td><td>The UPI payment instrument to generate. Accepted values: <code>INTENT_DATA</code>, <code>INTENT_LINK</code>, <code>QR</code>.</td></tr><tr><td>amount</td><td><code>string</code></td><td>✅</td><td>The amount to collect from the payer</td></tr><tr><td>currency</td><td><code>decimal</code></td><td>✅</td><td>Currency of the transaction. Currently only <code>INR</code> is supported.</td></tr><tr><td>description</td><td><code>string</code></td><td>✅</td><td>A short description of the collection purpose shown to the payer</td></tr></tbody></table>

### Conditions

<table><thead><tr><th width="324.59765625">Condition</th><th>Required Fields</th></tr></thead><tbody><tr><td><code>collection_mode = INTENT_DATA</code></td><td><code>collection_details.vpa_id</code></td></tr><tr><td><code>collection_mode = INTENT_LINK</code></td><td><code>collection_details.vpa_id</code>, <code>collection_details.target_device</code>, <code>collection_details.target_app</code></td></tr><tr><td><code>collection_mode = QR</code></td><td><code>collection_details.vpa_id</code></td></tr><tr><td><code>payer_details.validate_payer = true</code></td><td><code>payer_details.account_number</code>, <code>payer_details.ifsc_code</code></td></tr></tbody></table>

### Success Response — <mark style="color:$primary;">200</mark> (example)

```json
{
    "status": "success",
    "status_code": 200,
    "message": "Collection initiated successfully",
    "data": {
        "service_type": "PAYIN",
        "service_subtype": "INTENT_LINK",
        "response_code": "TXN-1001",
        "response_message": "Transaction Initiated",
        "transaction_details": {
            "transaction_ref_id": "XYZINTENT99444C6A6BC34B2AA5131A5E3D",
            "merchant_ref_id": "MER_REF_123",
            "transaction_status": "INITIATED",
            "amount": 11.00,
            "currency": "INR",
            "transaction_mode": "INTENT_LINK",
            "description": "Payment for vendor",
            "utr": null,
            "remarks": null,
            "transfer_type": null,
            "created_at": "2026-06-22T09:46:03.735830+00:00",
            "collection_details": {
                "intent_link": "upi://pay?pa=MERCHANT@VPA&pn=MERCHANT%20NAME&tr=EZV2026062215160449457128&am=11.0&cu=INR&mc=7392",
                "qr_content": null,
                "intent_data": null
            }
        }
    },
    "detail": null
}
```

### Response Metadata

| Field               | Type      | Description                                                            |
| ------------------- | --------- | ---------------------------------------------------------------------- |
| status              | `string`  | Indicates the overall result of the API call                           |
| code / status\_code | `integer` | HTTP status code                                                       |
| message             | `string`  | A summary of the outcome (e.g. `"Collection initiated successfully"`). |
| data                | `object`  | Verification response payload                                          |

### Failure Response — <mark style="color:$danger;">400 / 422 / 500</mark>

| Field   | Type      | Description                                                                  |
| ------- | --------- | ---------------------------------------------------------------------------- |
| status  | `string`  | Indicates the overall result of the API call. Returns an `error` on failure. |
| code    | `integer` | Error status code                                                            |
| message | `string`  | A summary of the outcome (e.g. `"Collection unsuccessful"`).                 |
| error   | `object`  | Error details                                                                |

**Common Error**

{% hint style="warning" %}
Please rely on the **response\_code** field to determine the final outcome of the transaction. While the **transaction\_status** and **response\_message** provide a general indication.
{% endhint %}
