Collections

This collection of APIs enables you to collect money via UPI (Unified Payments Interface) from your customers or enable your partner businesses/SMEs to do the same. We support multiple methods like UPI QR codes, payment links, and sending direct collection requests to the designated UPI ID.

Issue Collect Request

Send a payment collection request to a specific UPI ID (example - [email protected]).

curl --location --request POST 'https://in.staging.decentro.tech/v2/payments/collection' \
--header 'client_id: <YOUR_CLIENT_ID>' \
--header 'client_secret: <YOUR_CLIENT_SECRET>' \
--header 'module_secret: <YOUR_PAYMENTS_MODULE_SECRET>' \
--header 'provider_secret: <YOUR_PROVIDER_SECRET>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "reference_id": "0000-0000-0000-0001",
    "payer_upi": "[email protected]",
    "payee_account": "462515XXXX",
    "amount": 100,
    "purpose_message": "Welcome to Decentro",
    "expiry_time": 30
}'
{
  "decentroTxnId": "5296XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "status": "FAILURE",
  "responseCode": "E00009",
  "message": "The combination of this account_number and provider for `payee` doesn't match with an existing customer. Please check the values and try resubmitting."
}

Check Payment Status

Check the real-time status of the payment collection request/ link created by you.

curl --location --request GET 'https://in.staging.decentro.tech/v2/payments/transaction/5296XXXXXXXXXXXXXXXXXXXXXXXXXXXX/status' \
--header 'client_id: <YOUR_CLIENT_ID>' \
--header 'client_secret: <YOUR_CLIENT_SECRET>' \
--header 'module_secret: <YOUR_PAYMENTS_MODULE_SECRET>' \
--header 'provider_secret: <YOUR_PROVIDER_SECRET>'
{
  "decentroTxnId": "5296XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "status": "FAILURE",
  "responseCode": "E00009",
  "message": "This transaction was not found in our system. If there was any debit or credit, it would have already been reversed. Please retry the corresponding transaction."
}

Validate UPI Handle

Check if a particular UPI-ID (Virtual Payment Address) is valid or not.

Test Data to validate a UPI handle

VPA

Validate Type

Remarks

[email protected]

basic

Successful status with Valid VPA response.

[email protected]

basic

Successful status with Invalid VPA response.

[email protected]

advance

Successful status with Valid VPA response.

[email protected]

advance

Successful status with Invalid VPA response.

[email protected]

basic

Failure status with Invalid format.

[email protected]

advance

Failure status with Invalid format.

📘

Currently Available only with Yes Bank as a provider

curl --location --request POST 'https://in.staging.decentro.tech/v2/payments/vpa/validate' \
--header 'client_id: <YOUR_CLIENT_ID>' \
--header 'client_secret: <YOUR_CLIENT_SECRET>' \
--header 'module_secret: <YOUR_PAYMENTS_MODULE_SECRET>' \
--header 'provider_secret: <YOUR_PROVIDER_SECRET>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "reference_id": "0000-0000-0000-0001",
    "upi_id" : "[email protected]"
}'
{
  "decentroTxnId": "62A3F1XXXXXXXXXXXXXXXXXXX",
  "status": "SUCCESS",
  "responseCode": "S00000",
  "message": "UPI-ID (Virtual Payment Address) validation done successfully",
  "data": {
    "upiId": "[email protected]",
    "name": "Sample User",
    "status": "VALID",
    "statusDescription": "Virtual Address already exists"
  }
}

Generate UPI Payment Link

Generate a payment link to send to a customer and/or a dynamic UPI QR code to show for a specific transaction.

curl --location --request POST 'https://in.staging.decentro.tech/v2/payments/upi/link' \
--header 'client_id: <YOUR_CLIENT_ID>' \
--header 'client_secret: <YOUR_CLIENT_SECRET>' \
--header 'module_secret: <YOUR_PAYMENTS_MODULE_SECRET>' \
--header 'provider_secret: <YOUR_PROVIDER_SECRET>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "reference_id": "0000-0000-0000-0001",
    "payee_account": "462515XXXX",
    "amount": 100,
    "purpose_message": "welcome to Decentro",
    "generate_qr": "YES",
    "expiry_time": 10,
    "customized_qr_with_logo": 0,
    "generate_uri": 1
}'
{
  "decentroTxnId": "5296XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "status": "FAILURE",
  "responseCode": "E00009",
  "message": "Invalid value entered for Generate QR. Generate QR can be either 0 or 1. Hint : generate_qr (int)"
}

Issue UPI Refund

Refund a UPI transaction to its original source.

curl --location --request POST 'https://in.staging.decentro.tech/v2/payments/upi/refund' \
--header 'client_id: <YOUR_CLIENT_ID>' \
--header 'client_secret: <YOUR_CLIENT_SECRET>' \
--header 'module_secret: <YOUR_PAYMENTS_MODULE_SECRET>' \
--header 'provider_secret: <YOUR_PROVIDER_SECRET>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "reference_id": "0000-0000-0000-0001",
    "transaction_id": "DECXXXXXXXXXXXXXXXX",
    "purpose_message": "Welcome to Decentro"
}'
{
  "decentroTxnId": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "status": "SUCCESS",
  "responseCode": "S00000",
  "message": "Transaction refund request processed successfully",
  "data": {
    "transactionId": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "transactionStatus": "SUCCESS",
    "transactionStatusDescription": "Transaction success",
    "bankReferenceNumber": "XXXXXXXXXXXX",
    "npciTransactionId": "YESBBCBXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  }
}

Did this page help you?