SDKs overview

Coinremitter offers tools for developers to integrate cryptocurrency payment processing and wallet management functionalities into their applications. The primary method for interaction is through its RESTful API, which developers can access directly or via client libraries. These libraries, often referred to as Software Development Kits (SDKs), provide language-specific wrappers around the API endpoints, simplifying the process of making requests and handling responses.

An SDK typically includes functions for common operations such as initializing API clients, creating new invoices for crypto payments, retrieving real-time exchange rates, checking the status of transactions, and managing wallet addresses. By abstracting the underlying HTTP requests and JSON parsing, SDKs reduce the amount of boilerplate code developers need to write, allowing them to focus on their application's core logic. The official Coinremitter SDK is currently available for PHP, reflecting the platform's initial focus and user base. Community-contributed libraries extend support to other popular programming languages, providing broader accessibility for different development environments.

Developers using Coinremitter can implement features essential for e-commerce platforms, such as automatic payment confirmation, secure wallet address generation, and tracking transaction history. The platform's Coinremitter API documentation provides comprehensive details on all available endpoints and data models, enabling developers to build custom integrations even without a dedicated SDK for their preferred language. For general information on the benefits of using SDKs for API integration, resources like Google's API client library developer guide offer further context.

Official SDKs by language

Coinremitter maintains an official SDK primarily for PHP developers, aligning with the common server-side language choices for web applications, especially in the e-commerce sector. This official SDK is designed to offer a robust and well-supported integration path for PHP-based projects.

PHP SDK

The official PHP SDK for Coinremitter simplifies interaction with the core API. It encapsulates various API calls into functions, making it easier to manage cryptocurrency payments, retrieve wallet information, and generate deposit addresses within a PHP application. Developers can use this SDK to implement features like invoice generation, payment status verification, and currency conversion rate lookups.

The following table outlines the details for the official Coinremitter PHP SDK:

Language Package Name Install Command Maturity
PHP coinremitter/coinremitter-php composer require coinremitter/coinremitter-php Official, Stable

This SDK is regularly updated to ensure compatibility with the latest API versions and to incorporate any new features introduced by Coinremitter. Developers are encouraged to refer to the Coinremitter PHP SDK documentation for the most current usage instructions and examples.

Installation

Installing the official Coinremitter PHP SDK is typically done using Composer, the dependency manager for PHP. This method ensures that all necessary dependencies are resolved and installed correctly, making the SDK ready for immediate use in your project.

PHP SDK Installation

To install the official PHP SDK, ensure you have Composer installed on your development machine. If not, you can find installation instructions on the Composer download page. Once Composer is ready, navigate to your project's root directory in your terminal or command prompt and execute the following command:

composer require coinremitter/coinremitter-php

This command will download the Coinremitter PHP SDK and its dependencies, adding them to your project's vendor/ directory and updating your composer.json and composer.lock files. After installation, you can include the Composer autoloader in your PHP scripts to make the SDK classes available:

<?php
require __DIR__ . '/vendor/autoload.php';

use Coinremitter\Coinremitter;

// Your application logic here
?>

This setup allows you to instantiate the Coinremitter client and begin making API calls, following the detailed instructions provided in the Coinremitter SDK documentation.

Quickstart example

This quickstart example demonstrates how to initialize the Coinremitter PHP SDK and create a new cryptocurrency invoice. This fundamental operation is often the first step in integrating crypto payments into an application.

PHP Quickstart: Create an Invoice

Before running this example, ensure you have installed the PHP SDK using Composer as described in the installation section. You will also need to have your Coinremitter API key and password, which can be obtained from your Coinremitter dashboard. Replace the placeholder values with your actual credentials.

<?php
require __DIR__ . '/vendor/autoload.php';

use Coinremitter\Coinremitter;

// Replace with your actual API Key and Password from Coinremitter dashboard
$apiKey = 'YOUR_API_KEY';
$password = 'YOUR_API_PASSWORD';

// Initialize the Coinremitter client
$coinremitter = new Coinremitter($apiKey, $password);

