Skip to main content
POST
/
v1
/
pvt
/
Coupons
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",
  "CouponType": 0,
  "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
  }
}
'
{
  "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

Authorization
string
header
required

Use API Basic Auth Keys

Body

application/json

Create Coupon Request model

OriginalId
string

Id from the client store.

CouponCode
string

Coupon Code.

CreatedDate
string<date-time>

Date of creation of this coupon.

CouponType
enum<integer>

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.

Available options:
0,
1,
2,
3,
4
IsUsed
boolean

If true, the coupon was already being used in a purchase.

CouponValue
number<decimal>

Coupon Discount Value

ValidDateStart
string<date-time>

Coupon validity start date

ValidDateEnd
string<date-time>

Coupon expiration date

CustomerId
string

Id for the customer that this coupon is being given.

Customer
object

Customer Data

Response

200 - application/json

Base List response model methods

Items
object[] | null

Collection with the found entities on the bonifiq DB.

TotalItemCount
integer<int32>

Total of rewards Configurations founds.

PageSize
integer<int32>

Pagination size

PageNumber
integer<int32>

Actual Page Number

HasNextPage
boolean

true if there is another page to be load.

HasError
boolean

If true the request had an error.

ErrorMessages
string[]

List with the error messages