curl --request POST \
--url https://api-global.fastpaybrasil.com/v1/products \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Camiseta Preta P",
"price": 89.9,
"currency": "BRL",
"description": "Algodão 100%, gola careca.",
"productLink": "https://meusite.com/area-do-aluno",
"sku": "CAM-PT-P",
"trackStock": true,
"stock": 120,
"weight": 0.25,
"heightCm": 2,
"widthCm": 30,
"lengthCm": 40
}
'import requests
url = "https://api-global.fastpaybrasil.com/v1/products"
payload = {
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Camiseta Preta P",
"price": 89.9,
"currency": "BRL",
"description": "Algodão 100%, gola careca.",
"productLink": "https://meusite.com/area-do-aluno",
"sku": "CAM-PT-P",
"trackStock": True,
"stock": 120,
"weight": 0.25,
"heightCm": 2,
"widthCm": 30,
"lengthCm": 40
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '2RhQg9M7ZCg3X3nMb9W1kX8Q',
name: 'Camiseta Preta P',
price: 89.9,
currency: 'BRL',
description: 'Algodão 100%, gola careca.',
productLink: 'https://meusite.com/area-do-aluno',
sku: 'CAM-PT-P',
trackStock: true,
stock: 120,
weight: 0.25,
heightCm: 2,
widthCm: 30,
lengthCm: 40
})
};
fetch('https://api-global.fastpaybrasil.com/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-global.fastpaybrasil.com/v1/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchantId' => '2RhQg9M7ZCg3X3nMb9W1kX8Q',
'name' => 'Camiseta Preta P',
'price' => 89.9,
'currency' => 'BRL',
'description' => 'Algodão 100%, gola careca.',
'productLink' => 'https://meusite.com/area-do-aluno',
'sku' => 'CAM-PT-P',
'trackStock' => true,
'stock' => 120,
'weight' => 0.25,
'heightCm' => 2,
'widthCm' => 30,
'lengthCm' => 40
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-global.fastpaybrasil.com/v1/products"
payload := strings.NewReader("{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Camiseta Preta P\",\n \"price\": 89.9,\n \"currency\": \"BRL\",\n \"description\": \"Algodão 100%, gola careca.\",\n \"productLink\": \"https://meusite.com/area-do-aluno\",\n \"sku\": \"CAM-PT-P\",\n \"trackStock\": true,\n \"stock\": 120,\n \"weight\": 0.25,\n \"heightCm\": 2,\n \"widthCm\": 30,\n \"lengthCm\": 40\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-global.fastpaybrasil.com/v1/products")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Camiseta Preta P\",\n \"price\": 89.9,\n \"currency\": \"BRL\",\n \"description\": \"Algodão 100%, gola careca.\",\n \"productLink\": \"https://meusite.com/area-do-aluno\",\n \"sku\": \"CAM-PT-P\",\n \"trackStock\": true,\n \"stock\": 120,\n \"weight\": 0.25,\n \"heightCm\": 2,\n \"widthCm\": 30,\n \"lengthCm\": 40\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Camiseta Preta P\",\n \"price\": 89.9,\n \"currency\": \"BRL\",\n \"description\": \"Algodão 100%, gola careca.\",\n \"productLink\": \"https://meusite.com/area-do-aluno\",\n \"sku\": \"CAM-PT-P\",\n \"trackStock\": true,\n \"stock\": 120,\n \"weight\": 0.25,\n \"heightCm\": 2,\n \"widthCm\": 30,\n \"lengthCm\": 40\n}"
response = http.request(request)
puts response.read_body{
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Camiseta Preta P",
"description": "<string>",
"productLink": "<string>",
"price": 89.9,
"currency": "BRL",
"productType": "physical",
"sku": "<string>",
"trackStock": true,
"stock": 123,
"weight": 123,
"heightCm": 123,
"widthCm": 123,
"lengthCm": 123,
"status": "active",
"imageUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Create a product
Creates a product in the merchant’s catalog. Products are reusable across one or more Payment Links and can be physical or digital.
curl --request POST \
--url https://api-global.fastpaybrasil.com/v1/products \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Camiseta Preta P",
"price": 89.9,
"currency": "BRL",
"description": "Algodão 100%, gola careca.",
"productLink": "https://meusite.com/area-do-aluno",
"sku": "CAM-PT-P",
"trackStock": true,
"stock": 120,
"weight": 0.25,
"heightCm": 2,
"widthCm": 30,
"lengthCm": 40
}
'import requests
url = "https://api-global.fastpaybrasil.com/v1/products"
payload = {
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Camiseta Preta P",
"price": 89.9,
"currency": "BRL",
"description": "Algodão 100%, gola careca.",
"productLink": "https://meusite.com/area-do-aluno",
"sku": "CAM-PT-P",
"trackStock": True,
"stock": 120,
"weight": 0.25,
"heightCm": 2,
"widthCm": 30,
"lengthCm": 40
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '2RhQg9M7ZCg3X3nMb9W1kX8Q',
name: 'Camiseta Preta P',
price: 89.9,
currency: 'BRL',
description: 'Algodão 100%, gola careca.',
productLink: 'https://meusite.com/area-do-aluno',
sku: 'CAM-PT-P',
trackStock: true,
stock: 120,
weight: 0.25,
heightCm: 2,
widthCm: 30,
lengthCm: 40
})
};
fetch('https://api-global.fastpaybrasil.com/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-global.fastpaybrasil.com/v1/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchantId' => '2RhQg9M7ZCg3X3nMb9W1kX8Q',
'name' => 'Camiseta Preta P',
'price' => 89.9,
'currency' => 'BRL',
'description' => 'Algodão 100%, gola careca.',
'productLink' => 'https://meusite.com/area-do-aluno',
'sku' => 'CAM-PT-P',
'trackStock' => true,
'stock' => 120,
'weight' => 0.25,
'heightCm' => 2,
'widthCm' => 30,
'lengthCm' => 40
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-global.fastpaybrasil.com/v1/products"
payload := strings.NewReader("{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Camiseta Preta P\",\n \"price\": 89.9,\n \"currency\": \"BRL\",\n \"description\": \"Algodão 100%, gola careca.\",\n \"productLink\": \"https://meusite.com/area-do-aluno\",\n \"sku\": \"CAM-PT-P\",\n \"trackStock\": true,\n \"stock\": 120,\n \"weight\": 0.25,\n \"heightCm\": 2,\n \"widthCm\": 30,\n \"lengthCm\": 40\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-global.fastpaybrasil.com/v1/products")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Camiseta Preta P\",\n \"price\": 89.9,\n \"currency\": \"BRL\",\n \"description\": \"Algodão 100%, gola careca.\",\n \"productLink\": \"https://meusite.com/area-do-aluno\",\n \"sku\": \"CAM-PT-P\",\n \"trackStock\": true,\n \"stock\": 120,\n \"weight\": 0.25,\n \"heightCm\": 2,\n \"widthCm\": 30,\n \"lengthCm\": 40\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Camiseta Preta P\",\n \"price\": 89.9,\n \"currency\": \"BRL\",\n \"description\": \"Algodão 100%, gola careca.\",\n \"productLink\": \"https://meusite.com/area-do-aluno\",\n \"sku\": \"CAM-PT-P\",\n \"trackStock\": true,\n \"stock\": 120,\n \"weight\": 0.25,\n \"heightCm\": 2,\n \"widthCm\": 30,\n \"lengthCm\": 40\n}"
response = http.request(request)
puts response.read_body{
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Camiseta Preta P",
"description": "<string>",
"productLink": "<string>",
"price": 89.9,
"currency": "BRL",
"productType": "physical",
"sku": "<string>",
"trackStock": true,
"stock": 123,
"weight": 123,
"heightCm": 123,
"widthCm": 123,
"lengthCm": 123,
"status": "active",
"imageUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
HTTP Basic authentication. Use your secret key as the username and an empty string as password. The API key should be base64 encoded in the format 'username:' when sending the Authorization header.
Body
ID of the merchant that owns the product.
"2RhQg9M7ZCg3X3nMb9W1kX8Q"
Product name shown on the checkout.
255"Camiseta Preta P"
Price in the currency unit (e.g., 89.90).
x >= 089.9
ISO 4217 currency code.
"BRL"
Product type.
physical, digital Free-form product description.
"Algodão 100%, gola careca."
Access URL (digital products) delivered to the buyer.
"https://meusite.com/area-do-aluno"
Internal code used in search and identification.
64"CAM-PT-P"
Enable stock tracking (physical only).
true
Available quantity.
x >= 0120
Weight in kilograms, used for freight quoting.
x >= 00.25
Height in centimeters.
x >= 02
Width in centimeters.
x >= 030
Length in centimeters.
x >= 040
Defaults to active. Use PATCH /v1/products/{id}/status to archive/reactivate later.
active, inactive Response
The product has been successfully created
"2RhQg9M7ZCg3X3nMb9W1kX8Q"
"2RhQg9M7ZCg3X3nMb9W1kX8Q"
"Camiseta Preta P"
89.9
"BRL"
physical, digital active, inactive Signed, short-lived URL for the product image. null when no
image was uploaded.