curl --request POST \
--url https://api.cloud.pepperpay.com.br/public/v1/products/{hash}/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Oferta Especial do Curso",
"price": 9900,
"payment_methods": [
1,
3
],
"method_default": 1,
"interval": "monthly",
"affiliates_visible": true,
"payment_method_discounts": [
{
"payment_method": "credit_card",
"discount_percentage": 10
}
]
}
'import requests
url = "https://api.cloud.pepperpay.com.br/public/v1/products/{hash}/offers"
payload = {
"title": "Oferta Especial do Curso",
"price": 9900,
"payment_methods": [1, 3],
"method_default": 1,
"interval": "monthly",
"affiliates_visible": True,
"payment_method_discounts": [
{
"payment_method": "credit_card",
"discount_percentage": 10
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Oferta Especial do Curso',
price: 9900,
payment_methods: [1, 3],
method_default: 1,
interval: 'monthly',
affiliates_visible: true,
payment_method_discounts: [{payment_method: 'credit_card', discount_percentage: 10}]
})
};
fetch('https://api.cloud.pepperpay.com.br/public/v1/products/{hash}/offers', 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.cloud.pepperpay.com.br/public/v1/products/{hash}/offers",
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([
'title' => 'Oferta Especial do Curso',
'price' => 9900,
'payment_methods' => [
1,
3
],
'method_default' => 1,
'interval' => 'monthly',
'affiliates_visible' => true,
'payment_method_discounts' => [
[
'payment_method' => 'credit_card',
'discount_percentage' => 10
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.cloud.pepperpay.com.br/public/v1/products/{hash}/offers"
payload := strings.NewReader("{\n \"title\": \"Oferta Especial do Curso\",\n \"price\": 9900,\n \"payment_methods\": [\n 1,\n 3\n ],\n \"method_default\": 1,\n \"interval\": \"monthly\",\n \"affiliates_visible\": true,\n \"payment_method_discounts\": [\n {\n \"payment_method\": \"credit_card\",\n \"discount_percentage\": 10\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.cloud.pepperpay.com.br/public/v1/products/{hash}/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Oferta Especial do Curso\",\n \"price\": 9900,\n \"payment_methods\": [\n 1,\n 3\n ],\n \"method_default\": 1,\n \"interval\": \"monthly\",\n \"affiliates_visible\": true,\n \"payment_method_discounts\": [\n {\n \"payment_method\": \"credit_card\",\n \"discount_percentage\": 10\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.pepperpay.com.br/public/v1/products/{hash}/offers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Oferta Especial do Curso\",\n \"price\": 9900,\n \"payment_methods\": [\n 1,\n 3\n ],\n \"method_default\": 1,\n \"interval\": \"monthly\",\n \"affiliates_visible\": true,\n \"payment_method_discounts\": [\n {\n \"payment_method\": \"credit_card\",\n \"discount_percentage\": 10\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"hash": "abc123def",
"title": "Oferta Especial do Curso",
"price": 9900,
"url": "https://go.pepper.com.br/abc123def",
"status": 1,
"interval": "monthly",
"created_at": "2024-12-26 15:44:26",
"updated_at": "2024-12-26 15:44:26"
}{
"success": true,
"message": "<string>",
"errors": [
"<string>"
]
}{
"success": true,
"message": "<string>"
}Criar oferta
Criar uma nova oferta para um produto específico
curl --request POST \
--url https://api.cloud.pepperpay.com.br/public/v1/products/{hash}/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Oferta Especial do Curso",
"price": 9900,
"payment_methods": [
1,
3
],
"method_default": 1,
"interval": "monthly",
"affiliates_visible": true,
"payment_method_discounts": [
{
"payment_method": "credit_card",
"discount_percentage": 10
}
]
}
'import requests
url = "https://api.cloud.pepperpay.com.br/public/v1/products/{hash}/offers"
payload = {
"title": "Oferta Especial do Curso",
"price": 9900,
"payment_methods": [1, 3],
"method_default": 1,
"interval": "monthly",
"affiliates_visible": True,
"payment_method_discounts": [
{
"payment_method": "credit_card",
"discount_percentage": 10
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Oferta Especial do Curso',
price: 9900,
payment_methods: [1, 3],
method_default: 1,
interval: 'monthly',
affiliates_visible: true,
payment_method_discounts: [{payment_method: 'credit_card', discount_percentage: 10}]
})
};
fetch('https://api.cloud.pepperpay.com.br/public/v1/products/{hash}/offers', 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.cloud.pepperpay.com.br/public/v1/products/{hash}/offers",
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([
'title' => 'Oferta Especial do Curso',
'price' => 9900,
'payment_methods' => [
1,
3
],
'method_default' => 1,
'interval' => 'monthly',
'affiliates_visible' => true,
'payment_method_discounts' => [
[
'payment_method' => 'credit_card',
'discount_percentage' => 10
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.cloud.pepperpay.com.br/public/v1/products/{hash}/offers"
payload := strings.NewReader("{\n \"title\": \"Oferta Especial do Curso\",\n \"price\": 9900,\n \"payment_methods\": [\n 1,\n 3\n ],\n \"method_default\": 1,\n \"interval\": \"monthly\",\n \"affiliates_visible\": true,\n \"payment_method_discounts\": [\n {\n \"payment_method\": \"credit_card\",\n \"discount_percentage\": 10\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.cloud.pepperpay.com.br/public/v1/products/{hash}/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Oferta Especial do Curso\",\n \"price\": 9900,\n \"payment_methods\": [\n 1,\n 3\n ],\n \"method_default\": 1,\n \"interval\": \"monthly\",\n \"affiliates_visible\": true,\n \"payment_method_discounts\": [\n {\n \"payment_method\": \"credit_card\",\n \"discount_percentage\": 10\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.pepperpay.com.br/public/v1/products/{hash}/offers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Oferta Especial do Curso\",\n \"price\": 9900,\n \"payment_methods\": [\n 1,\n 3\n ],\n \"method_default\": 1,\n \"interval\": \"monthly\",\n \"affiliates_visible\": true,\n \"payment_method_discounts\": [\n {\n \"payment_method\": \"credit_card\",\n \"discount_percentage\": 10\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"hash": "abc123def",
"title": "Oferta Especial do Curso",
"price": 9900,
"url": "https://go.pepper.com.br/abc123def",
"status": 1,
"interval": "monthly",
"created_at": "2024-12-26 15:44:26",
"updated_at": "2024-12-26 15:44:26"
}{
"success": true,
"message": "<string>",
"errors": [
"<string>"
]
}{
"success": true,
"message": "<string>"
}Headers Obrigatórios
- Authorization:
Bearer {seu_token_aqui} - Accept:
application/json - Content-Type:
application/json
Autorizações
Use o token da Pepper API no formato: Bearer {seu_token_aqui}
Parâmetros de caminho
Hash ID do produto
Corpo
Dados para criação da oferta
Título da oferta
Preço da oferta em centavos
Métodos de pagamento aceitos (1 para cartão, 2 para boleto, 3 para pix)
1, 2, 3 Método de pagamento padrão (1 para cartão, 2 para boleto, 3 para pix)
1, 2, 3 Se a oferta ficará visível para afiliados no marketplace
Intervalo de recorrência (obrigatório apenas para produtos de assinatura)
daily, weekly, monthly, quarterly, semi-annual, yearly Descontos por método de pagamento
Show child attributes
Show child attributes
Resposta
Oferta criada com sucesso
Hash ID único da oferta criada
Título da oferta
Preço da oferta em centavos
URL do checkout dessa oferta
Status da oferta
Intervalo de recorrência da oferta
Data de criação da oferta
Data de atualização da oferta