API Reference

The final status is usually available within 10 seconds after submitting the transaction. If checking status you get status pending, wait a few seconds and check again.

Possible status:

  1. Ok
  2. Pending
  3. Failed
  4. Accepted(Deposit created and confirmed by blockchain)
  5. Reversed(Deposit reverse is blockchain confirmed)
  6. PendingForReverse(Deposit reverse is Initiated but not confirmed)

Description

Headers

  • Content-Type: The Content-Type header is set to application/json, indicating that the request body contains JSON data.
  • Authorization: The Authorization header is used with a bearer token for authentication. The actual token value should replace the placeholder Bearer eyJhbG...NrEQ41w.

Sample Request:

import requests

def get_deposit_transaction_status(external_reference_id, token):
    # Updated URL with the external reference ID included in the path
    url = f"https://uat-businessapi.spenn.com/api/partner/transaction/deposit/{external_reference_id}/status"

    # Headers with the Authorization token
    headers = {
        'Authorization': f'Bearer {token}'
    }

    # Sending the GET request
    try:
        response = requests.get(url, headers=headers)
        # Return the response data (or handle it as needed)
        return response.json()
    except requests.RequestException as e:
        print(f"Error: {e}")

# Example usage
external_reference_id = 'your_external_reference_id_here'  # Replace with the actual external reference ID
token = 'your_bearer_token_here'  # Replace with your actual bearer token
deposit_transaction_status = get_deposit_transaction_status(external_reference_id, token)
print(deposit_transaction_status)

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class DepositTransactionStatusFetcher {

    public static void main(String[] args) {
        String externalReferenceId = "your_external_reference_id_here"; // Replace with the actual external reference ID
        String token = "your_bearer_token_here"; // Replace with your actual bearer token
        String response = getDepositTransactionStatus(externalReferenceId, token);
        System.out.println(response);
    }

    private static String getDepositTransactionStatus(String externalReferenceId, String token) {
        try {
            // Updated URL with the external reference ID included in the path
            URL url = new URL("https://uat-businessapi.spenn.com/api/partner/transaction/deposit/" + externalReferenceId + "/status");

            // Open a connection
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();

            // Set the request method and headers
            connection.setRequestMethod("GET");
            connection.setRequestProperty("Authorization", "Bearer " + token);

            // Reading the response
            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            String inputLine;
            StringBuilder content = new StringBuilder();
            while ((inputLine = in.readLine()) != null) {
                content.append(inputLine);
            }
            in.close();
            connection.disconnect();

            // Return the response content
            return content.toString();

        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}

async function getDepositTransactionStatus(externalReferenceId, token) {
    // Updated URL with the external reference ID included in the path
    const url = `https://uat-businessapi.spenn.com/api/partner/transaction/deposit/${externalReferenceId}/status`;

    // Setting up the request headers
    const headers = {
        'Authorization': `Bearer ${token}`
    };

    try {
        // Sending the GET request
        const response = await fetch(url, { headers: headers });

        // Parsing the JSON response
        const responseData = await response.json();
        return responseData;
    } catch (error) {
        console.error('Error:', error);
    }
}

// Example usage
const externalReferenceId = 'your_external_reference_id_here'; // Replace with the actual external reference ID
const token = 'your_bearer_token_here'; // Replace with your actual bearer token

getDepositTransactionStatus(externalReferenceId, token)
    .then(data => console.log(data))
    .catch(error => console.error('Error in fetching deposit transaction status:', error));

👍

Sample Response - Successful

{
  "status": "Pending", 
  "reason": null
}

❗️

Sample Response - Failed

{
  "status": "Failed",
	"reason": "NotVerifiedReceiverKyc"
}