Calculate how many points will be generate for a giving product, according to Purchase Objective configuration
curl --request POST \
--url https://api.bonifiq.com.br/v1/pub/Product/points \
--header 'Content-Type: application/json' \
--header 'X-BQ-ApiToken: <api-key>' \
--data '
[
{
"Id": "<string>",
"Price": 10.5,
"PriceCurrency": "<string>",
"Name": "<string>"
}
]
'import requests
url = "https://api.bonifiq.com.br/v1/pub/Product/points"
payload = [
{
"Id": "<string>",
"Price": 10.5,
"PriceCurrency": "<string>",
"Name": "<string>"
}
]
headers = {
"X-BQ-ApiToken": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-BQ-ApiToken': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{Id: '<string>', Price: 10.5, PriceCurrency: '<string>', Name: '<string>'}])
};
fetch('https://api.bonifiq.com.br/v1/pub/Product/points', 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.bonifiq.com.br/v1/pub/Product/points",
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([
[
'Id' => '<string>',
'Price' => 10.5,
'PriceCurrency' => '<string>',
'Name' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BQ-ApiToken: <api-key>"
],
]);
$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.bonifiq.com.br/v1/pub/Product/points"
payload := strings.NewReader("[\n {\n \"Id\": \"<string>\",\n \"Price\": 10.5,\n \"PriceCurrency\": \"<string>\",\n \"Name\": \"<string>\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BQ-ApiToken", "<api-key>")
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.bonifiq.com.br/v1/pub/Product/points")
.header("X-BQ-ApiToken", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"Id\": \"<string>\",\n \"Price\": 10.5,\n \"PriceCurrency\": \"<string>\",\n \"Name\": \"<string>\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bonifiq.com.br/v1/pub/Product/points")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BQ-ApiToken"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"Id\": \"<string>\",\n \"Price\": 10.5,\n \"PriceCurrency\": \"<string>\",\n \"Name\": \"<string>\"\n }\n]"
response = http.request(request)
puts response.read_body"<string>"Product
Calculate how many points will be generate for a giving product, according to Purchase Objective configuration
POST
/
v1
/
pub
/
Product
/
points
Calculate how many points will be generate for a giving product, according to Purchase Objective configuration
curl --request POST \
--url https://api.bonifiq.com.br/v1/pub/Product/points \
--header 'Content-Type: application/json' \
--header 'X-BQ-ApiToken: <api-key>' \
--data '
[
{
"Id": "<string>",
"Price": 10.5,
"PriceCurrency": "<string>",
"Name": "<string>"
}
]
'import requests
url = "https://api.bonifiq.com.br/v1/pub/Product/points"
payload = [
{
"Id": "<string>",
"Price": 10.5,
"PriceCurrency": "<string>",
"Name": "<string>"
}
]
headers = {
"X-BQ-ApiToken": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-BQ-ApiToken': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{Id: '<string>', Price: 10.5, PriceCurrency: '<string>', Name: '<string>'}])
};
fetch('https://api.bonifiq.com.br/v1/pub/Product/points', 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.bonifiq.com.br/v1/pub/Product/points",
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([
[
'Id' => '<string>',
'Price' => 10.5,
'PriceCurrency' => '<string>',
'Name' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BQ-ApiToken: <api-key>"
],
]);
$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.bonifiq.com.br/v1/pub/Product/points"
payload := strings.NewReader("[\n {\n \"Id\": \"<string>\",\n \"Price\": 10.5,\n \"PriceCurrency\": \"<string>\",\n \"Name\": \"<string>\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BQ-ApiToken", "<api-key>")
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.bonifiq.com.br/v1/pub/Product/points")
.header("X-BQ-ApiToken", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"Id\": \"<string>\",\n \"Price\": 10.5,\n \"PriceCurrency\": \"<string>\",\n \"Name\": \"<string>\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bonifiq.com.br/v1/pub/Product/points")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BQ-ApiToken"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"Id\": \"<string>\",\n \"Price\": 10.5,\n \"PriceCurrency\": \"<string>\",\n \"Name\": \"<string>\"\n }\n]"
response = http.request(request)
puts response.read_body"<string>"Authorizations
API Tokeen
Body
application/json
Response
200 - application/octet-stream
The response is of type file.
Was this page helpful?