# Developers

Build the future of payments with BANKpay+ APIs.

## Overview

BANKpay+ provides powerful, developer-friendly APIs and tools to integrate instant payments into your applications. From simple payment links to complex agentic commerce, we have you covered.

## Quick Start

### 1. Get API Keys

```bash
# Sign up at bankpay.plus
# Navigate to Dashboard → Developers → API Keys
# Generate your keys
```

### 2. Install SDK

```bash
# JavaScript/TypeScript
npm install @bankpay/client

# Python
pip install bankpay

# PHP
composer require bankpay/client
```

### 3. Make Your First API Call

```javascript
const BankPay = require('@bankpay/client');
const client = new BankPay('your_api_key');

const payment = await client.payments.create({
  amount: 9999,
  currency: 'EUR',
  creditor_iban: 'AT611904300234573201',
  description: 'Test payment'
});

console.log(payment);
```

### 4. Test in Sandbox

```bash
# Use sandbox endpoint
const client = new BankPay('test_key', {
  sandbox: true
});
```

## Documentation

### Core APIs

| API | Description | Docs |
|-----|-------------|------|
| **Payments API** | Process instant payments | [/developers/api/payments](/developers/api/payments) |
| **Payment Links** | Generate shareable links | [/developers/api/payment-links](/developers/api/payment-links) |
| **Refunds API** | Process refunds | [/developers/api/refunds](/developers/api/refunds) |
| **Webhooks** | Real-time notifications | [/developers/webhooks](/developers/webhooks) |

### Advanced APIs

| API | Description | Docs |
|-----|-------------|------|
| **Agentic Commerce** | AI agent payments | [/developers/api/agentic](/developers/api/agentic) |
| **Invoice Agent** | AI invoice processing | [/developers/api/invoice-agent](/developers/api/invoice-agent) |
| **SEPA.id** | Identity verification | [/developers/api/sepa-id](/developers/api/sepa-id) |
| **Tap!** | NFC payments | [/developers/api/tap](/developers/api/tap) |

## SDKs & Libraries

### Official SDKs

