Skip to content

ChicksX Payments API (1.0.0)

REST API that provides an interface to ChicksX cryptocurrency exchange ecosystem. This API enables merchants to offer their users cryptocurrency purchases, sales, and swaps through a simple integration.

🧪 Interactive Demo

We provide an interactive demo tool to test the complete SDK integration:

This demo allows you to:

  • Test SDK configuration with different operation types
  • Generate public access tokens
  • Simulate webhook events
  • View code examples in real-time

Getting Started

Prerequisites

Before you can integrate with the ChicksX Payments API, you need to obtain your merchant credentials:

  • merchant-api-key: Your unique API key for authentication
  • merchant-client-id: Your merchant client identifier

Important: If you don't have these credentials yet, please contact our support team at support@chicksx.com

Security Notice

🔒 All endpoints requiring merchant-api-key and merchant-client-id headers MUST be called from your backend server only. These credentials should never be exposed in client-side applications (web browsers, mobile apps, etc.) as they provide full access to your merchant account.

SDK Integration Flow

To integrate the ChicksX SDK into your application, follow these steps:

Step 1: Obtain Merchant Credentials

Contact support@chicksx.com to receive:

  • merchant-api-key
  • merchant-client-id

Step 2: Create a Public Access Token (Server-Side)

From your backend server, make a request to create a public access token:

POST https://develop-api.chicksx.com/v1/public_token/create
Headers:
  merchant-api-key: your-api-key
  merchant-client-id: your-client-id

This returns a public access token that can be safely used in your client-side application.

Step 3: Embed the SDK Script (Client-Side)

In your frontend application, add the ChicksX SDK script tag with the required parameters:

<script src="https://develop-api.chicksx.com/v1/sdk/chicksx.js?merchantId=your-merchant-id&env=dev&accessToken=your-public-token&baseCurrency=cad&targetCurrency=usdt&baseAmount=100&paymentMethod=interac"></script>

Then configure and initialize the SDK:

<script>
  window.chicksX.configure({
    merchantId: 'your-merchant-id',
    env: 'dev',
    accessToken: 'your-public-token',
    operationType: 'buy',
    baseCurrency: 'cad',
    targetCurrency: 'usdt',
    baseAmount: 100,
    paymentMethod: 'interac',
    walletAddress: '0xYourWalletAddressOptional'
  });
  window.chicksX.init();
</script>

Note: window.chicksX.init() opens the payment popup/modal. You typically want to call it in response to a user action (e.g., a button click) to avoid unexpected popups:

<button id="payButton">Pay with ChicksX</button>
<script>
  document.getElementById('payButton').addEventListener('click', function () {
    window.chicksX.init();
  });
</script>

Step 4: SDK Configuration Parameters

Required Parameters:

  • merchantId - Your merchant identifier
  • env - Environment (dev, staging, or prod)
  • accessToken - The public token obtained from Step 2

Optional Parameters:

  • operationType - Type of operation: buy (default), sell, swap-fiat, or swap-crypto
  • baseCurrency - Source currency code (default: based on merchant config)
  • targetCurrency - Target cryptocurrency code (default: based on merchant config)
  • baseAmount - Amount in base currency
  • targetAmount - Amount in target currency
  • paymentMethod - Payment method identifier (e.g., interac, cash-in-mail, cash-in-person, bill-payment, balance)
  • walletAddress - Cryptocurrency wallet address

Operation Types and URL Paths

The operationType parameter determines the URL path structure for the payment flow:

Operation TypeDescription
buyBuy cryptocurrency with fiat
sellSell cryptocurrency for fiat
swap-fiatSwap between fiat currencies
swap-cryptoSwap between cryptocurrencies

Payment Methods by Operation:

  • Buy: interac, cash-in-mail, cash-in-person, bill-payment, balance
  • Sell: interac, cash-in-mail, cash-in-person
  • Swap Fiat: cash-in-mail, cash-in-person
  • Swap Crypto: No payment method required (crypto-to-crypto)

Wallet Management

The API provides comprehensive wallet management capabilities for storing and managing user cryptocurrency wallets associated with your merchant account.

Webhooks

ChicksX uses webhooks to notify your application when events occur in your account. Webhooks are particularly useful for asynchronous events like order status changes.

Setting Up Webhooks

To receive webhook notifications:

  1. Contact Support: Email support@chicksx.com to register your webhook endpoint URL
  2. Provide Your URL: Supply a publicly accessible HTTPS endpoint that can receive POST requests
  3. Environment-Specific: You can configure different webhook URLs for development, staging, and production environments

Webhook Events

ChicksX sends the following webhook event types:

OrderCreated

Triggered when a new order is created in the system.

{
  "eventType": "OrderCreated",
  "details": {
    "orderId": 1092114,
    "status": "pending",
    "paymentMethod": "Interac E-Transfer",
    "fulfilled": false,
    "totalPrice": 100.00,
    "totalPriceCurrency": "CAD",
    "exchangeDetails": {
      "baseCurrency": "CAD",
      "amountReceived": 100.00,
      "targetCurrency": "BTC",
      "amountToSend": 0.00112180,
      "operationType": "B"
    }
  }
}

