Skip to main content
POST
/
v1
/
pvt
/
POS
/
rewards
/
{id}
/
redeem
This method can be used to redeem a reward in behalf of a customer.
curl --request POST \
  --url https://api.bonifiq.com.br/v1/pvt/POS/rewards/{id}/redeem \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "CustomerId": "<string>",
  "Value": 123,
  "Points": 123,
  "OriginalKey": "<string>",
  "Metadatas": [
    {
      "Name": "<string>",
      "Value": "<string>"
    }
  ],
  "RedeemOrigin": 0,
  "Branch": {
    "OriginalId": "<string>",
    "Name": "<string>"
  },
  "SalesPerson": {
    "OriginalId": "<string>",
    "Name": "<string>"
  },
  "ForceGenerateCoupon": true
}
'
{
  "ErrorMessage": "<string>",
  "ErrorCode": 123,
  "Result": {
    "RewardId": 123,
    "Point": {
      "PointId": 123,
      "Quantity": 123,
      "Metadatas": [
        {
          "Name": "<string>",
          "Value": "<string>"
        }
      ]
    },
    "ExternalCode": "<string>",
    "OriginalKey": "<string>",
    "Coupon": {
      "CouponCode": "<string>",
      "CouponType": 0,
      "CouponValue": 123,
      "ValidDateStart": "2023-11-07T05:31:56Z",
      "ValidDateEnd": "2023-11-07T05:31:56Z"
    }
  },
  "HasError": true
}

Authorizations

Authorization
string
header
required

Use API Basic Auth Keys

Path Parameters

id
integer<int32>
required

Body

application/json

Parameters used in redeeming

CustomerId
string

The id of the customer. It can be email or document (CPF/CNPJ).

Value
number<decimal> | null

Used only for Cashback Rewards. It the Cashback value selected by the customer. You can use either Points or Value for representing the selected amount of cashback to use.

Points
integer<int32> | null

Used only for Cashback Rewards. It the Cashback represented by points selected by the customer. You can use either Points or Value for representing the selected amount of cashback to use.

OriginalKey
string

This field allows you to create idempotency: even if you make the exactly same request twice it will consume the redeem only once. As distributed systems should be fault-tolerant it may result in requests being done more than one time. Not using the OriginalKey may duplicate a redeem request Inform some string that is unique for this change. For instance: if you are redeeming the reward Id=OPQ for customerID=ABC regarding the OrderId=123 with Value=10,our key could be OPQ-ABC-123-10 If you dont need this kind of verification you can just use some time-related string, such as 2023-01-01 23:59:00:000

Metadatas
object[] | null

Use this field as a key-value store for fields unique to your Business Use Case

RedeemOrigin
enum<integer>

Use this field to send redeem origin. Have 4 types: LandingPage, Widget, Copilot, Checkout, API, PDV.

Available options:
0,
1,
2,
3,
4,
5
Branch
object

A Branch is physical location or outlet of a store (loja, filial, etc). This is used to receive information of which store the purchase was made. It can be later used to create rules for points or filtering reports.

SalesPerson
object

A sales person is the person responsible for the sale. It can be used for filtering reports.

ForceGenerateCoupon
boolean | null

Normally this endpoint generates a redeem without a coupon. Setting this property to true forces to generate a coupon in the ecommerce plataform

Response

200 - application/json
ErrorMessage
string | null

Error message or description

ErrorCode
integer<int32> | null

Optional error code, if available

Result
object
HasError
boolean

If true the request had an error.