curl --request POST \
--url https://api.bonifiq.com.br/v1/pvt/Coupons \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"OriginalId": "<string>",
"CouponCode": "<string>",
"CreatedDate": "2023-11-07T05:31:56Z",
"IsUsed": true,
"CouponValue": 123,
"ValidDateStart": "2023-11-07T05:31:56Z",
"ValidDateEnd": "2023-11-07T05:31:56Z",
"CustomerId": "<string>",
"Customer": {
"OriginalId": "<string>",
"Name": "<string>",
"Email": "<string>",
"Phone": "<string>",
"BirthdayDate": "2023-11-07T05:31:56Z",
"SignupDate": "2023-11-07T05:31:56Z",
"Document": "<string>",
"IsEnrolled": true,
"EnrolledDate": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.bonifiq.com.br/v1/pvt/Coupons"
payload = {
"OriginalId": "<string>",
"CouponCode": "<string>",
"CreatedDate": "2023-11-07T05:31:56Z",
"IsUsed": True,
"CouponValue": 123,
"ValidDateStart": "2023-11-07T05:31:56Z",
"ValidDateEnd": "2023-11-07T05:31:56Z",
"CustomerId": "<string>",
"Customer": {
"OriginalId": "<string>",
"Name": "<string>",
"Email": "<string>",
"Phone": "<string>",
"BirthdayDate": "2023-11-07T05:31:56Z",
"SignupDate": "2023-11-07T05:31:56Z",
"Document": "<string>",
"IsEnrolled": True,
"EnrolledDate": "2023-11-07T05:31:56Z"
}
}
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({
OriginalId: '<string>',
CouponCode: '<string>',
CreatedDate: '2023-11-07T05:31:56Z',
IsUsed: true,
CouponValue: 123,
ValidDateStart: '2023-11-07T05:31:56Z',
ValidDateEnd: '2023-11-07T05:31:56Z',
CustomerId: '<string>',
Customer: {
OriginalId: '<string>',
Name: '<string>',
Email: '<string>',
Phone: '<string>',
BirthdayDate: '2023-11-07T05:31:56Z',
SignupDate: '2023-11-07T05:31:56Z',
Document: '<string>',
IsEnrolled: true,
EnrolledDate: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.bonifiq.com.br/v1/pvt/Coupons', 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/Coupons",
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([
'OriginalId' => '<string>',
'CouponCode' => '<string>',
'CreatedDate' => '2023-11-07T05:31:56Z',
'IsUsed' => true,
'CouponValue' => 123,
'ValidDateStart' => '2023-11-07T05:31:56Z',
'ValidDateEnd' => '2023-11-07T05:31:56Z',
'CustomerId' => '<string>',
'Customer' => [
'OriginalId' => '<string>',
'Name' => '<string>',
'Email' => '<string>',
'Phone' => '<string>',
'BirthdayDate' => '2023-11-07T05:31:56Z',
'SignupDate' => '2023-11-07T05:31:56Z',
'Document' => '<string>',
'IsEnrolled' => true,
'EnrolledDate' => '2023-11-07T05:31:56Z'
]
]),
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/Coupons"
payload := strings.NewReader("{\n \"OriginalId\": \"<string>\",\n \"CouponCode\": \"<string>\",\n \"CreatedDate\": \"2023-11-07T05:31:56Z\",\n \"IsUsed\": true,\n \"CouponValue\": 123,\n \"ValidDateStart\": \"2023-11-07T05:31:56Z\",\n \"ValidDateEnd\": \"2023-11-07T05:31:56Z\",\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"OriginalId\": \"<string>\",\n \"Name\": \"<string>\",\n \"Email\": \"<string>\",\n \"Phone\": \"<string>\",\n \"BirthdayDate\": \"2023-11-07T05:31:56Z\",\n \"SignupDate\": \"2023-11-07T05:31:56Z\",\n \"Document\": \"<string>\",\n \"IsEnrolled\": true,\n \"EnrolledDate\": \"2023-11-07T05:31:56Z\"\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/Coupons")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"OriginalId\": \"<string>\",\n \"CouponCode\": \"<string>\",\n \"CreatedDate\": \"2023-11-07T05:31:56Z\",\n \"IsUsed\": true,\n \"CouponValue\": 123,\n \"ValidDateStart\": \"2023-11-07T05:31:56Z\",\n \"ValidDateEnd\": \"2023-11-07T05:31:56Z\",\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"OriginalId\": \"<string>\",\n \"Name\": \"<string>\",\n \"Email\": \"<string>\",\n \"Phone\": \"<string>\",\n \"BirthdayDate\": \"2023-11-07T05:31:56Z\",\n \"SignupDate\": \"2023-11-07T05:31:56Z\",\n \"Document\": \"<string>\",\n \"IsEnrolled\": true,\n \"EnrolledDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bonifiq.com.br/v1/pvt/Coupons")
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 \"OriginalId\": \"<string>\",\n \"CouponCode\": \"<string>\",\n \"CreatedDate\": \"2023-11-07T05:31:56Z\",\n \"IsUsed\": true,\n \"CouponValue\": 123,\n \"ValidDateStart\": \"2023-11-07T05:31:56Z\",\n \"ValidDateEnd\": \"2023-11-07T05:31:56Z\",\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"OriginalId\": \"<string>\",\n \"Name\": \"<string>\",\n \"Email\": \"<string>\",\n \"Phone\": \"<string>\",\n \"BirthdayDate\": \"2023-11-07T05:31:56Z\",\n \"SignupDate\": \"2023-11-07T05:31:56Z\",\n \"Document\": \"<string>\",\n \"IsEnrolled\": true,\n \"EnrolledDate\": \"2023-11-07T05:31:56Z\"\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>"
]
}Creates a coupon for the given customer.
curl --request POST \
--url https://api.bonifiq.com.br/v1/pvt/Coupons \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"OriginalId": "<string>",
"CouponCode": "<string>",
"CreatedDate": "2023-11-07T05:31:56Z",
"IsUsed": true,
"CouponValue": 123,
"ValidDateStart": "2023-11-07T05:31:56Z",
"ValidDateEnd": "2023-11-07T05:31:56Z",
"CustomerId": "<string>",
"Customer": {
"OriginalId": "<string>",
"Name": "<string>",
"Email": "<string>",
"Phone": "<string>",
"BirthdayDate": "2023-11-07T05:31:56Z",
"SignupDate": "2023-11-07T05:31:56Z",
"Document": "<string>",
"IsEnrolled": true,
"EnrolledDate": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.bonifiq.com.br/v1/pvt/Coupons"
payload = {
"OriginalId": "<string>",
"CouponCode": "<string>",
"CreatedDate": "2023-11-07T05:31:56Z",
"IsUsed": True,
"CouponValue": 123,
"ValidDateStart": "2023-11-07T05:31:56Z",
"ValidDateEnd": "2023-11-07T05:31:56Z",
"CustomerId": "<string>",
"Customer": {
"OriginalId": "<string>",
"Name": "<string>",
"Email": "<string>",
"Phone": "<string>",
"BirthdayDate": "2023-11-07T05:31:56Z",
"SignupDate": "2023-11-07T05:31:56Z",
"Document": "<string>",
"IsEnrolled": True,
"EnrolledDate": "2023-11-07T05:31:56Z"
}
}
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({
OriginalId: '<string>',
CouponCode: '<string>',
CreatedDate: '2023-11-07T05:31:56Z',
IsUsed: true,
CouponValue: 123,
ValidDateStart: '2023-11-07T05:31:56Z',
ValidDateEnd: '2023-11-07T05:31:56Z',
CustomerId: '<string>',
Customer: {
OriginalId: '<string>',
Name: '<string>',
Email: '<string>',
Phone: '<string>',
BirthdayDate: '2023-11-07T05:31:56Z',
SignupDate: '2023-11-07T05:31:56Z',
Document: '<string>',
IsEnrolled: true,
EnrolledDate: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.bonifiq.com.br/v1/pvt/Coupons', 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/Coupons",
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([
'OriginalId' => '<string>',
'CouponCode' => '<string>',
'CreatedDate' => '2023-11-07T05:31:56Z',
'IsUsed' => true,
'CouponValue' => 123,
'ValidDateStart' => '2023-11-07T05:31:56Z',
'ValidDateEnd' => '2023-11-07T05:31:56Z',
'CustomerId' => '<string>',
'Customer' => [
'OriginalId' => '<string>',
'Name' => '<string>',
'Email' => '<string>',
'Phone' => '<string>',
'BirthdayDate' => '2023-11-07T05:31:56Z',
'SignupDate' => '2023-11-07T05:31:56Z',
'Document' => '<string>',
'IsEnrolled' => true,
'EnrolledDate' => '2023-11-07T05:31:56Z'
]
]),
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/Coupons"
payload := strings.NewReader("{\n \"OriginalId\": \"<string>\",\n \"CouponCode\": \"<string>\",\n \"CreatedDate\": \"2023-11-07T05:31:56Z\",\n \"IsUsed\": true,\n \"CouponValue\": 123,\n \"ValidDateStart\": \"2023-11-07T05:31:56Z\",\n \"ValidDateEnd\": \"2023-11-07T05:31:56Z\",\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"OriginalId\": \"<string>\",\n \"Name\": \"<string>\",\n \"Email\": \"<string>\",\n \"Phone\": \"<string>\",\n \"BirthdayDate\": \"2023-11-07T05:31:56Z\",\n \"SignupDate\": \"2023-11-07T05:31:56Z\",\n \"Document\": \"<string>\",\n \"IsEnrolled\": true,\n \"EnrolledDate\": \"2023-11-07T05:31:56Z\"\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/Coupons")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"OriginalId\": \"<string>\",\n \"CouponCode\": \"<string>\",\n \"CreatedDate\": \"2023-11-07T05:31:56Z\",\n \"IsUsed\": true,\n \"CouponValue\": 123,\n \"ValidDateStart\": \"2023-11-07T05:31:56Z\",\n \"ValidDateEnd\": \"2023-11-07T05:31:56Z\",\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"OriginalId\": \"<string>\",\n \"Name\": \"<string>\",\n \"Email\": \"<string>\",\n \"Phone\": \"<string>\",\n \"BirthdayDate\": \"2023-11-07T05:31:56Z\",\n \"SignupDate\": \"2023-11-07T05:31:56Z\",\n \"Document\": \"<string>\",\n \"IsEnrolled\": true,\n \"EnrolledDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bonifiq.com.br/v1/pvt/Coupons")
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 \"OriginalId\": \"<string>\",\n \"CouponCode\": \"<string>\",\n \"CreatedDate\": \"2023-11-07T05:31:56Z\",\n \"IsUsed\": true,\n \"CouponValue\": 123,\n \"ValidDateStart\": \"2023-11-07T05:31:56Z\",\n \"ValidDateEnd\": \"2023-11-07T05:31:56Z\",\n \"CustomerId\": \"<string>\",\n \"Customer\": {\n \"OriginalId\": \"<string>\",\n \"Name\": \"<string>\",\n \"Email\": \"<string>\",\n \"Phone\": \"<string>\",\n \"BirthdayDate\": \"2023-11-07T05:31:56Z\",\n \"SignupDate\": \"2023-11-07T05:31:56Z\",\n \"Document\": \"<string>\",\n \"IsEnrolled\": true,\n \"EnrolledDate\": \"2023-11-07T05:31:56Z\"\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
Create Coupon Request model
Id from the client store.
Coupon Code.
Date of creation of this coupon.
If 0 = Coupon is absolute value (eg R$10.00), 1 = the Coupon has a percentage value (Ex: 10%), 2 = its a free shipping Coupon, 3 = its a shipping discount Coupon.
0, 1, 2, 3, 4 If true, the coupon was already being used in a purchase.
Coupon Discount Value
Coupon validity start date
Coupon expiration date
Id for the customer that this coupon is being given.
Customer Data
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?