Billing
The billing endpoints allow you to manage your billing information, including adding, deleting, and listing payment methods, as well as handling invoices and orders.
List Cards
This endpoint allows you to list all cards.
Request
curl -G https://api.puregpu.com/billing/stripe/cards \
-H "X-API-Key: {token}"
Response
{
"result": "success",
"payment_methods": [
{
"id": 15, // Card ID
"type": "RemoteCreditCard",
"description": "STRIPE CARD",
"gateway_name": "stripe",
"contact_type": "Client",
"contact_id": 2,
"card_last_four": "4242",
"expiry_date": "01/30",
"start_date": "",
"issue_number": "",
"card_type": "Visa",
"remote_token": "{\"customer\":\"cus_Pil9K60xftjZ88\",\"method\":\"pm_1P6wzCFTTwwr4vA7vu6Rb5Iz\"}",
"last_updated": "04/18/2024 13:49"
},
]
}
Add Card
This endpoint allows you to add a new card for payments.
Required attributes
- Name
stripe_payment_method_id
- Type
- string
- Description
The ID of the Stripe payment method.
Request
curl -X POST https://api.puregpu.com/billing/stripe/cards \
-H "X-API-Key: {token}" \
-H "Content-Type: application/json" \
-d '{
"stripe_payment_method_id": "pm_1P6wzCFTTwwr4vA7vu6Rb5Iz"
}'
Response
{
"result": "success"
}
Delete Card
This endpoint allows you to delete a card.
Required attributes
- Name
cardId
- Type
- string
- Description
The ID of the card to delete, fetched from the list cards endpoint.
Request
curl -X DELETE https://api.puregpu.com/billing/stripe/cards/15 \
-H "X-API-Key: {token}"
Response
{
"result": "success"
}
Set Default Card
This endpoint allows you to set a default card for payments.
Required attributes
- Name
paymethodid
- Type
- string
- Description
The ID of the card to set as default, fetched from the list cards endpoint.
Request
curl -X PUT https://api.puregpu.com/billing/stripe/cards/15/default \
-H "X-API-Key: {token}"
Response
{
"result": "success"
}
List Currencies
This endpoint allows you to list all supported cryptocurrencies.
Request
curl -G https://api.puregpu.com/billing/crypto/currencies \
-H "X-API-Key: {token}"
Response
{
"result": "success",
"currencies": [...]
}
Create Payment
This endpoint allows you to create a cryptocurrency payment.
Required attributes
- Name
invoice_id
- Type
- integer
- Description
The ID of the invoice to pay.
- Name
currency
- Type
- string
- Description
The cryptocurrency to pay with, fetched from the list currencies endpoint.
Request
curl -X POST https://api.puregpu.com/billing/crypto/payments \
-H "X-API-Key: {token}" \
-H "Content-Type: application/json" \
-d '{
"invoice_id": 34,
"currency": "BTC"
}'
Response
{
"result": "success",
{
"result": "success",
"payment": {
"id": "4465327355", // Payment ID
"status": "waiting",
"pay_address": "377WTjsTJ7ixVTJPqzFvYWh24HKyjKKXKj",
"price_amount": 25,
"price_currency": "usd",
"pay_amount": 0.0006047,
"pay_currency": "btc",
"created_at": "2024-06-09T15:23:43.444Z",
"updated_at": "2024-06-09T15:23:43.444Z",
"payin_extra_id": null,
"network": "btc",
"time_limit": null,
"expiration_estimate_date": "2024-06-09T15:43:43.443Z",
"valid_until": "2024-06-16T15:23:43.443Z"
}
}
}
Get Payment
This endpoint allows you to get details of a cryptocurrency payment.
Required attributes
- Name
paymentId
- Type
- string
- Description
The ID of the payment to retrieve, fetched from the create payment endpoint.
Request
curl -G https://api.puregpu.com/billing/crypto/payments/34 \
-H "X-API-Key: {token}"
Response
{
"result": "success",
"payment": {
"id": 4465327355,
"status": "finished",
"pay_address": "377WTjsTJ7ixVTJPqzFvYWh24HKyjKKXKj",
"price_amount": 25,
"price_currency": "usd",
"pay_amount": 0.0006047,
"pay_currency": "btc",
"created_at": "2024-06-09T15:23:43.444Z",
"updated_at": "2024-06-09T15:23:53.689Z",
"payin_extra_id": null
}
}
List Products
This endpoint allows you to list all available products.
Request
curl -G https://api.puregpu.com/billing/products \
-H "X-API-Key: {token}"
Response
{
"result": "success",
"products": [
{
"pid": 1,
"type": "server",
"name": "4090-1x-server",
"meta": {
"gpu_name": "RTX 4090",
"gpu_vram": "24",
"gpu_manufacturer": "NVIDIA",
"gpu_count": "1",
"cpu_name": "AMD EPYC 9334",
"cpu_cores": "16",
"cpu_clock": "3.9",
"cpu_manufacturer": "AMD",
"ram": "128",
"ram_type": "DDR5",
"disk_space": "1024",
"disk_type": "NVME"
},
"pricing": {
"hourly": 0.5,
"monthly": 400
}
}
]
}
Get Product
This endpoint allows you to get details of a specific product.
Required attributes
- Name
productId
- Type
- string
- Description
The ID of the product to retrieve, fetched from the list products endpoint.
Request
curl -G https://api.puregpu.com/billing/products/1 \
-H "X-API-Key: {token}"
Response
{
"result": "success",
"product": {
"pid": 1,
"type": "server",
"name": "4090-1x-server",
"meta": {
"gpu_name": "RTX 4090",
"gpu_vram": "24",
"gpu_manufacturer": "NVIDIA",
"gpu_count": "1",
"cpu_name": "AMD EPYC 9334",
"cpu_cores": "16",
"cpu_clock": "3.9",
"cpu_manufacturer": "AMD",
"ram": "128",
"ram_type": "DDR5",
"disk_space": "1024",
"disk_type": "NVME"
},
"pricing": {
"hourly": 0.5,
"monthly": 400
}
}
}
Add Order
This endpoint allows you to create a new order for a product.
Required attributes
- Name
pid
- Type
- integer
- Description
The ID of the product to order, fetched from the list products endpoint.
- Name
billingcycle
- Type
- string
- Description
The billing cycle for the order (e.g., hourly).
- Name
hostname
- Type
- string
- Description
The hostname for the order.
- Name
os
- Type
- string
- Description
The operating system for the order.
- Name
sshkeys
- Type
- string
- Description
SSH keys for the order.
Request
curl -X POST https://api.puregpu.com/billing/orders \
-H "X-API-Key: {token}" \
-H "Content-Type: application/json" \
-d '{
"pid": 1,
"billingcycle": "hourly",
"hostname": "test",
"os": "",
"sshkeys": ""
}'
Response
{
"result": "success"
}
Add Funds Invoice
This endpoint allows you to add funds to your account.
Required attributes
- Name
amount
- Type
- integer|float
- Description
The amount to add in USD.
Request
curl -X POST https://api.puregpu.com/billing/invoices/funds \
-H "X-API-Key: {token}" \
-H "Content-Type: application/json" \
-d '{
"amount": 10
}'
Response
{
"result": "success",
"invoice_id": 42
}
Get Balance
This endpoint allows you to get your current balance.
Request
curl -G https://api.puregpu.com/billing/balance \
-H "X-API-Key: {token}"
Response
{
"result": "success",
"balance": 100.0
}
List Invoices
This endpoint allows you to list all invoices.
Request
curl -G https://api.puregpu.com/billing/invoices \
-H "X-API-Key: {token}"
Response
{
"result": "success",
"invoices": [
{
"id": 71,
"date": "2024-06-09",
"duedate": "2024-06-23",
"datepaid": "0000-00-00 00:00:00",
"subtotal": "10.00",
"credit": "0.00",
"total": "10.00",
"status": "Unpaid"
},
{
"id": 70,
"date": "2024-06-09",
"duedate": "2024-06-23",
"datepaid": "2024-06-09 11:23:54",
"subtotal": "25.00",
"credit": "0.00",
"total": "25.00",
"status": "Paid"
}
]
}
Get Invoice
This endpoint allows you to get details of a specific invoice.
Required attributes
- Name
invoiceId
- Type
- integer
- Description
The ID of the invoice to retrieve, fetched from the list invoices endpoint.
Request
curl -G https://api.puregpu.com/billing/invoices/41 \
-H "X-API-Key: {token}"
Response
{
"result": "success",
"invoice": {
"date": "2024-06-09",
"duedate": "2024-06-23",
"datepaid": "0000-00-00 00:00:00",
"subtotal": "10.00",
"credit": "0.00",
"total": "10.00",
"balance": "10.00",
"status": "Unpaid",
"items": [
{
"id": 77,
"type": "AddFunds",
"description": "Add Funds",
"amount": "10.00"
}
]
}
}