Skip to main content

Get Started in Three Steps

Get up and running with Tender’s API and accept your first cryptocurrency payment.

Step 1: Get Your API Credentials

  1. Log in to your Tender Merchant Dashboard (sandbox) or merchant.tender.cash (live)
  2. Navigate to SettingsAPI Credentials
  3. Click Generate New Credentials
  4. Select Test Environment for development
  5. Save your Access ID and Access Secret securely
Use the test environment while integrating. It uses testnet cryptocurrencies with no real value.
Never hardcode credentials. Use environment variables:
.env
TENDER_ACCESS_ID=your_access_id_here
TENDER_ACCESS_SECRET=your_access_secret_here
TENDER_BASE_URL=https://sandbox-api.tender.cash

Step 2: Make Your First API Call

Choose your preferred language and make a request to create an agent:
import crypto from 'crypto';
import { v4 as uuidv4 } from 'uuid';

// Your credentials
const accessId = process.env.TENDER_ACCESS_ID;
const accessSecret = process.env.TENDER_ACCESS_SECRET;

// Generate signature
const requestId = uuidv4();
const timeStamp = new Date().toISOString();

const payload = {
  timeStamp,
  requestId,
  accessId
};

const signature = crypto
  .createHmac('sha256', accessSecret)
  .update(JSON.stringify(payload))
  .digest('base64');

// Make API request
const response = await fetch('https://sandbox-api.tender.cash/v1/api/agent/create', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-access-id': accessId,
    'x-request-id': requestId,
    'x-timestamp': timeStamp,
    'authorization': signature
  },
  body: JSON.stringify({
    type: 'online',
    name: 'Lagos Fashion Store',
    email: 'lagosfashion@store.com',
    phoneNumber: '0123246784824',
    location: 'Lagos',
    country: 'Nigeria',
    avatar: 'https:///imagesamp.lo.co',
    currency: 'NGN',
    password: '12345678'
  })
});

const data = await response.json();
console.log('Agent created:', data);
Expected Response:
{
  "status": "success",
  "message": "success",
  "data": {
    "id": "66f33b1fa9446a6b6b8f32cd",
    "name": "Lagos Fashion Store",
    "email": "jsmith@example.com",
    "phoneNumber": "0123246784824",
    "location": "Lagos",
    "country": "Nigeria",
    "active": true,
    "agentId": "vbibtucm9yn",
    "merchantId": "6538e8f9bdec6d1a21978a64",
    "currency": "NGN",
    "totalSales": "0.00 NGN",
    "defaultFiatCurrency": {
      "currency": "NGN",
      "useSystemRate": true,
      "rate": "0"
    },
    "createdAt": "2023-11-07T05:31:56Z"
  }
}

Step 3: Initiate Your First Payment

Now let’s create a cryptocurrency payment:
// Using the agentId from Step 2
const agentId = "abc123xyz";

const paymentResponse = await fetch('https://sandbox-api.tender.cash/v1/api/payment/initiate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-access-id': accessId,
    'x-request-id': uuidv4(),
    'x-timestamp': new Date().toISOString(),
    'authorization': generateSignature() // Use same signature method
  },
  body: JSON.stringify({
    agentId: agentId,
    amount: "10.00",
    chain: "ethereum",
    coin: "usdc"
  })
});

const payment = await paymentResponse.json();
console.log('Payment initiated:', payment);
Expected Response:
{
  "status": "success",
  "message": "success",
  "data": {
    "txId": "66aec7de809b7f45c42a49f9",
    "type": "receive",
    "chain": "ethereum",
    "amount": "10.00",
    "usdAmount": "10.00",
    "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "status": "pending",
    "agentId": "abc123xyz"
  }
}
The walletAddress is where your customer should send the cryptocurrency. Monitor the transaction status using webhooks or the validation endpoint.

Next Steps

Now that you’ve made your first requests, explore more features:

Testing Your Integration

Before going to production:
1

Test all payment flows

Test with different blockchains and currencies in the test environment
2

Set up webhooks

Configure and test webhook delivery for transaction events
3

Handle errors

Implement proper error handling for failed transactions
4

Security review

Ensure API credentials are stored securely and never exposed
5

Go live

Switch to production credentials and base URL

Need Help?

Contact Support