Criar um novo Cliente
curl --request POST \
--url https://api.billing.upag.io/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: '<string>'})
};
fetch('https://api.billing.upag.io/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.billing.upag.io/v1/customers';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Clientes
Criar um novo Cliente
Crie um cliente para poder cobrar e gerenciar seus pagamentos
POST
https://api.billing.upag.io
/
v1
/
customers
Criar um novo Cliente
curl --request POST \
--url https://api.billing.upag.io/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: '<string>'})
};
fetch('https://api.billing.upag.io/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.billing.upag.io/v1/customers';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Cria um novo cliente na sua conta.
Endpoint
curl -X POST https://api.billing.upag.io/v1/customers \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+5511999999999",
"taxId": "12345678900",
"line1": "Rua Example, 123",
"line2": "Apto 45",
"city": "São Paulo",
"state": "SP",
"country": "BR",
"zipCode": "01234567"
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const customer = await upag.customers.create({
name: 'John Doe',
email: 'john.doe@example.com',
phone: '+5511999999999',
taxId: '12345678900',
line1: 'Rua Example, 123',
line2: 'Apto 45',
city: 'São Paulo',
state: 'SP',
country: 'BR',
zipCode: '01234567'
});
Parâmetros
string
required
Nome completo do cliente.
string
required
E-mail válido do cliente.
string
Telefone do cliente.
string
CPF/CNPJ do cliente.
string
Primeira linha do endereço.
string
Segunda linha do endereço (complemento).
string
Cidade do endereço.
string
Estado do endereço.
string
País do endereço.
string
CEP do endereço.
Resposta
Response
{
"id": "cus_ahwDXrgYvur89iPs",
"livemode": false,
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+5511999999999",
"taxId": "12345678900",
"line1": "Rua Example, 123",
"line2": "Apto 45",
"city": "São Paulo",
"state": "SP",
"country": "BR",
"zipCode": "01234567",
"createdAt": 1731622178441,
"updatedAt": 1731622178441
}