This guide will help you start accepting payments with our API quickly and securely. Follow these steps to begin processing transactions.

Step 1: Create Your Account

1

Sign Up

Create your Juicyway business account:
2

Get API Keys

After signing up:
  1. Navigate to Settings → API Keys.
  2. Fetch test and live API keys.
  3. Store keys securely - never expose them in client-side code.
3

Set Up Webhooks

Configure webhooks to receive real-time payment updates:
  1. Go to Settings → Webhooks
  2. Add your webhook URL

Step 2: Make Your First API Call

Test your integration with this simple API call:
curl -X POST "https://api-sandbox.spendjuice.com/payment-sessions" \
-H "Authorization:  YOUR_TEST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "customer": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "phone_number": "+2348118873422",
    "billing_address": {
      "line1": "123 Test Lane",
      "city": "Test City",
      "state": "Test State",
      "country": "NG",
      "zip_code": "12345"
    },
    "ip_address": "127.0.0.1"
  },
  "description": "Test Payment",
  "currency": "NGN",
  "amount": 100000,
  "payment_method": {
    "type": "card"
  },
  "reference": "test-payment-123"
}'

Step 3: Test Card Payments

Use these test cards to simulate different payment scenarios:

Step 4: Handle Webhooks

Set up webhook handling to receive real-time payment updates. Here’s a basic example:
app.post('/webhooks', (req, res) => {
  const payload = req.body;
  const checksum = payload.checksum;
  const businessId = process.env.BUSINESS_ID;
  
  // Validate webhook signature
  if (!validateSignature(payload, checksum, businessId)) {
    return res.status(401).send('Invalid signature');
  }
  
  // Handle different event types
  switch(payload.event) {
    case 'payment.session.succeeded':
      // Handle successful payment
      break;
    case 'payment.session.failed':
      // Handle failed payment
      break;
  }
  
  res.status(200).send('Webhook received');
});

Next Steps

  1. Review our API Authentication guide for secure API access
  2. Set up comprehensive Webhook Handling
  3. Learn about Error Handling
  4. Explore supported Payment Methods

Need Help?

For additional assistance: