📜  bluecode api (1)

📅  最后修改于: 2023-12-03 14:59:31.892000             🧑  作者: Mango

Bluecode API

bluecode-logo

Introduction

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.

Features
  • QR code generation for Bluecode payments
  • Payment status retrieval
  • Refund transactions
  • Cancellation of payments
  • Error handling and response codes
API Documentation

The Bluecode API provides several endpoints for different functionalities. Below, you will find detailed information about these endpoints and their parameters.

Generate QR Code Endpoint

Endpoint URL: https://api.bluecode.com/v1/payments/generate_qr

Request Parameters

| 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 |

Request Example (cURL)

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"

Response Example (JSON)

{
  "qr_code": "https://example.com/qr_code.png"
}
Payment Status Endpoint

Endpoint URL: https://api.bluecode.com/v1/payments/status/:payment_id

Request Parameters

| Parameter | Type | Description | | ----------- | ------ | --------------------------------------------- | | payment_id | string | The ID of the payment to retrieve the status |

Request Example (cURL)

curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer API_KEY:API_SECRET" "https://api.bluecode.com/v1/payments/status/537239784668"

Response Example (JSON)

{
  "amount": 10.99,
  "currency": "EUR",
  "status": "completed"
}
Refund Transaction Endpoint

Endpoint URL: https://api.bluecode.com/v1/refunds/create

Request Parameters

| 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 |

Request Example (cURL)

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"

Response Example (JSON)

{
  "refund_id": "883736488572"
}

For more detailed information about each API endpoint, including error handling and response codes, please refer to the Bluecode API Documentation.