OrderFulfillment

Triggered when an order the order fulfills.

{
  "eventType": "OrderFulfillment",
  "details": {
    "orderId": 1092114,
    "status": "completed",
    "paymentMethod": "Interac E-Transfer",
    "fulfilled": true,
    "totalPrice": 100.00,
    "totalPriceCurrency": "CAD",
    "exchangeDetails": {
      "baseCurrency": "CAD",
      "amountReceived": 100.00,
      "targetCurrency": "BTC",
      "amountToSend": 0.00112180,
      "operationType": "B"
    }
  }
}

Webhook Payload Structure

FieldTypeDescription
eventTypestringEvent type: OrderCreated or OrderFulfillment
details.orderIdintegerUnique order identifier
details.statusstringCurrent order status
details.paymentMethodstringPayment method used
details.fulfilledbooleanWhether the order has been fulfilled
details.totalPricenumberTotal price of the order
details.totalPriceCurrencystringCurrency of the total price
details.exchangeDetails.baseCurrencystringSource currency
details.exchangeDetails.amountReceivednumberAmount received in base currency
details.exchangeDetails.targetCurrencystringTarget currency
details.exchangeDetails.amountToSendnumberAmount to send in target currency
details.exchangeDetails.operationTypestringOperation type: B (Buy), S (Sell), SF (Swap Fiat), SC (Swap Crypto)

Handling Webhooks

Your webhook endpoint should:

  1. Return 200 OK: Respond with HTTP 200 status to acknowledge receipt
  2. Process Asynchronously: Handle the webhook data asynchronously to avoid timeouts
  3. Be Idempotent: Handle duplicate webhook deliveries gracefully (use orderId as unique identifier)
  4. Validate Data: Verify the webhook data matches expected formats

Example Webhook Handler (Node.js)

app.post('/webhook/chicksx', (req, res) => {
  const { eventType, details } = req.body;
  
  console.log(`Received ${eventType} for order ${details.orderId}`);
  
  switch (eventType) {
    case 'OrderCreated':
      // Handle new order
      handleNewOrder(details);
      break;
    case 'OrderFulfillment':
      // Handle order status update
      handleOrderUpdate(details);
      break;
  }
  
  // Always respond with 200 to acknowledge receipt
  res.status(200).send('OK');
});

Security Considerations

  • Use HTTPS endpoints only
  • Validate incoming webhook data
  • Consider implementing signature verification (contact support for details)
  • Store webhook data for audit purposes
Download OpenAPI description
Overview
ChicksX Support
License
Languages
Servers
Mock server
https://chicksx-payments-api.redocly.app/_mock/apis/openapi/
Development server
https://develop-api.chicksx.com/v1/
Staging server
https://staging-api.chicksx.com/v1/
Production server
https://api.chicksx.com/v1/

SDK Authentication

Endpoints for SDK authentication and token management

Operations
Operations

Wallet Management

Cryptocurrency wallet management operations

Operations

Request

Creates a new cryptocurrency wallet entry for a user. This endpoint must be called from your secure backend server.

Security: Requires merchant authentication headers.

Security
MerchantAuth
Headers
merchant-client-idstringrequired

Your merchant client identifier (must be kept secure)

Bodyapplication/jsonrequired
walletAddressstringrequired

Cryptocurrency wallet address

Example: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
currencyCodestringrequired

Currency code (e.g., BTC, ETH, USDT)

Example: "USDT"
networkCodestring

Blockchain network code (e.g., ERC20, TRC20, BEP20)

Example: "ERC20"
curl -i -X POST \
  https://chicksx-payments-api.redocly.app/_mock/apis/openapi/wallets \
  -H 'Content-Type: application/json' \
  -H 'merchant-api-key: YOUR_API_KEY_HERE' \
  -H 'merchant-client-id: string' \
  -d '{
    "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "currencyCode": "ETH",
    "networkCode": "ERC20"
  }'

Responses

Wallet created successfully

Bodyapplication/json
codestring

Result code indicating the operation status

Example: "OK"
dataobject

Response data payload

messagestring

Human-readable response message

Example: "Operation completed successfully"
Response
application/json
{ "code": "OK", "message": "Wallet created successfully", "data": { "id": 1001, "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", "currencyCode": "USDT", "networkCode": "ERC20" } }

Request

Retrieves all cryptocurrency wallets associated with your merchant account. This endpoint must be called from your secure backend server.

Security: Requires merchant authentication headers.

Security
MerchantAuth
Headers
merchant-client-idstringrequired

Your merchant client identifier (must be kept secure)

curl -i -X GET \
  https://chicksx-payments-api.redocly.app/_mock/apis/openapi/wallets \
  -H 'merchant-api-key: YOUR_API_KEY_HERE' \
  -H 'merchant-client-id: string'

