Skip to content

bitpay.php

Bitpay service integration for managing cryptocurrency payments via Bitpay, including payment verification and invoice initialization.

API Methods

Method Action Description
check_payment get check_payment status Verifies the current status of a Bitpay payment and records it in the billing system if completed.
init initialize bitpay invoice Initializes a Bitpay invoice for the specified client and redirects to the payment URL.

bitpay/check_payment

Verifies the current status of a Bitpay payment and records it in the billing system if completed.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: check_payment
token ✅ string Authentication token for API access.
id ✅ integer The Bitpay payment ID to check.
invoice_id ❌ integer The unique identifier of the invoice to be processed.
invoiceId ❌ string Identifier for the specific invoice being checked.
source ❌ string The origin of the request used to determine processing logic.

Request example

curl -s "https://invapi.hostkey.com/bitpay.php" -X POST \
--data "action=check_payment" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE"
Success response example
{
"result": "OK",
"message": "Paid",
"invoice_id": 123,
"rate": 1,
"comission": 0,
"subscription_activated": 0
}
Error examples
{
"code": -1,
"message": "Invalid payment id"
}

bitpay/init

Initializes a Bitpay invoice for the specified client and redirects to the payment URL.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: init
token ✅ string Authentication token for API access.
data ✅ array<string> Data object containing client information and invoice details.
url ❌ string Redirect URL for the payment process.
invoice_id ✅ integer The unique identifier of the WHMCS invoice to be processed.
invoiceId ❌ string The identification number for the invoice.

Request example

curl -s "https://invapi.hostkey.com/bitpay.php" -X POST \
--data "action=init" \
--data "token=VALUE" \
--data "data[]=VALUE1" \
--data "data[]=VALUE2" \
--data "invoice_id=VALUE"
Success response example
{
"result": "OK",
"message": "https://bitpay.com/example-url",
"url": "https://bitpay.com/example-url"
}
Error examples
{
"code": -1,
"message": "BITPAY init failed"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×