API Documentation
Integrate OrvexPay's crypto payment infrastructure into your application with our robust REST API.
Need specialized help?
Contact our technical support team for custom integration solutions.
Contact SupportGeneral Information
OrvexPay provides a RESTful API that allows you to accept cryptocurrency payments globally. All requests should be made to our base URL and use JSON for the request body. Responses are standard JSON objects.
Authentication
Public payment API calls (such as POST /api/invoice) are authenticated via a x-api-key header. You can create and manage API keys in the API Keys section of your merchant dashboard.
Security Best Practice
Never share your API keys or commit them to public repositories. If a key is compromised, revoke it immediately and generate a new one from the API Keys page.
Dashboard endpoints (for example /api/merchant/*) use bearer authentication with the merchant's session token and are not intended for public client integrations.
1. Create Invoice
/api/invoiceCreates a new on-chain payment invoice for your customer. The response contains a unique invoice id, payment address and expected amount.
Request Body
| Field | Type | Required |
|---|---|---|
| priceAmount | string (decimal as string, e.g. "100.00") | Yes |
| priceCurrency | string (fiat ISO code, e.g. "USD") | Yes |
| payCurrency | string (crypto code, e.g. "BTC") | Yes |
| successUrl | string (URL) | Yes |
| cancelUrl | string (URL) | Yes |
| orderId | string | No |
| orderDescription | string | No |
| isDonation | boolean | No |
Example Request
curl -X POST "https://api.orvexpay.com/api/invoice" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"priceAmount": "100.00",
"priceCurrency": "USD",
"payCurrency": "BTC",
"successUrl": "https://yourapp.com/payment/success",
"cancelUrl": "https://yourapp.com/payment/cancel",
"orderId": "ORDER-123",
"orderDescription": "Premium Subscription"
}'Example Response
{
"id": "b9e2f8b7-4c41-4c0c-8f7f-4a1e9c2c9c01",
"orderId": "ORDER-123",
"orderDescription": "Premium Subscription",
"priceAmount": 100.00,
"priceAmountInUsd": 3.45,
"amountReceived": 0,
"priceCurrency": "USD",
"payCurrency": "BTC",
"status": "Waiting",
"createdAt": "2025-01-01T12:00:00Z",
"expiredAt": "2025-01-01T12:30:00Z",
"address": "bc1qxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"amountExpected": 0.0025,
"successUrl": "https://yourapp.com/payment/success",
"cancelUrl": "https://yourapp.com/payment/cancel",
"projectName": "Your Project Name",
"isDonation": false
}Redirect Flow (Hosted Checkout)
The API itself returns JSON only. To mimic providers like PayTR and send the customer to a hosted payment page, you should redirect them to the OrvexPay checkout URL using the returned id:
// Example: client-side (SPA) redirect
const res = await fetch("https://api.orvexpay.com/api/invoice", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY_HERE",
},
body: JSON.stringify({
priceAmount: "100.00",
priceCurrency: "USD",
payCurrency: "BTC",
successUrl: "https://yourapp.com/payment/success",
cancelUrl: "https://yourapp.com/payment/cancel",
}),
});
const invoice = await res.json();
window.location.href = "https://orvexpay.com/pay/" + invoice.id;// Example: server-side redirect (Node/Express)
app.post("/checkout", async (req, res) => {
const apiRes = await fetch("https://api.orvexpay.com/api/invoice", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.VIREXPAY_API_KEY!,
},
body: JSON.stringify(req.body),
});
const invoice = await apiRes.json();
return res.redirect(302, "https://orvexpay.com/pay/" + invoice.id);
});2. Get Invoice Status
/api/invoice/{id}Retrieve the current status and payment details of an existing invoice by its id. This endpoint returns the same shape as the create-invoice response.