Coinsnap API (1.0)

Download OpenAPI specification:Download

[Base URL: https://app.coinsnap.io] To authenticate requests to this API, you need to include an cookie header with the value "cn-token {TOKEN}".

Webhooks

New Webhook

New

header Parameters
X-Coinsnap-Sig
required
string
Example: sha256=abc123def456ghi789

HMAC signature of the body using the webhook's secret

Request Body schema: application/json
required

Payload containing data about the invoice

invoiceId
string

The ID of the invoice.

metadata
object

Data provided upon creating invoice

additionalStatus
string
Enum: "None" "Underpaid" "Overpaid"
type
string

Responses

Request samples

Content type
application/json
{
  • "invoiceId": "string",
  • "metadata": { },
  • "additionalStatus": "None",
  • "type": "New"
}

Expired Webhook

Expired

header Parameters
X-Coinsnap-Sig
required
string
Example: sha256=abc123def456ghi789

HMAC signature of the body using the webhook's secret

Request Body schema: application/json
required

Payload containing data about the invoice

invoiceId
string

The ID of the invoice.

metadata
object

Data provided upon creating invoice

additionalStatus
string
Enum: "None" "Underpaid" "Overpaid"
type
string
isUnderpaid
boolean

Indicates if the invoice was underpaid.

Responses

Request samples

Content type
application/json
{
  • "invoiceId": "string",
  • "metadata": { },
  • "additionalStatus": "None",
  • "type": "Expired",
  • "isUnderpaid": true
}

Processing Webhook

Processing

header Parameters
X-Coinsnap-Sig
required
string
Example: sha256=abc123def456ghi789

HMAC signature of the body using the webhook's secret

Request Body schema: application/json
required

Payload containing data about the invoice

invoiceId
string

The ID of the invoice.

metadata
object

Data provided upon creating invoice

additionalStatus
string
Enum: "None" "Underpaid" "Overpaid"
type
string

Responses

Request samples

Content type
application/json
{
  • "invoiceId": "string",
  • "metadata": { },
  • "additionalStatus": "None",
  • "type": "Processing"
}

Settled Webhook

Settled

header Parameters
X-Coinsnap-Sig
required
string
Example: sha256=abc123def456ghi789

HMAC signature of the body using the webhook's secret

Request Body schema: application/json
required

Payload containing data about the invoice

invoiceId
string

The ID of the invoice.

metadata
object

Data provided upon creating invoice

additionalStatus
string
Enum: "None" "Underpaid" "Overpaid"
type
string

Responses

Request samples

Content type
application/json
{
  • "invoiceId": "string",
  • "metadata": { },
  • "additionalStatus": "None",
  • "type": "Settled"
}

Create a new webhook

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

header Parameters
x-api-key
required
string

API Key for authentication

Request Body schema: application/json
url
string <url>
events
Array of strings
Items Enum: "New" "Expired" "Processing" "Settled"
secret
string

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "id": "string",
  • "secret": "string",
  • "url": "string",
  • "events": [
    ]
}

Delete a webhook

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

webhookId
required
string

Webhook ID

header Parameters
x-api-key
required
string

API Key for authentication

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Update a webhook

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

webhookId
required
string

Webhook ID

header Parameters
x-api-key
required
string

API Key for authentication

Request Body schema: application/json
required
url
string <url>
events
Array of strings
Items Enum: "New" "Expired" "Processing" "Settled"
enabled
boolean

Responses

Request samples

Content type
application/json
{
  • "url": "string",
  • "events": [
    ],
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "enabled": true,
  • "url": "string",
  • "secret": "string",
  • "events": [
    ]
}

Get information about specific webhook

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

webhookId
required
string

Webhook ID

header Parameters
x-api-key
required
string

API Key for authentication

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "enabled": true,
  • "url": "string",
  • "secret": "string",
  • "events": [
    ]
}

Get all webhooks for a specific store

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

header Parameters
x-api-key
required
string

API Key for authentication

Responses

Response samples

Content type
application/json
[]

Redeliver a webhook payload

path Parameters
webhookId
required
string

ID of the webhook to which the payload belongs

payloadId
required
string

ID of the payload to be redelivered