- **JavaScript/TypeScript**: [@bankpay/client](https://npmjs.com/package/@bankpay/client)
- **Python**: [bankpay](https://pypi.org/project/bankpay)
- **PHP**: [bankpay/client](https://packagist.org/packages/bankpay/client)
- **Go**: Coming soon
- **Java**: Coming soon
- **Ruby**: Coming soon

### Community Libraries

- **React Components**: Community-maintained
- **Vue Components**: Built-in to BANKpay+
- **Django Integration**: Community-maintained
- **Laravel Package**: Official (coming soon)

## Integration Guides

### E-commerce

- **WooCommerce**: [Guide](/developers/integrations/woocommerce)
- **Shopify**: Coming soon
- **Magento**: Coming soon
- **PrestaShop**: Coming soon

### Platforms

- **n8n**: [Hosting Guide](/n8n-hosting)
- **Zapier**: Coming soon
- **Make (Integromat)**: Coming soon

### Frameworks

- **Next.js**: [Guide](/developers/guides/nextjs)
- **Nuxt**: [Guide](/developers/guides/nuxt)
- **Django**: [Guide](/developers/guides/django)
- **Laravel**: [Guide](/developers/guides/laravel)

## API Reference

### Authentication

```bash
# All API requests require Bearer token
curl -X POST https://api.bankpay.plus/payments \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

### Rate Limits

| Plan | Requests/Minute | Requests/Day |
|------|-----------------|--------------|
| **Sandbox** | 100 | 10,000 |
| **Starter** | 100 | 100,000 |
| **Professional** | 1,000 | 1,000,000 |
| **Enterprise** | Custom | Custom |

### Error Handling

```json
{
  "error": {
    "type": "payment_failed",
    "code": "insufficient_funds",
    "message": "The payer has insufficient funds",
    "param": "amount",
    "request_id": "req_123456"
  }
}
```

### Response Codes

| Code | Description |
|------|-------------|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 402 | Payment Required |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Server Error |

## Webhooks

### Setup

1. **Configure Endpoint**: Dashboard → Developers → Webhooks
2. **Select Events**: Choose which events to receive
3. **Verify Signature**: Validate webhook authenticity
4. **Handle Events**: Process webhook payload

### Available Events

- `payment.initiated`
- `payment.completed`
- `payment.failed`
- `payment.refunded`
- `payment_link.created`
- `payment_link.viewed`
- `refund.completed`
- `refund.failed`

### Webhook Payload

```json
{
  "id": "evt_123456",
  "type": "payment.completed",
  "created": 1709136000,
  "data": {
    "object": {
      "id": "pay_789",
      "amount": 9999,
      "currency": "EUR",
      "status": "completed"
    }
  }
}
```

### Verify Signature

```javascript
const crypto = require('crypto');

function verifySignature(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}
```

## Code Examples

### Accept a Payment

```javascript
// Node.js example
const BankPay = require('@bankpay/client');
const client = new BankPay(process.env.BANKPAY_KEY);

async function acceptPayment(amount, currency, description) {
  const payment = await client.payments.create({
    amount,
    currency,
    description
  });
  
  // Redirect customer to payment URL
  res.redirect(payment.url);
}
```

### Create Payment Link

```python
# Python example
from bankpay import Client

client = Client('your_api_key')

link = client.payment_links.create(
    amount=9999,
    currency='EUR',
    description='Product Purchase',
    success_url='https://yoursite.com/success',
    cancel_url='https://yoursite.com/cancel'
)

print(f"Payment link: {link.url}")
```

### Process Refund

```php
// PHP example
use BankPay\Client;

$client = new Client('your_api_key');

$refund = $client->refunds()->create([
    'payment_id' => 'pay_123',
    'amount' => 5000,
    'reason' => 'Customer request'
]);

echo "Refund ID: " . $refund->id;
```

### Handle Webhook

```javascript
// Express.js webhook handler
app.post('/webhook', express.raw({type: 'application/json'}), (req, res) => {
  const signature = req.headers['bankpay-signature'];
  const payload = req.body;
  
  if (!verifySignature(payload, signature, process.env.WEBHOOK_SECRET)) {
    return res.status(400).send('Invalid signature');
  }
  
  const event = JSON.parse(payload);
  
  switch (event.type) {
    case 'payment.completed':
      handlePaymentCompleted(event.data.object);
      break;
    case 'payment.failed':
      handlePaymentFailed(event.data.object);
      break;
  }
  
  res.send({received: true});
});
```

## Testing

### Sandbox Environment

```javascript
const client = new BankPay('test_key', {
  sandbox: true,
  apiUrl: 'https://sandbox-api.bankpay.plus'
});
```

### Test Cards

| Scenario | Test Data |
|----------|-----------|
| **Success** | Any valid test credentials |
| **Insufficient Funds** | Amount > €10,000 |
| **Authentication Failed** | Wrong password |
| **Bank Unavailable** | Bank code: TEST_DOWN |

### Test Webhooks

```bash
# Use webhook tester
curl -X POST https://webhook.bankpay.plus/test \
  -H "Content-Type: application/json" \
  -d '{"type": "payment.completed", "test": true}'
```

## Security Best Practices

### API Key Management

- **Never commit keys** to version control
- **Use environment variables**
- **Rotate keys regularly**
- **Use different keys** for test/production

### Webhook Security

- **Always verify signatures**
- **Use HTTPS endpoints**
- **Implement idempotency**
- **Log all events**

### Data Protection

- **Encrypt sensitive data**
- **Minimize data storage**
- **Follow GDPR guidelines**
- **Implement access controls**

## Troubleshooting

### Common Issues

**"Invalid API Key"**
- Check key is correct
- Ensure using correct environment (sandbox vs production)
- Verify key hasn't expired

**"Rate Limit Exceeded"**
- Implement exponential backoff
- Cache responses where possible
- Contact support for limit increase

**"Webhook Not Received"**
- Check endpoint is publicly accessible
- Verify SSL certificate
- Check firewall settings
- Review webhook logs in dashboard

### Getting Help

- **Documentation**: Comprehensive guides
- **API Status**: status.bankpay.plus
- **Support**: developers@bankpay.plus
- **Community**: Discord server

## Resources

### Documentation

- [Getting Started](/developers/docs)
- [API Reference](/developers/api)
- [SDK Documentation](/developers/sdks)
- [Integration Guides](/developers/integrations)
- [Best Practices](/developers/best-practices)

### Tools

- **Sandbox**: Test environment
- **API Explorer**: Try endpoints in browser
- **Webhook Tester**: Debug notifications
- **Status Page**: Real-time system status

### Community

- **GitHub**: Open-source SDKs
- **Discord**: Developer community
- **Stack Overflow**: Ask questions
- **Blog**: Updates and tutorials

## Certification

Become a BANKpay+ Certified Developer:

1. **Complete Training**: Online courses
2. **Pass Exam**: Demonstrate knowledge
3. **Build Project**: Real-world integration
4. **Get Listed**: Featured in developer directory

[Start Certification](/developers/certification)

## Partner Program

Join our partner program:

- **Revenue Share**: Earn on referrals
- **Co-Marketing**: Joint promotions
- **Technical Support**: Dedicated assistance
- **Early Access**: New features first

[Become a Partner](/partners)

---

**Last updated**: February 28, 2026

**Get API Keys**: [Dashboard](/dashboard/developers)

**Questions?** Contact us at developers@bankpay.plus
