> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ozura.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Examples

# Code Examples

Complete integration examples in multiple programming languages.

## Available Languages

* [JavaScript/Node.js](javascript.md) - Full client library example
* [Python](python.md) - Complete Python client
* [cURL](curl.md) - Command-line examples

## Quick Reference

### Tokenize a Card

**cURL:**

```bash theme={null}
curl -X POST $YOUR_VAULT_URL/tokenize \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Pub-Key: YOUR_PUB_KEY" \
  -d '{
    "type": "card",
    "data": {
      "cardNumber": "4111111111111111",
      "expirationMonth": "12",
      "expirationYear": "2025",
      "cvv": "123"
    }
  }'
```

**JavaScript:**

```javascript theme={null}
const response = await fetch('$YOUR_VAULT_URL/tokenize', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_API_KEY',
    'X-Pub-Key': 'YOUR_PUB_KEY'
  },
  body: JSON.stringify({
    type: 'card',
    data: {
      cardNumber: '4111111111111111',
      expirationMonth: '12',
      expirationYear: '2025',
      cvv: '123'
    }
  })
});

const data = await response.json();
console.log(data.token);
```

**Python:**

```python theme={null}
import requests

response = requests.post(
    '$YOUR_VAULT_URL/tokenize',
    headers={
        'Content-Type': 'application/json',
        'X-API-Key': 'YOUR_API_KEY',
        'X-Pub-Key': 'YOUR_PUB_KEY'
    },
    json={
        'type': 'card',
        'data': {
            'cardNumber': '4111111111111111',
            'expirationMonth': '12',
            'expirationYear': '2025',
            'cvv': '123'
        }
    }
)

data = response.json()
print(data['token'])
```

### Process Payment via Proxy

**JavaScript:**

```javascript theme={null}
const response = await fetch('$YOUR_VAULT_URL/proxy/transaction', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    token: 'tok_abc123',
    cvc_session_id: 'session_xyz',
    proxy_url: 'https://api.stripe.com/v1/charges',
    request_data: {
      amount: 2000,
      currency: 'usd',
      source: {
        object: 'card',
        number: '${cardNumber}',
        exp_month: '${expirationMonth}',
        exp_year: '${expirationYear}',
        cvc: '${cvv}'
      }
    },
    http_headers: {
      'Authorization': 'Bearer sk_test_xxx'
    }
  })
});
```

## Environment Variables

Store your credentials securely:

```bash theme={null}
# .env
OZURA_API_KEY=key_your_api_key_here
OZURA_PUB_KEY=pk_your_pub_key_here
OZURA_BASE_URL=$YOUR_VAULT_URL
```

## Next Steps

* [JavaScript Examples](javascript.md) - Full Node.js client
* [Python Examples](python.md) - Full Python client
* [cURL Examples](curl.md) - Command-line reference