Responses

Wallets retrieved successfully

Bodyapplication/json
codestring

Result code indicating the operation status

Example: "OK"
dataArray of objects

Response data payload

messagestring

Human-readable response message

Example: "Operation completed successfully"
Response
application/json
{ "code": "OK", "data": [ {}, {} ] }

Request

Searches for a wallet by currency code and optionally by network code. This endpoint must be called from your secure backend server.

If multiple networks exist for a currency and no network code is provided, the response will include available networks.

Security: Requires merchant authentication headers.

Security
MerchantAuth
Query
currencyCodestringrequired

Currency code to search for

Example: currencyCode=USDT
networkCodestring

Network code (required if currency supports multiple networks)

Example: networkCode=ERC20
Headers
merchant-client-idstringrequired

Your merchant client identifier (must be kept secure)

curl -i -X GET \
  'https://chicksx-payments-api.redocly.app/_mock/apis/openapi/wallets/search?currencyCode=USDT&networkCode=ERC20' \
  -H 'merchant-api-key: YOUR_API_KEY_HERE' \
  -H 'merchant-client-id: string'

Responses

Wallet search completed

Bodyapplication/json
codestring

Result code indicating the operation status

Example: "OK"
dataobject

Response data payload

messagestring

Human-readable response message

Example: "Operation completed successfully"
Response
application/json
{ "code": "OK", "data": { "success": true, "message": "Wallet found", "wallet": {}, "availableNetworks": [], "requiresNetworkCode": true } }

Request

Retrieves a specific wallet by its unique identifier. This endpoint must be called from your secure backend server.

Security: Requires merchant authentication headers.

Security
MerchantAuth
Path
idintegerrequired

Wallet ID

Example: 1001
Headers
merchant-client-idstringrequired

Your merchant client identifier (must be kept secure)

curl -i -X GET \
  https://chicksx-payments-api.redocly.app/_mock/apis/openapi/wallets/1001 \
  -H 'merchant-api-key: YOUR_API_KEY_HERE' \
  -H 'merchant-client-id: string'

Responses

Wallet retrieved successfully

Bodyapplication/json
codestring

Result code indicating the operation status

Example: "OK"
dataobject

Response data payload

messagestring

Human-readable response message

Example: "Operation completed successfully"
Response
application/json
{ "code": "OK", "data": { "id": 1001, "user": {}, "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", "currencyCode": "USDT", "networkCode": "ERC20" } }

Request

Updates an existing wallet's information. This endpoint must be called from your secure backend server.

Security: Requires merchant authentication headers.

Security
MerchantAuth
Path
idintegerrequired

Wallet ID

Example: 1001
Headers
merchant-client-idstringrequired

Your merchant client identifier (must be kept secure)

Bodyapplication/jsonrequired
walletAddressstringrequired

Cryptocurrency wallet address

Example: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
currencyCodestringrequired

Currency code (e.g., BTC, ETH, USDT)

Example: "USDT"
networkCodestring

Blockchain network code (e.g., ERC20, TRC20, BEP20)

Example: "ERC20"
curl -i -X PATCH \
  https://chicksx-payments-api.redocly.app/_mock/apis/openapi/wallets/1001 \
  -H 'Content-Type: application/json' \
  -H 'merchant-api-key: YOUR_API_KEY_HERE' \
  -H 'merchant-client-id: string' \
  -d '{
    "walletAddress": "0x8ba1f109551bd432803012645ac136ddd64dba72",
    "currencyCode": "USDT",
    "networkCode": "ERC20"
  }'

Responses

Wallet updated successfully

Bodyapplication/json
codestring

Result code indicating the operation status

Example: "OK"
dataobject

Response data payload

messagestring

Human-readable response message

Example: "Operation completed successfully"
Response
application/json
{ "message": "Wallet updated successfully", "data": { "id": 1001, "walletAddress": "0x8ba1f109551bd432803012645ac136ddd64dba72", "currencyCode": "USDT", "networkCode": "ERC20" } }

Request

Deletes a wallet by its ID. This endpoint must be called from your secure backend server.

Security: Requires merchant authentication headers.

Security
MerchantAuth
Path
idintegerrequired

Wallet ID

Example: 1001
Headers
merchant-client-idstringrequired

Your merchant client identifier (must be kept secure)

curl -i -X DELETE \
  https://chicksx-payments-api.redocly.app/_mock/apis/openapi/wallets/1001 \
  -H 'merchant-api-key: YOUR_API_KEY_HERE' \
  -H 'merchant-client-id: string'

Responses

Wallet deleted successfully

Bodyapplication/json
codestring

Result code indicating the operation status

Example: "OK"
datanull

Response data payload

messagestring

Human-readable response message

Example: "Operation completed successfully"
Response
application/json
{ "data": null, "message": "Wallet deleted successfully" }

Webhooks

Webhook event notifications for order status changes