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 Authorization header with the value "X-Api-Key {YOUR_AUTH_KEY}". To obtain your authentication token, go to your dashboard.

Webhooks

Invoice created Webhook

Triggered when a new invoice is created. This webhook provides details about the newly created invoice.

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"
}

Invoice expired Webhook

Triggered when an invoice expires. This webhook notifies your application that an invoice was not paid within the 15 min interval. Check the additionalStatus property inside the metadata to see if it contains Underpaid, indicating that there was a partial payment.

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
}

Invoice processing Webhook

Triggered when an invoice is in processing status. This means that a payment has been received but doesn't have enough confirmations yet. This status only applies to Bitcoin payments. In the case of Lightning payments, the status is switched to Settled immediately.

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"
}

Invoice settled Webhook

Triggered when an invoice is settled. This means that the payment has been fully received and confirmed. The invoice is now considered paid in full.

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

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

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

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

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

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

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

redirectAutomatically
boolean

Redirect to the redirectUrl automatically

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",
  • "redirectAutomatically": true,
  • "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": {
    },
  • "redirectAutomatically": true,
  • "createdAt": "1684940348"
}

Get invoice

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": {
    },
  • "redirectAutomatically": true,
  • "createdAt": 1684940348
}

Payment Requests

Create a new payment request

header Parameters
cn-token
required
string

Token for authentication

Request Body schema: application/json

Payment request details

amount
required
number <float>

The amount of the payment request.

title
required
string

The title of the payment request.

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

The currency of the payment request.

description
string

The description of the payment request.

expiryDate
string <date>

The expiry date of the payment request in ISO 8601 format. If not provided, defaults to 30 days from the current date.

Responses

Request samples

Content type
application/json
{
  • "amount": 100.5,
  • "title": "Payment for Order #123",
  • "currency": "USD",
  • "description": "This is a detailed description of the payment request.",
  • "expiryDate": "2024-12-31"
}

Response samples

Content type
application/json
{
  • "message": "Payment request successfully created"
}

Retrieve all payment requests

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve a payment request

path Parameters
id
required
string

The ID of the payment request to retrieve.

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "amount": 0.1,
  • "title": "string",
  • "currency": "string",
  • "description": "string",
  • "expiryDate": "2019-08-24",
  • "storeId": "string",
  • "status": "Expired"
}

Update a payment request

path Parameters
id
required
string

The ID of the payment request to update.

Request Body schema: application/json

Updated payment request details

amount
required
number <float>

The amount of the payment request.

title
required
string

The title of the payment request.

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

The currency of the payment request.

description
string

The description of the payment request.

expiryDate
string <date>

The expiry date of the payment request.

Responses

Request samples

Content type
application/json
{
  • "amount": 150.75,
  • "title": "Updated Payment for Order #456",
  • "currency": "EUR",
  • "description": "Updated description for the payment request.",
  • "expiryDate": "2024-12-31"
}

Response samples

Content type
application/json
{
  • "message": "Payment request successfully updated"
}

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

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

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

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"
}