CryptoPay
Obtener claves de API

Referencia de la API

Referencia de la API

URL base https://cryptopay.yanselmask.com/api/v1. También disponible como OpenAPI 3.1 para generar clientes o importarla en Postman.

Facturas

Listar facturas

GET/invoices

Facturas del modo de la clave (live o prueba), las más recientes primero. Filtra por estado, order_id o fecha de creación.

Permiso necesario: invoices:read

Parámetros

Campo
limit
integer

Query · Page size (1–100).

cursor
string

Query · Opaque cursor from meta.next_cursor.

status
enum (8)

Query

order_id
string

Query

created_after
string

Query

created_before
string

Query

Devuelve una lista de Invoice

Campo
id
stringobligatorio
object
"invoice"obligatorio
number
integerobligatorio
status
enum (8)obligatorio
livemode
booleanobligatorio
description
string | nullobligatorio
order_id
string | nullobligatorio
metadata
objectobligatorio
amount
Moneyobligatorio

Fiat amount.

crypto
object | nullobligatorio
rate
object | nullobligatorio
received
objectobligatorio
flags
objectobligatorio
customer
objectobligatorio
urls
objectobligatorio
payment_link_id
string | nullobligatorio
product_id
string | nullobligatorio
source
"link" | "api" | "manual" | "billing"obligatorio
created_at
stringobligatorio

ISO 8601 UTC timestamp.

expires_at
stringobligatorio

ISO 8601 UTC timestamp.

paid_at
string | nullobligatorio
updated_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 400VALIDATION_ERROR
  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X GET 'https://cryptopay.yanselmask.com/api/v1/invoices' \
  -H 'Authorization: Bearer cp_test_••••'
