api-charge-pix
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseKobana Charge API Skill
Kobana Charge API Skill
Manage Pix charges, accounts, and payments via Kobana API.
通过Kobana API管理Pix收费、账户及支付。
Base URLs
基础URL
Production: https://api.kobana.com.br
Sandbox: https://api-sandbox.kobana.com.brProduction: https://api.kobana.com.br
Sandbox: https://api-sandbox.kobana.com.brAuthentication
身份验证
Authorization: Bearer {your_api_token}Authorization: Bearer {your_api_token}API Endpoints Overview
API 端点概览
Pix Accounts
Pix账户
| Method | Endpoint | Description |
|---|---|---|
| GET | | List all Pix accounts |
| POST | | Create a new Pix account |
| GET | | Get a specific Pix account |
| PUT | | Update a Pix account |
| DELETE | | Delete a Pix account |
| 方法 | 端点 | 描述 |
|---|---|---|
| GET | | 列出所有Pix账户 |
| POST | | 创建新的Pix账户 |
| GET | | 获取指定Pix账户 |
| PUT | | 更新Pix账户 |
| DELETE | | 删除Pix账户 |
Pix Charges
Pix收费单
| Method | Endpoint | Description |
|---|---|---|
| GET | | List all Pix charges |
| POST | | Create a new Pix charge |
| GET | | Get a specific Pix charge |
| PUT | | Update a Pix charge |
| DELETE | | Delete a Pix charge |
| POST | | Cancel a Pix charge |
| 方法 | 端点 | 描述 |
|---|---|---|
| GET | | 列出所有Pix收费单 |
| POST | | 创建新的Pix收费单 |
| GET | | 获取指定Pix收费单 |
| PUT | | 更新Pix收费单 |
| DELETE | | 删除Pix收费单 |
| POST | | 取消Pix收费单 |
Pix Commands
Pix命令
| Method | Endpoint | Description |
|---|---|---|
| GET | | List commands for a Pix charge |
| GET | | Get a specific command |
| 方法 | 端点 | 描述 |
|---|---|---|
| GET | | 列出Pix收费单的所有命令 |
| GET | | 获取指定命令 |
Charge Payments
收费支付
| Method | Endpoint | Description |
|---|---|---|
| GET | | List all payments |
| POST | | Create a new payment |
| GET | | Get a specific payment |
| DELETE | | Delete a payment |
| 方法 | 端点 | 描述 |
|---|---|---|
| GET | | 列出所有支付记录 |
| POST | | 创建新的支付记录 |
| GET | | 获取指定支付记录 |
| DELETE | | 删除支付记录 |
Creating a Pix Charge
创建Pix收费单
Minimum Required Parameters
必要参数最小值
json
POST /v2/charge/pix
{
"amount": 100.50,
"pix_account_uid": "018df180-7208-727b-...",
"expire_at": "2026-12-02T10:03:56-03:00"
}json
POST /v2/charge/pix
{
"amount": 100.50,
"pix_account_uid": "018df180-7208-727b-...",
"expire_at": "2026-12-02T10:03:56-03:00"
}Complete Example (Billing Pix)
完整示例(账单式Pix)
json
POST /v2/charge/pix
{
"amount": 500.00,
"pix_account_uid": "018df180-7208-727b-...",
"expire_at": "2026-02-10T23:59:59-03:00",
"registration_kind": "billing",
"payer": {
"document_number": "12.345.678/0001-90",
"name": "Company LTDA",
"email": "finance@company.com"
},
"fine_type": "percentage",
"fine_percentage": 2.0,
"interest_type": "monthly_percentage_calendar",
"interest_percentage": 1.0,
"discount_type": "advance_percentage_calendar",
"discount_first_percentage": 5.0,
"discount_first_days": 5,
"revoke_days": 30,
"external_id": "invoice_2026_001",
"tags": ["monthly", "subscription"],
"message": "Invoice January/2026"
}json
POST /v2/charge/pix
{
"amount": 500.00,
"pix_account_uid": "018df180-7208-727b-...",
"expire_at": "2026-02-10T23:59:59-03:00",
"registration_kind": "billing",
"payer": {
"document_number": "12.345.678/0001-90",
"name": "Company LTDA",
"email": "finance@company.com"
},
"fine_type": "percentage",
"fine_percentage": 2.0,
"interest_type": "monthly_percentage_calendar",
"interest_percentage": 1.0,
"discount_type": "advance_percentage_calendar",
"discount_first_percentage": 5.0,
"discount_first_days": 5,
"revoke_days": 30,
"external_id": "invoice_2026_001",
"tags": ["monthly", "subscription"],
"message": "Invoice January/2026"
}Pix Types
Pix类型
Instant Pix (registration_kind: "instant"
)
registration_kind: "instant"即时Pix(registration_kind: "instant"
)
registration_kind: "instant"- Short expiration (minutes to hours)
- No interest, fines, or discounts
- Use for: e-commerce, delivery, point-of-sale
- 有效期短(数分钟至数小时)
- 无利息、罚款或折扣
- 适用场景:电商、配送、线下收银
Billing Pix (registration_kind: "billing"
)
registration_kind: "billing"账单式Pix(registration_kind: "billing"
)
registration_kind: "billing"- Formal due date
- Supports interest, fines, discounts
- Stays active after due date (if set)
revoke_days - Use for: monthly invoices, subscriptions
- 正式到期日
- 支持利息、罚款、折扣
- 若设置,到期后仍保持有效
revoke_days - 适用场景:月度账单、订阅服务
Important: Asynchronous Behavior
重要提示:异步行为
The QR Code is NOT returned in the initial response. Options:
- Poll the charge - GET until
/v2/charge/pix/{uid}isregistration_statusconfirmed - Use webhooks - Configure webhook for event
pix.register.confirmed
二维码不会在初始响应中返回。可选方案:
- 轮询收费单 - 调用GET ,直到
/v2/charge/pix/{uid}变为registration_statusconfirmed - 使用Webhooks - 配置事件的Webhook
pix.register.confirmed
Listing and Filtering
列出与筛选
List Pix Charges with Filters
带筛选条件列出Pix收费单
GET /v2/charge/pix?status=opened&created_from=2026-01-01&per_page=50| Parameter | Description |
|---|---|
| Filter by status (opened, paid, overdue, canceled) |
| Filter by registration status |
| Filter by Pix account |
| Filter by creation date |
| Filter by expiration date |
| Filter by payment date |
| Filter by TXID |
| Filter by external ID |
| Filter by tags |
| Pagination |
GET /v2/charge/pix?status=opened&created_from=2026-01-01&per_page=50| 参数 | 描述 |
|---|---|
| 按状态筛选(opened、paid、overdue、canceled) |
| 按注册状态筛选 |
| 按Pix账户筛选 |
| 按创建日期筛选 |
| 按到期日期筛选 |
| 按支付日期筛选 |
| 按TXID筛选 |
| 按外部ID筛选 |
| 按标签筛选 |
| 分页参数 |
List Pix Accounts
列出Pix账户
GET /v2/charge/pix_accountsGET /v2/charge/pix_accountsUpdating and Canceling
更新与取消
Update a Pix Charge
更新Pix收费单
json
PUT /v2/charge/pix/{uid}/update
{
"amount": 550.00,
"expire_at": "2026-02-15T23:59:59-03:00"
}json
PUT /v2/charge/pix/{uid}/update
{
"amount": 550.00,
"expire_at": "2026-02-15T23:59:59-03:00"
}Cancel a Pix Charge
取消Pix收费单
POST /v2/charge/pix/{uid}/cancelPOST /v2/charge/pix/{uid}/cancelStatus Reference
状态参考
Charge Status
收费单状态
- - Open (initial)
opened - - Paid
paid - - Overdue
overdue - - Canceled
canceled - - Registration failed
generation_failed
- - 已创建(初始状态)
opened - - 已支付
paid - - 已逾期
overdue - - 已取消
canceled - - 注册失败
generation_failed
Registration Status
注册状态
- - Waiting
pending - - Ready (has QR Code)
confirmed - /
rejected- Errorfailed
- - 待处理
pending - - 已就绪(包含二维码)
confirmed - /
rejected- 错误failed
Common Parameters
通用参数
Fine (after due date)
逾期罚款
json
{
"fine_type": "percentage", // or "amount"
"fine_percentage": 2.0
}json
{
"fine_type": "percentage", // 或 "amount"
"fine_percentage": 2.0
}Interest
利息
json
{
"interest_type": "monthly_percentage_calendar",
"interest_percentage": 1.0
}Interest types: , , , , , , ,
daily_amount_calendardaily_percentage_calendarmonthly_percentage_calendaryearly_percentage_calendardaily_amount_businessdaily_percentage_businessmonthly_percentage_businessyearly_percentage_businessjson
{
"interest_type": "monthly_percentage_calendar",
"interest_percentage": 1.0
}利息类型:, , , , , , ,
daily_amount_calendardaily_percentage_calendarmonthly_percentage_calendaryearly_percentage_calendardaily_amount_businessdaily_percentage_businessmonthly_percentage_businessyearly_percentage_businessDiscount
折扣
json
{
"discount_type": "advance_percentage_calendar",
"discount_first_percentage": 5.0,
"discount_first_days": 5
}json
{
"discount_type": "advance_percentage_calendar",
"discount_first_percentage": 5.0,
"discount_first_days": 5
}Days Active After Due Date
到期后有效天数
json
{
"revoke_days": 30
}Required when using interest or fines.
json
{
"revoke_days": 30
}必填,当使用利息或罚款时。
Best Practices
最佳实践
- Poll or use webhooks - QR Code comes asynchronously
- Use external_id - Track charges in your system
- Set revoke_days - Required for interest/fines
- Validate CPF/CNPJ - Before sending to API
- Use X-Idempotency-Key header - Prevent duplicates
- Test in sandbox - Before production
- 轮询或使用Webhooks - 二维码为异步返回
- 使用external_id - 在您的系统中跟踪收费单
- 设置revoke_days - 使用利息/罚款时必填
- 验证CPF/CNPJ - 发送至API前验证
- 使用X-Idempotency-Key请求头 - 防止重复请求
- 在沙箱环境测试 - 上线前先在沙箱测试
Reference Documentation
参考文档
See references/REFERENCE.md for complete API documentation including all parameters, response formats, and error codes.
完整API文档(包含所有参数、响应格式及错误码)请查看references/REFERENCE.md。