Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 137 additions & 32 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,156 @@
}
},
"navigation": {
"tabs": [
"languages": [
{
"tab": "Documentação",
"groups": [
"language": "pt-BR",
"tabs": [
{
"group": "Introdução",
"pages": [
"pages/introduction",
"pages/devmode",
"pages/authentication",
"pages/webhooks",
"pages/production",
"pages/sdks"
"tab": "Documentação",
"groups": [
{
"group": "Introdução",
"pages": [
"pt/introduction",
"pt/devmode",
"pt/authentication",
"pt/webhooks",
"pt/production",
"pt/sdks"
]
},
{
"group": "Cliente",
"pages": ["pt/client/reference", "pt/client/create", "pt/client/list"]
},
{
"group": "Cobrança",
"pages": ["pt/payment/reference", "pt/payment/create", "pt/payment/list"]
},
{
"group": "Pix QRCode",
"pages": [
"pt/pix-qrcode/reference",
"pt/pix-qrcode/create",
"pt/pix-qrcode/simulate-payment",
"pt/pix-qrcode/check"
]
},
{
"group": "Cupom",
"pages": ["pt/coupon/reference", "pt/coupon/create", "pt/coupon/list"]
},
{
"group": "Saque",
"pages": ["pt/withdraw/reference", "pt/withdraw/create", "pt/withdraw/list"]
}
]
},
{
"group": "Cliente",
"pages": ["pages/client/reference", "pages/client/create", "pages/client/list"]
},
{
"group": "Cobrança",
"pages": ["pages/payment/reference", "pages/payment/create", "pages/payment/list"]
},
"tab": "Referência da API",
"openapi": "openapi-pt.yaml"
}
]
},
{
"language": "es",
"tabs": [
{
"group": "Pix QRCode",
"pages": [
"pages/pix-qrcode/reference",
"pages/pix-qrcode/create",
"pages/pix-qrcode/simulate-payment",
"pages/pix-qrcode/check"
"tab": "Documentación",
"groups": [
{
"group": "Introducción",
"pages": [
"es/introduction",
"es/devmode",
"es/authentication",
"es/webhooks",
"es/production",
"es/sdks"
]
},
{
"group": "Cliente",
"pages": ["es/client/reference", "es/client/create", "es/client/list"]
},
{
"group": "Cobranza",
"pages": ["es/payment/reference", "es/payment/create", "es/payment/list"]
},
{
"group": "Pix QRCode",
"pages": [
"es/pix-qrcode/reference",
"es/pix-qrcode/create",
"es/pix-qrcode/simulate-payment",
"es/pix-qrcode/check"
]
},
{
"group": "Cupón",
"pages": ["es/coupon/reference", "es/coupon/create", "es/coupon/list"]
},
{
"group": "Retiro",
"pages": ["es/withdraw/reference", "es/withdraw/create", "es/withdraw/list"]
}
]
},
{
"group": "Cupom",
"pages": ["pages/coupon/reference", "pages/coupon/create", "pages/coupon/list"]
},
{
"group": "Saque",
"pages": ["pages/withdraw/reference", "pages/withdraw/create", "pages/withdraw/list"]
"tab": "Referencia de la API",
"openapi": "openapi-es.yaml"
}
]
},
{
"tab": "Referência da API",
"openapi": "openapi.yaml"
"language": "en",
"tabs": [
{
"tab": "Documentation",
"groups": [
{
"group": "Introduction",
"pages": [
"en/introduction",
"en/devmode",
"en/authentication",
"en/webhooks",
"en/production",
"en/sdks"
]
},
{
"group": "Customer",
"pages": ["en/client/reference", "en/client/create", "en/client/list"]
},
{
"group": "Payment",
"pages": ["en/payment/reference", "en/payment/create", "en/payment/list"]
},
{
"group": "Pix QRCode",
"pages": [
"en/pix-qrcode/reference",
"en/pix-qrcode/create",
"en/pix-qrcode/simulate-payment",
"en/pix-qrcode/check"
]
},
{
"group": "Coupon",
"pages": ["en/coupon/reference", "en/coupon/create", "en/coupon/list"]
},
{
"group": "Withdraw",
"pages": ["en/withdraw/reference", "en/withdraw/create", "en/withdraw/list"]
}
]
},
{
"tab": "API Reference",
"openapi": "openapi-en.yaml"
}
]
}
]
},
Expand Down
93 changes: 93 additions & 0 deletions en/authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
title: 'Authentication'
description: 'How to send requests to our API'
icon: 'lock'
---

<Tip>
**API Key**: Your credential to access the AbacatePay API. This key identifies your account and authorizes your requests. **IMPORTANT**: Without the API key, requests will be rejected.
</Tip>

## <Icon icon="lock" type="solid"/> Managing API keys

Manage your API keys directly in our platform. You can:
- List all active keys
- Create new keys
- Revoke existing keys

<Card title="Environments and API Keys" icon="book" horizontal>
All requests are sent to the same endpoint (`https://api.abacatepay.com`), but the environment is determined by the API key used:
- Keys created in **dev mode** process transactions in the test environment
- Keys created in **production** process real transactions

Learn more about the development environment <a href="./devmode">here</a>.
</Card>

<Card title="Authentication Error" icon="warning" horizontal>
The API will return HTTP code `401` when:
- The API key is not provided in the header
- The key is invalid
- The key has been revoked
</Card>

## <Icon icon="key" type="solid"/> Creating API keys

<Card title="Security Best Practices" icon="light-emergency-on" horizontal>
* Store your keys in environment variables or secret managers
* Never share your API keys
* AbacatePay will never request your keys
* Immediately revoke any compromised key
</Card>

## How to create your API key

Follow these steps in the AbacatePay dashboard:

<Steps>
<Step title="Access the Integration Section">
<Card>
<img
src="/images/criar-chave-api.png"
alt="AbacatePay platform interface showing the key creation button"
/>
<Card title="Click the 'Create Key' button">
Start the process of creating a new API key
</Card>
</Card>
</Step>
<Step title="Add a Description">
<Card>
<img
src="/images/exemplo-de-chave-api.png"
alt="Key creation form with description field"
/>
<Card title="Identify your key">
Add a clear description to identify the purpose of this key
</Card>
</Card>
</Step>
<Step title="Copy your Key">
<Card>
<img
src="/images/copiar-chave-api.png"
alt="List of keys with copy option"
/>
<Card title="Store your key securely">
Copy the generated key and store it in a secure location
</Card>
</Card>
</Step>
</Steps>

After creating your key, you can start integrating with our API. Remember to include the key in all requests in the `Authorization` header:

```bash
curl -X POST https://api.abacatepay.com/v1/payments \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"amount": 1000}'
```

<Card title="Important Note" icon="info" horizontal>
The same endpoint (`https://api.abacatepay.com`) is used for both development and production environments. The environment is automatically determined by the API key used in the request.
</Card>
5 changes: 5 additions & 0 deletions en/client/create.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'Create a new Customer'
openapi: "POST /customer/create"
---

4 changes: 4 additions & 0 deletions en/client/list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'List Customers'
openapi: "GET /customer/list"
---
62 changes: 62 additions & 0 deletions en/client/reference.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: 'Reference'
description: 'Gerencie seus clientes, aqueles que pagam você.'
icon: 'book-open-cover'
---

Um cliente é seu usuário final, aquele que você vai cobrar e pagar o seu produto.

## <Icon icon="folder-tree" type="solid"/> Estrutura

Um cliente é representado em nossa API pela seguinte estrutura:

```json
{
"id": "cust_aebxkhDZNaMmJeKsy0AHS0FQ",
"metadata": {
"name": "Test Customer",
"cellphone": "11999999999",
"taxId": "12345678900",
"email": "test@example.com"
}
}
```

## Atributos

### id:

```json {2}
{
"id": "cust_aebxkhDZNaMmJeKsy0AHS0FQ",
}
```

`id` : <u> string. </u> <br />
Id único do cliente na AbacatePay

### metadados:
Objeto com os dados do cliente

```json json {2-7}
{
"metadata": {
"name": "Test Customer",
"cellphone": "11999999999",
"taxId": "12345678900",
"email": "test@example.com"
}
}
```

* `name` : <u> string. </u> <br /> Nome do cliente (opcional)

* `cellphone` : <u> string. </u> <br /> Telefone do cliente (opcional)

* `taxId` : <u> string. </u> <br /> Documento válido do cliente, podendo ser CPF ou CNPJ (opcional)

* `email` : <u> string. </u> <br /> E-mail do cliente (obrigatório)

<Tip title="Clientes são únicos por CPF/CNPJ" icon="book" horizontal>
Não é possível criar um cliente com CPF/CNPJ inválido e caso já exista um cliente com esse CPF/CNPJ, a API não criará o cliente novo mas retornará o cliente já existente
</Tip>
4 changes: 4 additions & 0 deletions en/coupon/create.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'Create a new coupon'
openapi: "POST /coupon/create"
---
4 changes: 4 additions & 0 deletions en/coupon/list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'List coupons'
openapi: "GET /coupon/list"
---
Loading