header Parameters
x-api-key
required
string

API Key for authentication

Responses

Response samples

Content type
application/json
{
  • "message": "Webhook resent successfully"
}

Invoices

Create a new invoice

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

header Parameters
x-api-key
required
string

API Key for authentication

Request Body schema: application/json
required
amount
number

The amount of the invoice.

currency
string
Enum: "EUR" "USD" "SATS" "BTC" "CAD" "JPY" "GBP" "CHF"

The currency of the invoice (if unspecified, the currency will be EUR)'

enabledPaymentMethods
Array of strings
Default: ["BTC","Lightning"]

Specify which payment methods are available for this invoice.

buyerEmail
string
redirectUrl
string

Url where customer will be sent after payment

orderId
string

123

metadata
object

Any key-value pair. Example: {buyerName: name, buyerCountry: country}

referralCode
string

Referral code which you receive after registering extension.

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "currency": "EUR",
  • "enabledPaymentMethods": "BTC",
  • "buyerEmail": "string",
  • "redirectUrl": "string",
  • "orderId": "string",
  • "metadata": { },
  • "referralCode": "string"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "storeId": "gdadada23rewr",
  • "status": "New",
  • "amount": 100,
  • "orderId": 123,
  • "buyerEmail": "user@coinsnap.io",
  • "currency": "EUR",
  • "enabledPaymentMethods": [
    ],
  • "metadata": {
    },
  • "lightningInvoice": "lnbc1u1pwtjxpp5t7pp5wcv6uz06dlt4w5hj3gct7xl34fkgylyxxc4dtyfsdfu3qe9xcsdqsdvlg6urfdcsx6t9ggsxqzjccqp2706k86a7uz6ejqf2xqm4mzkr7aqel0t3srttrn3pg3qxu2zzlzmgnvv9uh4anumwus4tmntqxzffwvgzqmmzdtsr3xrxpff4rle0pczrh2ep88s84uunwwue",
  • "onchainAddress": "1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX",
  • "checkoutLink": "https://example.com/checkout",
  • "qrCodes": {
    },
  • "createdAt": "1684940348"
}

Get invoice

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

invoiceId
required
string

Invoice ID

header Parameters
x-api-key
required
string

API Key for authentication

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "storeId": "gdadada23rewr",
  • "status": "New",
  • "amount": 100,
  • "orderId": 123,
  • "buyerEmail": "user@coinsnap.io",
  • "currency": "EUR",
  • "enabledPaymentMethods": [
    ],
  • "paymentMethod": "Bitcoin/Lightning",
  • "metadata": {
    },
  • "lightningInvoice": "lnbc1u1pwtjxpp5t7pp5wcv6uz06dlt4w5hj3gct7xl34fkgylyxxc4dtyfsdfu3qe9xcsdqsdvlg6urfdcsx6t9ggsxqzjccqp2706k86a7uz6ejqf2xqm4mzkr7aqel0t3srttrn3pg3qxu2zzlzmgnvv9uh4anumwus4tmntqxzffwvgzqmmzdtsr3xrxpff4rle0pczrh2ep88s84uunwwue",
  • "onchainAddress": "1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX",
  • "checkoutLink": "https://example.com/checkout",
  • "qrCodes": {
    },
  • "createdAt": 1684940348
}

Server

Server Health Check

Checks the health status of the server.

Responses

Response samples

Content type
application/json
{
  • "uptime": 3600,
  • "status": "UP",
  • "timestamp": 1679538400000
}

Transactions

Get transactions

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

header Parameters
x-api-key
required
string

API Key for authentication

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get transaction

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

transactionId
required
string

Transaction ID

header Parameters
x-api-key
required
string

API Key for authentication

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Stores

Get store

Requires authentication with an API key. Generate your API key by visiting the API Key Generation Page.

path Parameters
storeId
required
string

Store ID

header Parameters
x-api-key
required
string

API Key for authentication

Responses

Response samples

Content type
application/json
{
  • "storeId": "a213sad34as",
  • "name": "Test",
  • "walletMinSendable": 100,
  • "walletMaxSendable": 10000,
  • "apiKey": "dadasjdjafadasdas"
}