📅  最后修改于: 2023-12-03 14:59:31.892000             🧑  作者: Mango
The Bluecode API is a powerful tool for developers to integrate Bluecode payment solutions into their applications. Bluecode is a popular mobile payment method in Europe that allows users to make payments simply by scanning a QR code. This API provides a seamless way to integrate Bluecode payment functionality into your application, helping you to enhance the user experience and streamline payment processes.
Note: Before you can start using the Bluecode API, you need to obtain API credentials by registering with Bluecode and obtaining your API key and secret.
The Bluecode API provides several endpoints for different functionalities. Below, you will find detailed information about these endpoints and their parameters.
Endpoint URL: https://api.bluecode.com/v1/payments/generate_qr
| Parameter | Type | Description | | ----------- | ------ | ---------------------------------- | | amount | number | The amount to be paid | | currency | string | The currency of the payment | | description | string | Description of the payment | | reference | string | Reference string for the payment | | callback | string | The callback URL for the payment |
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer API_KEY:API_SECRET" -d '{
"amount": 10.99,
"currency": "EUR",
"description": "Bluecode Payment",
"reference": "123456789",
"callback": "https://example.com/bluecode-callback"
}' "https://api.bluecode.com/v1/payments/generate_qr"
{
"qr_code": "https://example.com/qr_code.png"
}
Endpoint URL: https://api.bluecode.com/v1/payments/status/:payment_id
| Parameter | Type | Description | | ----------- | ------ | --------------------------------------------- | | payment_id | string | The ID of the payment to retrieve the status |
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer API_KEY:API_SECRET" "https://api.bluecode.com/v1/payments/status/537239784668"
{
"amount": 10.99,
"currency": "EUR",
"status": "completed"
}
Endpoint URL: https://api.bluecode.com/v1/refunds/create
| Parameter | Type | Description | | ------------- | ------ | ------------------------------------------ | | payment_id | string | The ID of the payment to be refunded | | refund_amount | number | The amount to be refunded | | refund_reason | string | Reason for the refund | | callback | string | The callback URL for refund notifications |
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer API_KEY:API_SECRET" -d '{
"payment_id": "537239784668",
"refund_amount": 5.99,
"refund_reason": "Product not received",
"callback": "https://example.com/refund-callback"
}' "https://api.bluecode.com/v1/refunds/create"
{
"refund_id": "883736488572"
}
For more detailed information about each API endpoint, including error handling and response codes, please refer to the Bluecode API Documentation.