VyCheckout API

Accept payments on your website through VyCheckout. Your customers pay on our hosted page, funds land in your VyCheckout balance, and you withdraw anytime.

REST API PayPal Payments Instant Setup

How It Works

1. Sign up & get your API key
Create a free account at vycheckout.com → go to API Keys tab → click Generate New Key. Copy your vy_... key.
2. Create a payment collection
Call the API from your server with the item name and amount. You get back a payment_url.
3. Redirect your customer
Send your customer to the payment_url. They pay on VyCheckout's secure hosted page via PayPal.
4. Funds appear in your balance
Payment is processed and credited to your VyCheckout balance minus the platform fee. You can see it in your dashboard and request a withdrawal anytime.
💡 Base URL: https://admvtnirnjfikquognbl.supabase.co/functions/v1/api

Authentication

All requests must include your API key in the Authorization header.

Authorization: Bearer vy_your_api_key_here
⚠️ Keep your API key on your server only. Never put it in frontend JavaScript — anyone can see it.

Error Handling

The API uses standard HTTP status codes. All errors return a JSON body.

StatusMeaning
200Success
201Created
400Bad request — missing or invalid parameters
401Unauthorized — invalid or missing API key
404Endpoint not found
{"error": "Unauthorized", "message": "Invalid or missing API key"}

Balance

GET /balance
Get your current account balance and total earnings.
curl https://admvtnirnjfikquognbl.supabase.co/functions/v1/api/balance \
  -H "Authorization: Bearer vy_your_key"
{
  "balance": 840.00,
  "total_earned": 4210.00,
  "ref_earned": 42.00,
  "currency": "USD"
}

Collections

POST /collections/create
Create a payment page. Returns a hosted payment URL to redirect your customer to.
ParameterTypeDescription
namerequiredstringPayment title shown to customer
amountrequirednumberAmount to charge
currencystringCurrency code — default USD
descriptionstringOptional description shown to customer
curl -X POST .../api/collections/create \
  -H "Authorization: Bearer vy_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name":"Order #1234","amount":49.99,"currency":"USD","description":"Monthly plan"}'
{
  "id": "a1b2c3d4-...",
  "name": "Order #1234",
  "amount": 49.99,
  "currency": "USD",
  "payment_url": "https://vycheckout.com/?pay=col:a1b2c3d4-...",
  "created_at": "2025-04-30T12:00:00Z"
}
👆 Redirect your customer to payment_url — they pay on VyCheckout's hosted page and funds go straight to your balance.
GET /collections
List all your collections.
curl .../api/collections \
  -H "Authorization: Bearer vy_your_key"

Transactions

GET /transactions
List all successful payments received. Supports filtering.
Query ParamTypeDescription
limitnumberMax results (default 50, max 200)
fromdateFilter from date (ISO 8601)
todateFilter to date (ISO 8601)
curl ".../api/transactions?limit=10&from=2025-01-01" \
  -H "Authorization: Bearer vy_your_key"
{
  "transactions": [
    {
      "id": "txn-uuid",
      "description": "Order #1234",
      "payer_name": "John Doe",
      "gross_amount": 49.99,
      "net_amount": 45.49,
      "fee_amount": 4.50,
      "payment_method": "PayPal",
      "created_at": "2025-04-30T12:00:00Z"
    }
  ],
  "count": 1
}

Webhooks

Register a URL to receive real-time notifications when payments succeed on your collections.

POST /webhooks/register
curl -X POST .../api/webhooks/register \
  -H "Authorization: Bearer vy_your_key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://yoursite.com/webhook","events":["payment.succeeded"]}'

VyCheckout will POST this to your URL when a payment succeeds:

{
  "event": "payment.succeeded",
  "data": {
    "transaction_id": "uuid",
    "amount": 49.99,
    "currency": "USD",
    "payer_name": "John Doe",
    "description": "Order #1234",
    "payment_method": "PayPal",
    "created_at": "2025-04-30T12:00:00Z"
  }
}

Code Examples

JavaScript / Node.js

javascript
// Create a payment and redirect customer
const res = await fetch(
  'https://admvtnirnjfikquognbl.supabase.co/functions/v1/api/collections/create',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer vy_your_key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Order #1234',
      amount: 49.99,
      currency: 'USD'
    })
  }
);

const data = await res.json();

// Redirect customer to pay
window.location.href = data.payment_url;
// → https://vycheckout.com/?pay=col:uuid
// Customer pays → funds go to your VyCheckout balance

Python

python
import requests

response = requests.post(
    'https://admvtnirnjfikquognbl.supabase.co/functions/v1/api/collections/create',
    headers={
        'Authorization': 'Bearer vy_your_key',
        'Content-Type': 'application/json'
    },
    json={
        'name': 'Order #1234',
        'amount': 49.99,
        'currency': 'USD'
    }
)

data = response.json()
payment_url = data['payment_url']
print(payment_url)
# Redirect your customer to payment_url

PHP

php
<?php
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => 'https://admvtnirnjfikquognbl.supabase.co/functions/v1/api/collections/create',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer vy_your_key',
        'Content-Type: application/json'
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'name'     => 'Order #1234',
        'amount'   => 49.99,
        'currency' => 'USD'
    ])
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

// Redirect customer
header('Location: ' . $response['payment_url']);
exit;

Ready to integrate?

Create your free account and get your API key in 30 seconds.

Get started free →