Criar produto
curl --request POST \
--url https://api.pagstack.com/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"price": 50000050,
"description": "<string>",
"methods": [
"pix"
],
"active": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
price: 50000050,
description: '<string>',
methods: ['pix'],
active: true
})
};
fetch('https://api.pagstack.com/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagstack.com/v1/products"
payload = {
"name": "<string>",
"price": 50000050,
"description": "<string>",
"methods": ["pix"],
"active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "product",
"livemode": true,
"name": "<string>",
"description": "<string>",
"price": 0,
"methods": [
"pix"
],
"active": true,
"created_at": "<string>"
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Produtos
Criar produto
Cadastra um produto no catálogo.
Criar produto
curl --request POST \
--url https://api.pagstack.com/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"price": 50000050,
"description": "<string>",
"methods": [
"pix"
],
"active": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
price: 50000050,
description: '<string>',
methods: ['pix'],
active: true
})
};
fetch('https://api.pagstack.com/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pagstack.com/v1/products"
payload = {
"name": "<string>",
"price": 50000050,
"description": "<string>",
"methods": ["pix"],
"active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "product",
"livemode": true,
"name": "<string>",
"description": "<string>",
"price": 0,
"methods": [
"pix"
],
"active": true,
"created_at": "<string>"
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Autorizações
Cabeçalhos
Corpo
application/json
Resposta
Sucesso.
Produto do catálogo.