MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Endpoints

Display a listing of the authenticated merchant's stores.

requires authentication

Example request:
const url = new URL(
    "http://www.cryptopay-panel.com/api/v1/stores"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://www.cryptopay-panel.com/api/v1/stores';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://www.cryptopay-panel.com/api/v1/stores'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated. Invalid API Key."
}
 

Request   

GET api/v1/stores

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Create Invoice

requires authentication

Creates a new invoice for the specified store.

This endpoint creates a BTCPay invoice and stores it in the application database.

Example request:
const url = new URL(
    "http://www.cryptopay-panel.com/api/v1/stores/16/invoices"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "amount": 0.001,
    "currency": "BTC",
    "order_id": "ORD-123",
    "buyer_email": "jdach@example.org"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://www.cryptopay-panel.com/api/v1/stores/16/invoices';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'amount' => 0.001,
            'currency' => 'BTC',
            'order_id' => 'ORD-123',
            'buyer_email' => 'jdach@example.org',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://www.cryptopay-panel.com/api/v1/stores/16/invoices'
payload = {
    "amount": 0.001,
    "currency": "BTC",
    "order_id": "ORD-123",
    "buyer_email": "jdach@example.org"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "success": true,
    "data": {
        "id": 1,
        "invoice_number": "INV-123456",
        "amount": 100,
        "currency": "USD",
        "status": "new"
    }
}
 

Example response (403):


{
    "success": false,
    "message": "You cannot create an invoice."
}
 

Request   

POST api/v1/stores/{store_id}/invoices

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

store_id   integer     

The ID of the store. Example: 16

Body Parameters

amount   number     

Invoice amount. Example: 0.001

currency   string     

ISO currency code. Example: BTC

order_id   string  optional    

Merchant order identifier. Example: ORD-123

buyer_email   string  optional    

Must be a valid email address. Must not be greater than 191 characters. Example: jdach@example.org

Show Invoice

requires authentication

Retrieves details of a specific invoice.

Example request:
const url = new URL(
    "http://www.cryptopay-panel.com/api/v1/invoices/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://www.cryptopay-panel.com/api/v1/invoices/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://www.cryptopay-panel.com/api/v1/invoices/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 25,
        "invoice_number": "INV-123456",
        "amount": 100,
        "currency": "USD",
        "status": "paid"
    }
}
 

Example response (403):


{
    "message": "This action is unauthorized."
}
 

Request   

GET api/v1/invoices/{invoice_id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

invoice_id   integer     

The ID of the invoice. Example: 1

invoice   integer     

The invoice ID. Example: 25

Display a summary of merchant metrics.

requires authentication

Example request:
const url = new URL(
    "http://www.cryptopay-panel.com/api/v1/balance-or-summary"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://www.cryptopay-panel.com/api/v1/balance-or-summary';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://www.cryptopay-panel.com/api/v1/balance-or-summary'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated. Invalid API Key."
}
 

Request   

GET api/v1/balance-or-summary

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/v1/stores/{store_id}/webhook-test

requires authentication

Example request:
const url = new URL(
    "http://www.cryptopay-panel.com/api/v1/stores/16/webhook-test"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://www.cryptopay-panel.com/api/v1/stores/16/webhook-test';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://www.cryptopay-panel.com/api/v1/stores/16/webhook-test'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Request   

POST api/v1/stores/{store_id}/webhook-test

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

store_id   integer     

The ID of the store. Example: 16