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.

string
https://cryptorch.com/api

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.

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

JSON
{
"status": "success",
"remark": "invoice_created",
"message":[
    "Invoice created successfully"
],
"data": {
   ...you get all data here
    }
}
                    

Risposta di esempio di errore

JSON
{
    "remark": "Unauthorized",
    "status": "error",
    "message": [
        "The client secret is required"
    ]
}
                    
JSON
 {
    "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."
    ]
}
                    
php

$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;

 
                                
                        
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 -
php

$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;


php

$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;


php

$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;

 
                                
                        
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 -
php

$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;


php

$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;

 
                                
                        
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 -
php

$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;

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.