// Example: Create an invoice for 0.001 BTC
try {
    $invoiceData = [
        'currency' => 'BTC', // Or 'USDT', 'ETH', 'LTC', etc.
        'amount' => 0.001,
        'name' => 'Order #12345',
        'expire_at' => '600', // Invoice expires in 600 seconds (10 minutes)
        'success_url' => 'https://yourwebsite.com/payment-success',
        'cancel_url' => 'https://yourwebsite.com/payment-cancel',
        'description' => 'Payment for products A and B'
    ];

    $response = $coinremitter->createInvoice($invoiceData);

    if ($response['flag'] == 1) {
        echo "Invoice created successfully:\n";
        echo "Payment URL: " . $response['data']['url'] . "\n";
        echo "Invoice ID: " . $response['data']['invoice_id'] . "\n";
        echo "Address: " . $response['data']['address'] . "\n";
        // Redirect user to $response['data']['url'] for payment
    } else {
        echo "Error creating invoice: " . $response['msg'] . "\n";
    }
} catch (Exception $e) {
    echo "An exception occurred: " . $e->getMessage() . "\n";
}

// Example: Get wallet address list
try {
    $walletAddresses = $coinremitter->getWalletAddressList(['currency' => 'BTC']);
    if ($walletAddresses['flag'] == 1) {
        echo "\nBTC Wallet Addresses:\n";
        foreach ($walletAddresses['data'] as $address) {
            echo "Address: " . $address['address'] . ", Label: " . ($address['label'] ?? 'N/A') . "\n";
        }
    } else {
        echo "Error getting BTC wallet addresses: " . $walletAddresses['msg'] . "\n";
    }
} catch (Exception $e) {
    echo "An exception occurred while fetching addresses: " . $e->getMessage() . "\n";
}

?>

This example demonstrates how to set up the client, define invoice parameters, and handle the API response. The createInvoice method returns a payment URL that clients can be redirected to, along with the generated invoice ID and a unique deposit address. The second part of the example shows how to fetch a list of wallet addresses for a specific cryptocurrency, which can be useful for managing funds or displaying available deposit options to users. Always refer to the Coinremitter Create Invoice API documentation for the most up-to-date parameters and response structures.

Community libraries

While Coinremitter provides an official PHP SDK, the developer community has contributed libraries for other programming languages, extending the reach of Coinremitter's API to a broader range of development environments. These community-supported libraries are not officially maintained by Coinremitter but leverage the publicly available API endpoints to offer similar functionalities in different language ecosystems.

Python

A community-maintained Coinremitter Python library is available, allowing Python developers to interact with the Coinremitter API. This library typically mirrors the functionality of the official API, providing methods to generate invoices, check balances, and manage transactions programmatically using Python. Installation is usually via pip:

pip install coinremitter

Developers using this library should consult its dedicated GitHub repository for specific usage instructions, examples, and to understand its current feature set and maintenance status. Community libraries can be beneficial for projects built primarily in languages other than PHP, but it is important to note that their support, updates, and reliability may vary compared to official SDKs.

JavaScript (Node.js)

While a prominent, widely adopted official or community JavaScript library for Coinremitter might not be as readily available as the PHP SDK, developers can interact with the Coinremitter REST API directly from Node.js applications using standard HTTP client libraries such as axios or node-fetch. This approach involves constructing HTTP requests (GET, POST) with appropriate headers and JSON bodies, and then parsing the JSON responses. For example, making a POST request to create an invoice would involve sending a request to the /create-invoice endpoint with the necessary parameters in the request body, including API key, password, currency, and amount. This method demands a deeper understanding of the Coinremitter API specification but offers maximum flexibility and control over the integration logic.

When using community libraries, it is advisable to:

  • Review the source code: Understand how the library interacts with the API and ensure it meets security and performance requirements.
  • Check for active maintenance: Libraries that are actively maintained are more likely to be compatible with the latest API versions and address potential issues.
  • Consult the community: Look for issues, pull requests, and discussions on the library's repository to gauge community support and activity.

For any language without a dedicated SDK, developers can always fall back to direct API calls. The Coinremitter API is well-documented, making direct HTTP requests a viable and often necessary approach for custom integrations or less common programming environments. This approach requires manual handling of request construction, authentication, and response parsing, but offers the most granular control over the integration.