curl --request POST \
--url https://api.bonifiq.com.br/v1/pvt/Customer/availablecoupons \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"PageNumber": 123,
"PageSize": 123,
"CustomerId": "<string>",
"Customer": {
"Document": "<string>",
"Email": "<string>"
}
}
'import requests
url = "https://api.bonifiq.com.br/v1/pvt/Customer/availablecoupons"
payload = {
"PageNumber": 123,
"PageSize": 123,
"CustomerId": "<string>",
"Customer": {
"Document": "<string>",
"Email": "<string>"
}
}
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({
PageNumber: 123,
PageSize: 123,
CustomerId: '<string>',
Customer: {Document: '<string>', Email: '<string>'}
})
};
fetch('https://api.bonifiq.com.br/v1/pvt/Customer/availablecoupons', 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/pvt/Customer/availablecoupons",
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([
'PageNumber' => 123,
'PageSize' => 123,
'CustomerId' => '<string>',
'Customer' => [
'Document' => '<string>',
'Email' => '<string>'
]
]),
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.bonifiq.com.br/v1/pvt/Customer/availablecoupons"
payload := strings.NewReader("{\n \"PageNumber\": 123,\n \"PageSize\": 123,\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"Document\": \"<string>\",\n \"Email\": \"<string>\"\n }\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.bonifiq.com.br/v1/pvt/Customer/availablecoupons")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"PageNumber\": 123,\n \"PageSize\": 123,\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"Document\": \"<string>\",\n \"Email\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bonifiq.com.br/v1/pvt/Customer/availablecoupons")
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 \"PageNumber\": 123,\n \"PageSize\": 123,\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"Document\": \"<string>\",\n \"Email\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"Items": [
{
"CouponCode": "<string>",
"CreatedDate": "2023-11-07T05:31:56Z",
"IsUsed": true,
"CouponValue": 123,
"CustomerId": 123,
"ValidDateStart": "2023-11-07T05:31:56Z",
"ValidDateEnd": "2023-11-07T05:31:56Z",
"CouponType": 0
}
],
"TotalItemCount": 123,
"PageSize": 123,
"PageNumber": 123,
"HasNextPage": true,
"HasError": true,
"ErrorMessages": [
"<string>"
]
}Returns a list of unused coupons that the customer have redeemed in the past using a body-based customer identifier.
curl --request POST \
--url https://api.bonifiq.com.br/v1/pvt/Customer/availablecoupons \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"PageNumber": 123,
"PageSize": 123,
"CustomerId": "<string>",
"Customer": {
"Document": "<string>",
"Email": "<string>"
}
}
'import requests
url = "https://api.bonifiq.com.br/v1/pvt/Customer/availablecoupons"
payload = {
"PageNumber": 123,
"PageSize": 123,
"CustomerId": "<string>",
"Customer": {
"Document": "<string>",
"Email": "<string>"
}
}
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({
PageNumber: 123,
PageSize: 123,
CustomerId: '<string>',
Customer: {Document: '<string>', Email: '<string>'}
})
};
fetch('https://api.bonifiq.com.br/v1/pvt/Customer/availablecoupons', 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/pvt/Customer/availablecoupons",
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([
'PageNumber' => 123,
'PageSize' => 123,
'CustomerId' => '<string>',
'Customer' => [
'Document' => '<string>',
'Email' => '<string>'
]
]),
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.bonifiq.com.br/v1/pvt/Customer/availablecoupons"
payload := strings.NewReader("{\n \"PageNumber\": 123,\n \"PageSize\": 123,\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"Document\": \"<string>\",\n \"Email\": \"<string>\"\n }\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.bonifiq.com.br/v1/pvt/Customer/availablecoupons")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"PageNumber\": 123,\n \"PageSize\": 123,\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"Document\": \"<string>\",\n \"Email\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bonifiq.com.br/v1/pvt/Customer/availablecoupons")
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 \"PageNumber\": 123,\n \"PageSize\": 123,\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"Document\": \"<string>\",\n \"Email\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"Items": [
{
"CouponCode": "<string>",
"CreatedDate": "2023-11-07T05:31:56Z",
"IsUsed": true,
"CouponValue": 123,
"CustomerId": 123,
"ValidDateStart": "2023-11-07T05:31:56Z",
"ValidDateEnd": "2023-11-07T05:31:56Z",
"CouponType": 0
}
],
"TotalItemCount": 123,
"PageSize": 123,
"PageNumber": 123,
"HasNextPage": true,
"HasError": true,
"ErrorMessages": [
"<string>"
]
}Authorizations
Use API Basic Auth Keys
Body
Customer identifier data and pagination filter. CustomerId remains required. When Checkout.CustomerOriginalIdSource is configured as document or email, lookup uses Customer.Document or Customer.Email respectively.
Request used by the body-based available coupons endpoint.
Pagenation number
Amount of items per page, Max size is 50 items per page.
Legacy customer identifier used by the merchant platform. This field remains required.
When Checkout.CustomerOriginalIdSource is configured as document or email,
BonifiQ ignores this value for lookup and uses the configured Customer field instead.
Customer identifiers used when Checkout.CustomerOriginalIdSource
is configured as document or email.
Show child attributes
Show child attributes
Response
Base List response model methods
Collection with the found entities on the bonifiq DB.
Show child attributes
Show child attributes
Total of rewards Configurations founds.
Pagination size
Actual Page Number
true if there is another page to be load.
If true the request had an error.
List with the error messages
Was this page helpful?