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://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.
Esempio di risposta di successo
{
"status": "success",
"remark": "invoice_created",
"message":[
"Invoice created successfully"
],
"data": {
...you get all data here
}
}
Risposta di esempio di errore
{
"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://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;
Ottieni l'elenco delle fatture
This endpoint allows you to retrieve a complete list of invoices associated with your Cryptorch account.
Ogni fattura include uno stato e una tipologia. Si prega di fare riferimento alle definizioni riportate di seguito.:
Stato della fattura:
Non pagato = 0
Pagato = 1
Parzialmente pagato = 2
Scaduto = 9
Tipo di fattura:
Fattura crittografica = 1
Fattura Fiat = 2
Parametri di query
Parametri di query che consentono di personalizzare la risposta API.
| Nome | Descrizione | Necessario | Predefinito |
|---|---|---|---|
pagina |
Specifica il numero di pagina da recuperare. | NO | 1 |
impaginare |
Definisce il numero di elementi restituiti per pagina. | NO | 20 |
ricerca |
Cerca per ID fattura. | NO | - |
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://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;
Dettaglio fattura
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://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;
Stato del pagamento della fattura
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://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;
Ottieni l'elenco dei pagamenti
This endpoint allows you to retrieve a complete list of payments associated with your Cryptorch account and with invoice.
Ogni pagamento include uno stato. Si prega di fare riferimento alle definizioni riportate di seguito.:
Stato della fattura:
Successo = 1
Fallito = 3
Iniziato = 0
Parametri di query
Parametri di query che consentono di personalizzare la risposta API.
| Nome | Descrizione | Necessario | Predefinito |
|---|---|---|---|
pagina |
Specifica il numero di pagina da recuperare. | NO | 1 |
impaginare |
Definisce il numero di elementi restituiti per pagina. | NO | 20 |
ricerca |
Cerca per ID pagamento/TRX. | NO | - |
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://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;
Stato del pagamento
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://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;
Ottieni le valute supportate dalla piattaforma
This endpoint allows you to retrieve a complete list of Cryptorch supported currencies.
Ogni valuta include una tipologia. Si prega di fare riferimento alle definizioni riportate di seguito.:
Tipo di valuta:
Criptovaluta = 1
Valuta Fiat = 0
Parametri di query
Parametri di query che consentono di personalizzare la risposta API.
| Nome | Descrizione | Necessario | Predefinito |
|---|---|---|---|
pagina |
Specifica il numero di pagina da recuperare. | NO | 1 |
impaginare |
Definisce il numero di elementi restituiti per pagina. | NO | 20 |
ricerca |
Cerca per nome o codice della valuta. | NO | - |
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://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;
Crea fattura
This endpoint allows you to create an invoice on Cryptorch to collect payment from your customers.
Campi obbligatori
Per creare un nuovo contatto nel sistema sono necessari i seguenti campi.
| Nome | Necessario | Descrizione |
|---|---|---|
amount |
Necessario | Importo totale da addebitare sulla fattura. |
currency_id |
Necessario | Identificativo della valuta in cui verrà elaborata la fattura. |
merchant_trx |
Necessario | Un riferimento univoco alla transazione fornito dal commerciante. |
success_url |
Necessario | L'URL a cui verrà reindirizzato il cliente dopo un pagamento andato a buon fine. |
failed_url |
Necessario | L'URL a cui verrà reindirizzato il cliente se il pagamento non va a buon fine. |
ipn_url |
Necessario | L'URL dell'endpoint che riceverà le callback di notifica di pagamento immediato (IPN). Questo URL effettua la chiamata solo quando il pagamento va a buon fine. Questo URL deve pubblicare il metodo e garantire l'esclusione del token CSRF o simile. |
order_description |
Necessario | Una breve descrizione dell'ordine o del servizio associato a questa fattura. |