Respuesta 200
{
  "data": [
    {
      "id": "7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939",
      "object": "invoice",
      "number": 120,
      "status": "pending",
      "livemode": true,
      "description": "T-shirt",
      "order_id": "SO-1001",
      "metadata": {},
      "amount": {
        "value": "25.00",
        "currency": "USD",
        "minor": 2500
      },
      "crypto": {
        "asset": "usdt_tron",
        "network": "tron",
        "symbol": "USDT",
        "amount": "25.02",
        "amount_base_units": "25020000",
        "decimals": 6,
        "address": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
        "uri": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
        "required_confirmations": 19
      },
      "rate": {
        "fiat_per_asset": "1",
        "locked_at": "2026-10-10T12:00:00.000Z",
        "expires_at": "2026-10-10T13:00:00.000Z"
      },
      "received": {
        "amount": "0",
        "amount_base_units": "0",
        "confirmed_base_units": "0"
      },
      "flags": {
        "paid_late": false,
        "underpaid_accepted": false
      },
      "customer": {
        "email": null,
        "name": null
      },
      "urls": {
        "checkout": "https://pay.example.com/pay/7d61…",
        "receipt": "https://pay.example.com/pay/7d61…/receipt",
        "success": null,
        "cancel": null
      },
      "payment_link_id": null,
      "product_id": null,
      "source": "api",
      "created_at": "2026-10-10T12:00:00.000Z",
      "expires_at": "2026-10-10T13:00:00.000Z",
      "paid_at": null,
      "updated_at": "2026-10-10T12:00:00.000Z"
    }
  ],
  "meta": {
    "next_cursor": null,
    "has_more": false
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Crear una factura

POST/invoices

Crea una factura y devuelve la URL de su checkout alojado (urls.checkout). Envía asset para fijar ya la moneda: la respuesta incluye la dirección y el importe cripto exacto. Envía la cabecera Idempotency-Key para reintentar con seguridad.

Permiso necesario: invoices:write

Cuerpo de la petición

Campo
amount
string | numberobligatorio

Decimal amount as a string (recommended) or number.

currency
enum (10)obligatorio

ISO 4217 fiat currency.

description
string
order_id
string
customer
object
success_url
string | null
cancel_url
string | null
metadata
object

Your own key/value pairs (up to 20). Returned in webhooks.

asset
enum (22)

Lock the currency now: the response already includes crypto.

ttl_minutes
integer

Devuelve Invoice

Campo
id
stringobligatorio
object
"invoice"obligatorio
number
integerobligatorio
status
enum (8)obligatorio
livemode
booleanobligatorio
description
string | nullobligatorio
order_id
string | nullobligatorio
metadata
objectobligatorio
amount
Moneyobligatorio

Fiat amount.

crypto
object | nullobligatorio
rate
object | nullobligatorio
received
objectobligatorio
flags
objectobligatorio
customer
objectobligatorio
urls
objectobligatorio
payment_link_id
string | nullobligatorio
product_id
string | nullobligatorio
source
"link" | "api" | "manual" | "billing"obligatorio
created_at
stringobligatorio

ISO 8601 UTC timestamp.

expires_at
stringobligatorio

ISO 8601 UTC timestamp.

paid_at
string | nullobligatorio
updated_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 400VALIDATION_ERROR, UNSUPPORTED_ASSET, NO_WALLET_FOR_ASSET, AMOUNT_BELOW_MINIMUM
  • 401UNAUTHENTICATED
  • 403PLAN_LIMIT_REACHED, WORKSPACE_RESTRICTED, FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 409IDEMPOTENCY_MISMATCH, IDEMPOTENCY_IN_PROGRESS
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
  • 503RATES_UNAVAILABLE
curl -X POST 'https://cryptopay.yanselmask.com/api/v1/invoices' \
  -H 'Authorization: Bearer cp_test_••••' \
  -H 'Idempotency-Key: 6f1c2a0e-order-1001' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": "25.00",
  "currency": "USD",
  "description": "T-shirt",
  "order_id": "SO-1001",
  "asset": "usdt_tron"
}'
Respuesta 201
{
  "data": {
    "id": "7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939",
    "object": "invoice",
    "number": 120,
    "status": "pending",
    "livemode": true,
    "description": "T-shirt",
    "order_id": "SO-1001",
    "metadata": {},
    "amount": {
      "value": "25.00",
      "currency": "USD",
      "minor": 2500
    },
    "crypto": {
      "asset": "usdt_tron",
      "network": "tron",
      "symbol": "USDT",
      "amount": "25.02",
      "amount_base_units": "25020000",
      "decimals": 6,
      "address": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
      "uri": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
      "required_confirmations": 19
    },
    "rate": {
      "fiat_per_asset": "1",
      "locked_at": "2026-10-10T12:00:00.000Z",
      "expires_at": "2026-10-10T13:00:00.000Z"
    },
    "received": {
      "amount": "0",
      "amount_base_units": "0",
      "confirmed_base_units": "0"
    },
    "flags": {
      "paid_late": false,
      "underpaid_accepted": false
    },
    "customer": {
      "email": null,
      "name": null
    },
    "urls": {
      "checkout": "https://pay.example.com/pay/7d61…",
      "receipt": "https://pay.example.com/pay/7d61…/receipt",
      "success": null,
      "cancel": null
    },
    "payment_link_id": null,
    "product_id": null,
    "source": "api",
    "created_at": "2026-10-10T12:00:00.000Z",
    "expires_at": "2026-10-10T13:00:00.000Z",
    "paid_at": null,
    "updated_at": "2026-10-10T12:00:00.000Z"
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Obtener una factura

GET/invoices/{id}

Estado actual de una factura, con los importes recibidos y confirmados.

Permiso necesario: invoices:read

Parámetros

Campo
id
stringobligatorio

Path

Devuelve Invoice

Campo
id
stringobligatorio
object
"invoice"obligatorio
number
integerobligatorio
status
enum (8)obligatorio
livemode
booleanobligatorio
description
string | nullobligatorio
order_id
string | nullobligatorio
metadata
objectobligatorio
amount
Moneyobligatorio

Fiat amount.

crypto
object | nullobligatorio
rate
object | nullobligatorio
received
objectobligatorio
flags
objectobligatorio
customer
objectobligatorio
urls
objectobligatorio
payment_link_id
string | nullobligatorio
product_id
string | nullobligatorio
source
"link" | "api" | "manual" | "billing"obligatorio
created_at
stringobligatorio

ISO 8601 UTC timestamp.

expires_at
stringobligatorio

ISO 8601 UTC timestamp.

paid_at
string | nullobligatorio
updated_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 404NOT_FOUND
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X GET 'https://cryptopay.yanselmask.com/api/v1/invoices/7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939' \
  -H 'Authorization: Bearer cp_test_••••'
Respuesta 200
{
  "data": {
    "id": "7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939",
    "object": "invoice",
    "number": 120,
    "status": "pending",
    "livemode": true,
    "description": "T-shirt",
    "order_id": "SO-1001",
    "metadata": {},
    "amount": {
      "value": "25.00",
      "currency": "USD",
      "minor": 2500
    },
    "crypto": {
      "asset": "usdt_tron",
      "network": "tron",
      "symbol": "USDT",
      "amount": "25.02",
      "amount_base_units": "25020000",
      "decimals": 6,
      "address": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
      "uri": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
      "required_confirmations": 19
    },
    "rate": {
      "fiat_per_asset": "1",
      "locked_at": "2026-10-10T12:00:00.000Z",
      "expires_at": "2026-10-10T13:00:00.000Z"
    },
    "received": {
      "amount": "0",
      "amount_base_units": "0",
      "confirmed_base_units": "0"
    },
    "flags": {
      "paid_late": false,
      "underpaid_accepted": false
    },
    "customer": {
      "email": null,
      "name": null
    },
    "urls": {
      "checkout": "https://pay.example.com/pay/7d61…",
      "receipt": "https://pay.example.com/pay/7d61…/receipt",
      "success": null,
      "cancel": null
    },
    "payment_link_id": null,
    "product_id": null,
    "source": "api",
    "created_at": "2026-10-10T12:00:00.000Z",
    "expires_at": "2026-10-10T13:00:00.000Z",
    "paid_at": null,
    "updated_at": "2026-10-10T12:00:00.000Z"
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Cancelar una factura

POST/invoices/{id}/cancel

Cancela una factura new, pending o expired que no haya recibido fondos.

Permiso necesario: invoices:write

Parámetros

Campo
id
stringobligatorio

Path

Devuelve Invoice

Campo
id
stringobligatorio
object
"invoice"obligatorio
number
integerobligatorio
status
enum (8)obligatorio
livemode
booleanobligatorio
description
string | nullobligatorio
order_id
string | nullobligatorio
metadata
objectobligatorio
amount
Moneyobligatorio

Fiat amount.

crypto
object | nullobligatorio
rate
object | nullobligatorio
received
objectobligatorio
flags
objectobligatorio
customer
objectobligatorio
urls
objectobligatorio
payment_link_id
string | nullobligatorio
product_id
string | nullobligatorio
source
"link" | "api" | "manual" | "billing"obligatorio
created_at
stringobligatorio

ISO 8601 UTC timestamp.

expires_at
stringobligatorio

ISO 8601 UTC timestamp.

paid_at
string | nullobligatorio
updated_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 404NOT_FOUND
  • 409INVALID_STATE
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X POST 'https://cryptopay.yanselmask.com/api/v1/invoices/7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939/cancel' \
  -H 'Authorization: Bearer cp_test_••••'
Respuesta 200
{
  "data": {
    "id": "7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939",
    "object": "invoice",
    "number": 120,
    "status": "pending",
    "livemode": true,
    "description": "T-shirt",
    "order_id": "SO-1001",
    "metadata": {},
    "amount": {
      "value": "25.00",
      "currency": "USD",
      "minor": 2500
    },
    "crypto": {
      "asset": "usdt_tron",
      "network": "tron",
      "symbol": "USDT",
      "amount": "25.02",
      "amount_base_units": "25020000",
      "decimals": 6,
      "address": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
      "uri": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
      "required_confirmations": 19
    },
    "rate": {
      "fiat_per_asset": "1",
      "locked_at": "2026-10-10T12:00:00.000Z",
      "expires_at": "2026-10-10T13:00:00.000Z"
    },
    "received": {
      "amount": "0",
      "amount_base_units": "0",
      "confirmed_base_units": "0"
    },
    "flags": {
      "paid_late": false,
      "underpaid_accepted": false
    },
    "customer": {
      "email": null,
      "name": null
    },
    "urls": {
      "checkout": "https://pay.example.com/pay/7d61…",
      "receipt": "https://pay.example.com/pay/7d61…/receipt",
      "success": null,
      "cancel": null
    },
    "payment_link_id": null,
    "product_id": null,
    "source": "api",
    "created_at": "2026-10-10T12:00:00.000Z",
    "expires_at": "2026-10-10T13:00:00.000Z",
    "paid_at": null,
    "updated_at": "2026-10-10T12:00:00.000Z"
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Productos

Listar productos

GET/products

Productos del catálogo, los más recientes primero.

Permiso necesario: products:read

Parámetros

Campo
limit
integer

Query · Page size (1–100).

cursor
string

Query · Opaque cursor from meta.next_cursor.

Devuelve una lista de Product

Campo
id
stringobligatorio
object
"product"obligatorio
name
stringobligatorio
description
string | nullobligatorio
image_url
string | nullobligatorio
price
Moneyobligatorio

Fiat amount.

sku
string | nullobligatorio
is_active
booleanobligatorio
created_at
stringobligatorio

ISO 8601 UTC timestamp.

updated_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 400VALIDATION_ERROR
  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X GET 'https://cryptopay.yanselmask.com/api/v1/products' \
  -H 'Authorization: Bearer cp_test_••••'
Respuesta 200
{
  "data": [
    {
      "price": {
        "value": "25.00",
        "currency": "USD",
        "minor": 2500
      },
      "created_at": "2026-10-10T12:00:00.000Z",
      "updated_at": "2026-10-10T12:00:00.000Z"
    }
  ],
  "meta": {
    "next_cursor": null,
    "has_more": false
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Crear un producto

POST/products

Añade un producto al catálogo. sku debe ser único en el workspace.

Permiso necesario: products:write

Cuerpo de la petición

Campo
name
stringobligatorio
description
string
price
string | numberobligatorio

Decimal amount as a string (recommended) or number.

currency
enum (10)obligatorio

ISO 4217 fiat currency.

sku
string

Devuelve Product

Campo
id
stringobligatorio
object
"product"obligatorio
name
stringobligatorio
description
string | nullobligatorio
image_url
string | nullobligatorio
price
Moneyobligatorio

Fiat amount.

sku
string | nullobligatorio
is_active
booleanobligatorio
created_at
stringobligatorio

ISO 8601 UTC timestamp.

updated_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 400VALIDATION_ERROR
  • 401UNAUTHENTICATED
  • 403WORKSPACE_RESTRICTED, FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 409IDEMPOTENCY_MISMATCH, IDEMPOTENCY_IN_PROGRESS
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X POST 'https://cryptopay.yanselmask.com/api/v1/products' \
  -H 'Authorization: Bearer cp_test_••••' \
  -H 'Idempotency-Key: 6f1c2a0e-order-1001' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "T-shirt",
  "price": "25.00",
  "currency": "USD",
  "sku": "TSHIRT-01"
}'
Respuesta 201
{
  "data": {
    "price": {
      "value": "25.00",
      "currency": "USD",
      "minor": 2500
    },
    "created_at": "2026-10-10T12:00:00.000Z",
    "updated_at": "2026-10-10T12:00:00.000Z"
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Obtener un producto

GET/products/{id}

Un producto del catálogo.

Permiso necesario: products:read

Parámetros

Campo
id
stringobligatorio

Path

Devuelve Product

Campo
id
stringobligatorio
object
"product"obligatorio
name
stringobligatorio
description
string | nullobligatorio
image_url
string | nullobligatorio
price
Moneyobligatorio

Fiat amount.

sku
string | nullobligatorio
is_active
booleanobligatorio
created_at
stringobligatorio

ISO 8601 UTC timestamp.

updated_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 404NOT_FOUND
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X GET 'https://cryptopay.yanselmask.com/api/v1/products/7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939' \
  -H 'Authorization: Bearer cp_test_••••'
Respuesta 200
{
  "data": {
    "price": {
      "value": "25.00",
      "currency": "USD",
      "minor": 2500
    },
    "created_at": "2026-10-10T12:00:00.000Z",
    "updated_at": "2026-10-10T12:00:00.000Z"
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Pagos

Listar pagos

GET/payments

Transferencias en cadena atribuidas a facturas del modo de la clave, las más recientes primero. Filtra por invoice_id.

Permiso necesario: payments:read

Parámetros

Campo
limit
integer

Query · Page size (1–100).

cursor
string

Query · Opaque cursor from meta.next_cursor.

invoice_id
string

Query

Devuelve una lista de Payment

Campo
id
stringobligatorio
object
"payment"obligatorio
invoice_id
stringobligatorio
livemode
booleanobligatorio
network
stringobligatorio
asset
stringobligatorio
txid
stringobligatorio
output_index
integerobligatorio
from_address
string | nullobligatorio
to_address
stringobligatorio
amount
stringobligatorio
amount_base_units
stringobligatorio
confirmations
integerobligatorio
status
"detected" | "confirmed" | "failed"obligatorio
block_height
integer | nullobligatorio
block_time
string | nullobligatorio
explorer_url
string | nullobligatorio
first_seen_at
stringobligatorio

ISO 8601 UTC timestamp.

confirmed_at
string | nullobligatorio

Errores

  • 400VALIDATION_ERROR
  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X GET 'https://cryptopay.yanselmask.com/api/v1/payments' \
  -H 'Authorization: Bearer cp_test_••••'
Respuesta 200
{
  "data": [
    {
      "first_seen_at": "2026-10-10T12:00:00.000Z"
    }
  ],
  "meta": {
    "next_cursor": null,
    "has_more": false
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Monedas y tasas

Listar monedas

GET/currencies

Activos cripto que admite la plataforma, con importe mínimo, confirmaciones y si este workspace puede recibirlos ahora.

Permiso necesario: rates:read

Devuelve una lista de Currency

Campo
asset
stringobligatorio
network
stringobligatorio
symbol
stringobligatorio
name
stringobligatorio
decimals
integerobligatorio
kind
"native" | "token"obligatorio
contract
string | nullobligatorio
min_amount
stringobligatorio
min_amount_base_units
stringobligatorio
required_confirmations
integerobligatorio
enabled_for_workspace
booleanobligatorio

Errores

  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X GET 'https://cryptopay.yanselmask.com/api/v1/currencies' \
  -H 'Authorization: Bearer cp_test_••••'

Obtener tasas de cambio

GET/rates

Precio actual de cada activo en una moneda fiat (fiat, USD por defecto). Envía asset para un solo activo.

Permiso necesario: rates:read

Parámetros

Campo
fiat
enum (10)

Query · ISO 4217 fiat currency.

asset
enum (22)

Query · Asset id: <symbol>_<network>.

Devuelve una lista de Rate

Campo
fiat
stringobligatorio
asset
stringobligatorio
fiat_per_asset
stringobligatorio
asset_usd
stringobligatorio
fetched_at
stringobligatorio

ISO 8601 UTC timestamp.

stale
booleanobligatorio

Errores

  • 400VALIDATION_ERROR
  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
  • 503RATES_UNAVAILABLE
curl -X GET 'https://cryptopay.yanselmask.com/api/v1/rates' \
  -H 'Authorization: Bearer cp_test_••••'
Respuesta 200
{
  "data": [
    {
      "fetched_at": "2026-10-10T12:00:00.000Z"
    }
  ],
  "meta": {
    "next_cursor": null,
    "has_more": false
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Estimar un importe cripto

POST/estimate

Convierte un precio fiat a un activo con la tasa actual. La tasa no queda fijada: crea una factura para fijarla.

Permiso necesario: rates:read

Cuerpo de la petición

Campo
amount
string | numberobligatorio

Decimal amount as a string (recommended) or number.

currency
enum (10)obligatorio

ISO 4217 fiat currency.

asset
enum (22)obligatorio

Asset id: <symbol>_<network>.

Devuelve Estimate

Campo
amount
Moneyobligatorio

Fiat amount.

asset
stringobligatorio
crypto_amount
stringobligatorio
amount_base_units
stringobligatorio
rate
Rateobligatorio

Price of 1 unit of the asset in the fiat currency.

Errores

  • 400VALIDATION_ERROR
  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
  • 503RATES_UNAVAILABLE
curl -X POST 'https://cryptopay.yanselmask.com/api/v1/estimate' \
  -H 'Authorization: Bearer cp_test_••••' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": "100.00",
  "currency": "EUR",
  "asset": "btc_bitcoin"
}'
Respuesta 200
{
  "data": {
    "amount": {
      "value": "25.00",
      "currency": "USD",
      "minor": 2500
    },
    "rate": {
      "fetched_at": "2026-10-10T12:00:00.000Z"
    }
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Endpoints de webhook

Listar endpoints de webhook

GET/webhook-endpoints

Endpoints que reciben eventos. Aquí nunca se devuelven los secretos.

Permiso necesario: webhooks:manage

Devuelve una lista de WebhookEndpoint

Campo
id
stringobligatorio
object
"webhook_endpoint"obligatorio
url
stringobligatorio
description
string | nullobligatorio
events
string[]obligatorio
mode
"live" | "test" | "both"obligatorio
is_active
booleanobligatorio
secret
string

Only returned once, when the endpoint is created.

created_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X GET 'https://cryptopay.yanselmask.com/api/v1/webhook-endpoints' \
  -H 'Authorization: Bearer cp_test_••••'
Respuesta 200
{
  "data": [
    {
      "created_at": "2026-10-10T12:00:00.000Z"
    }
  ],
  "meta": {
    "next_cursor": null,
    "has_more": false
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Crear un endpoint de webhook

POST/webhook-endpoints

La URL debe ser https:// pública (http://localhost solo para endpoints de prueba). El secret de firma solo se devuelve en esta respuesta.

Permiso necesario: webhooks:manage

Cuerpo de la petición

Campo
url
stringobligatorio
description
string
events
enum (13)[]
mode
"live" | "test" | "both"

Devuelve WebhookEndpoint

Campo
id
stringobligatorio
object
"webhook_endpoint"obligatorio
url
stringobligatorio
description
string | nullobligatorio
events
string[]obligatorio
mode
"live" | "test" | "both"obligatorio
is_active
booleanobligatorio
secret
string

Only returned once, when the endpoint is created.

created_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 400VALIDATION_ERROR
  • 401UNAUTHENTICATED
  • 403PLAN_LIMIT_REACHED, FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 409INVALID_STATE, IDEMPOTENCY_MISMATCH, IDEMPOTENCY_IN_PROGRESS
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X POST 'https://cryptopay.yanselmask.com/api/v1/webhook-endpoints' \
  -H 'Authorization: Bearer cp_test_••••' \
  -H 'Idempotency-Key: 6f1c2a0e-order-1001' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://shop.example.com/webhooks/crypto",
  "events": [
    "*"
  ]
}'
Respuesta 201
{
  "data": {
    "created_at": "2026-10-10T12:00:00.000Z"
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}

Eliminar un endpoint de webhook

DELETE/webhook-endpoints/{id}

Elimina el endpoint y sus entregas pendientes.

Permiso necesario: webhooks:manage

Parámetros

Campo
id
stringobligatorio

Path

Devuelve Deleted

Campo
id
stringobligatorio
deleted
trueobligatorio

Errores

  • 401UNAUTHENTICATED
  • 403FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 404NOT_FOUND
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X DELETE 'https://cryptopay.yanselmask.com/api/v1/webhook-endpoints/7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939' \
  -H 'Authorization: Bearer cp_test_••••'

Pruebas

Simular un pago

POST/test/invoices/{id}/simulate

Solo claves de prueba. Lleva una factura de prueba a paid, partial, overpaid o expired por la misma máquina de estados que los pagos reales, emitiendo eventos y webhooks con livemode: false. Una factura en new toma primero el primer activo que el workspace puede recibir.

Permiso necesario: invoices:write · solo claves de prueba

Parámetros

Campo
id
stringobligatorio

Path

Cuerpo de la petición

Campo
scenario
"paid" | "partial" | "overpaid" | "expired"obligatorio

Devuelve Invoice

Campo
id
stringobligatorio
object
"invoice"obligatorio
number
integerobligatorio
status
enum (8)obligatorio
livemode
booleanobligatorio
description
string | nullobligatorio
order_id
string | nullobligatorio
metadata
objectobligatorio
amount
Moneyobligatorio

Fiat amount.

crypto
object | nullobligatorio
rate
object | nullobligatorio
received
objectobligatorio
flags
objectobligatorio
customer
objectobligatorio
urls
objectobligatorio
payment_link_id
string | nullobligatorio
product_id
string | nullobligatorio
source
"link" | "api" | "manual" | "billing"obligatorio
created_at
stringobligatorio

ISO 8601 UTC timestamp.

expires_at
stringobligatorio

ISO 8601 UTC timestamp.

paid_at
string | nullobligatorio
updated_at
stringobligatorio

ISO 8601 UTC timestamp.

Errores

  • 400VALIDATION_ERROR, NO_WALLET_FOR_ASSET
  • 401UNAUTHENTICATED
  • 403TEST_MODE_ONLY, FORBIDDEN_SCOPE, WORKSPACE_SUSPENDED
  • 404NOT_FOUND
  • 409INVALID_STATE
  • 429RATE_LIMITED
  • 500INTERNAL_ERROR
curl -X POST 'https://cryptopay.yanselmask.com/api/v1/test/invoices/7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939/simulate' \
  -H 'Authorization: Bearer cp_test_••••' \
  -H 'Content-Type: application/json' \
  -d '{
  "scenario": "paid"
}'
Respuesta 200
{
  "data": {
    "id": "7d61d9f9-a9e4-49c1-a1b8-b5d465d7a939",
    "object": "invoice",
    "number": 120,
    "status": "pending",
    "livemode": true,
    "description": "T-shirt",
    "order_id": "SO-1001",
    "metadata": {},
    "amount": {
      "value": "25.00",
      "currency": "USD",
      "minor": 2500
    },
    "crypto": {
      "asset": "usdt_tron",
      "network": "tron",
      "symbol": "USDT",
      "amount": "25.02",
      "amount_base_units": "25020000",
      "decimals": 6,
      "address": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
      "uri": "TJYeasTPa6gpEEfYqeoTBpFkqZ4jhy5zj7",
      "required_confirmations": 19
    },
    "rate": {
      "fiat_per_asset": "1",
      "locked_at": "2026-10-10T12:00:00.000Z",
      "expires_at": "2026-10-10T13:00:00.000Z"
    },
    "received": {
      "amount": "0",
      "amount_base_units": "0",
      "confirmed_base_units": "0"
    },
    "flags": {
      "paid_late": false,
      "underpaid_accepted": false
    },
    "customer": {
      "email": null,
      "name": null
    },
    "urls": {
      "checkout": "https://pay.example.com/pay/7d61…",
      "receipt": "https://pay.example.com/pay/7d61…/receipt",
      "success": null,
      "cancel": null
    },
    "payment_link_id": null,
    "product_id": null,
    "source": "api",
    "created_at": "2026-10-10T12:00:00.000Z",
    "expires_at": "2026-10-10T13:00:00.000Z",
    "paid_at": null,
    "updated_at": "2026-10-10T12:00:00.000Z"
  },
  "error": null,
  "request_id": "req_01J9ZQ3K5W8X2N4M6P7R9S1T3V"
}