Introduction
The Cryptorch API follows RESTful architecture standards, offering clear and consistent resource-based endpoints. All requests and responses are transmitted in JSON format, leveraging standard HTTP verbs, status codes, and authentication protocols to enable secure, efficient, and scalable integrations.
API Base URL
Please note that Cryptorch does not provide a sandbox or test environment. All API requests are processed in the live environment, so ensure that all request data and parameters are accurate before making any calls.
https://www.cryptorch.com/api
Authentication
All requests to the Cryptorch API require authentication. Each API request must include a valid client-id and client-secret to the request header, which can be obtained from your Cryptorch Dashboard under Developer Tools.
In addition to credentials, Cryptorch enforces IP-based security. You must register and enable your server’s public IP address in the IP Whitelist section of the dashboard. Requests originating from non-whitelisted IP addresses will be automatically rejected.
Both valid API credentials and an approved IP address are mandatory. Without completing these two steps, authentication will fail and API access will not be granted.
Response Format
All responses from the Cryptorch API are returned in JSON format. Each response follows a consistent structure and includes a status indicator, message, and relevant data payload when applicable. Standard HTTP status codes are used to represent the outcome of each request.
Sample Success Response
{
"status": "success",
"remark": "invoice_created",
"message":[
"Invoice created successfully"
],
"data": {
...you get all data here
}
}
Error Sample Response
{
"remark": "Unauthorized",
"status": "error",
"message": [
"The client secret is required"
]
}
{
"remark": "Unauthorized",
"status": "error",
"message": [
"Access to this API endpoint is restricted to IP addresses that have been explicitly whitelisted.",
"In order to access this API endpoint, please add your IP address (::1) to the white list from the user dashboard."
]
}
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.cryptorch.com/api/invoice-list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Get Invoice List
This endpoint allows you to retrieve a complete list of invoices associated with your Cryptorch account.
Each invoice includes a status and a type. Please refer to the definitions below:
Invoice Status:
Unpaid = 0
Paid = 1
Partially Paid = 2
Expired = 9
Invoice Type:
Crypto Invoice = 1
Fiat Invoice = 0
Query Parameters
Query parameters that allow you to customize the API response.
| Name | Description | Required | Default |
|---|---|---|---|
page |
Specifies the page number to retrieve. | No | 1 |
paginate |
Defines the number of items returned per page. | No | 20 |
search |
Search by invoice ID. | No | - |
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.cryptorch.com/api/invoice-details/:invoice_id',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Invoice Detail
This endpoint allows you to retrieve a invoice & related payments associated with your Cryptorch account.
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.cryptorch.com/api/invoice-status/:invoice_id',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Invoice Payment Status
This endpoint allows you to retrieve a invoice status associated with your Cryptorch account.
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.cryptorch.com/api/payment-list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Get Payment List
This endpoint allows you to retrieve a complete list of payments associated with your Cryptorch account and with invoice.
Each payments includes a status. Please refer to the definitions below:
Invoice Status:
Success = 1
Failed = 3
Initiated = 0
Query Parameters
Query parameters that allow you to customize the API response.
| Name | Description | Required | Default |
|---|---|---|---|
page |
Specifies the page number to retrieve. | No | 1 |
paginate |
Defines the number of items returned per page. | No | 20 |
search |
Search by payment ID/TRX. | No | - |
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.cryptorch.com/api/payment-status/payment_id',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Payment Status
This endpoint allows you to retrieve a payment status associated with your Cryptorch account.
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.cryptorch.com/api/supported-currencies',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Get Platform Supported Currencies
This endpoint allows you to retrieve a complete list of Cryptorch supported currencies.
Each currency includes a type. Please refer to the definitions below:
Currency Type:
Crypto Currency = 1
Fiat Currency = 0
Query Parameters
Query parameters that allow you to customize the API response.
| Name | Description | Required | Default |
|---|---|---|---|
page |
Specifies the page number to retrieve. | No | 1 |
paginate |
Defines the number of items returned per page. | No | 20 |
search |
Search by currency name or code. | No | - |
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.cryptorch.com/api/payment-initiate',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_POST => true, // <- Use POST
CURLOPT_POSTFIELDS => array(
'amount' => 100,
'currency' => '1',
'merchant_trx' => 'TX123456',
'success_url' => 'https://example.com/success',
'failed_url' => 'https://example.com/failed',
'ipn_url' => 'https://example.com/ipn',
'order_description' => 'Payment for Order #9876',
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Create Invoice
This endpoint allows you to create an invoice on Cryptorch to collect payment from your customers.
Required Fields
The following fields are required to create a new contact in the system.
| Name | Required | Description |
|---|---|---|
amount |
Required | The total amount to be charged for the invoice. |
currency_id |
Required | The currency identifier in which the invoice will be processed. |
merchant_trx |
Required | A unique transaction reference provided by the merchant. |
success_url |
Required | The URL where the customer will be redirected after a successful payment. |
failed_url |
Required | The URL where the customer will be redirected if the payment fails. |
ipn_url |
Required | The endpoint URL that will receive Instant Payment Notification (IPN) callbacks. This URL only call when payment is successful. This URl must post method and ensure the exclude CSRF or similar token |
order_description |
Required | A brief description of the order or service associated with this invoice. |