Skip to main content
Claude Code is Anthropic’s official CLI. This guide shows how to configure it to accelerate your Owem API integration.

Prerequisites

  • Claude subscription (Pro, Max, or API)
  • Node.js installed

Installation

npm install -g @anthropic-ai/claude-code

Configuration

Create a CLAUDE.md file in your project root:
# Owem API Integration

## Project Context

This project integrates with the Owem API for PIX payments in Brazil.

- **Documentation**: https://docs.owem.com.br
- **LLMs.txt**: https://docs.owem.com.br/llms.txt
- **Base URL**: https://api.owem.com.br
- **Authentication**: Basic Auth (API_KEY:API_SECRET in Base64)

## Owem API Endpoints

### Authentication

- `GET /v4/i/ping` - Test connectivity

### PIX IN (Receiving)

- `POST /v4/i/pix/in/dynamic-qrcode` - Generate QR Code
- `GET /v4/i/pix/in/dynamic-qrcode/{txId}` - Query QR Code
- `POST /v4/i/pix/in/refund/{e2e}` - Refund
- `GET /v4/i/pix/in/refund/{e2e}` - Query refund

### PIX OUT (Sending)

- `POST /v4/i/bank-accounts/{id}/transfer/external` - Transfer
- `GET /v4/i/bank-accounts/{id}/transfer/external/{e2e}` - Query

### Ledger

- `GET /v4/i/ledger` - List movements
- `GET /v4/i/ledger/external-id/{id}` - By external ID
- `GET /v4/i/ledger/end-to-end/{e2e}` - By E2E
- `GET /v4/i/ledger/entry-id/{id}` - By Entry ID

### Account

- `GET /v4/i/bank-accounts/{id}/balance` - Check balance

## Required Patterns

1. Credentials in environment variables
2. Basic Auth with Base64
3. API error handling
4. Webhook validation by IP
5. Idempotency with externalId

## Webhook Events

- `pix_in:qrcode_paid` - QR paid
- `pix_out:succeeded` - Transfer OK
- `pix_out:failed` - Transfer failed
- `med:created` - New dispute

## DON'T

- Expose credentials in code
- Ignore API errors
- Trust webhooks without validating IP
- Use HTTP (always HTTPS)

Usage

Navigate to your project and run:
claude

Example Prompts

Create a TypeScript function to generate a dynamic PIX QR Code using the Owem API. It should receive amount, description and payerCpfCnpj as parameters.
Implement an Express handler for Owem webhooks. Validate the source IP and process pix_in:qrcode_paid and pix_out:succeeded events.
Create a script that queries the Owem Ledger to perform daily transaction reconciliation. It should filter by date and export to CSV.

Best Practices

Ask Claude to query https://docs.owem.com.br/llms.txt to get full API context.
Claude Code maintains project context. The more you use it, the better it understands your integration.