API: PUT Offer
Altering an existing offer's details
Overview
For auditing purposes, most attributes of an offer cannot be updated once submitted to Banyan. However, the expiration date can be extended to a date in the future or ended early. When using this PUT URL to bring the expiration date forward, the date must be greater than current day + 1
.
Developers, please see our API Reference for an interactive example.
URL
api.banyan.com/rest/v1/offer/{{byn_offer_id}} where byn_offer_id
is the offer you wish to update.
Body
As stated above, the only thing to update is the the expiration date.
Name | Description | Type | Required | Notes |
---|---|---|---|---|
expiration_ts | When the offer ends | RFC3339 | Yes | Should be sent in UTC. If you want the offer to extend for a long period of time, choose a date far out in the future. |
Example:
{
"expiration_ts": "2022-12-20T00:00:00Z"
}
Response
As you can see, the response is the full offer detail again, and contains the updated expiration date if a successful call was made.
Example:
{
"data": [
{
"id": "1b0b4b5d-b900-502d-b308-fd16e1d2b45e",
"publisher_offer_id": "72b5f9c4-2462-5398-b453-71f4040425d9",
"campaign_id": "86c6f660-8e9a-533a-b3d8-679a9a245095",
"return_receipt_detail": true,
"byn_advertiser_id": 106,
"byn_publisher_id": 106,
"amount_back_limit": "10",
"amount_back_per_dollar": "0.2",
"amount_back_type": "DOLLAR",
"start_ts": "2022-07-05T15:05:32Z",
"expiration_ts": "2022-12-20T00:00:00Z",
"offer_criteria": {
"order_types": [
"in_store"
],
"incl_tags": [
"category_description:|:BABY CARE"
],
"excl_tags": [
"brand:|:Pampers"
],
"incl_sku": [],
"excl_sku": [],
"amount_threshold": "50",
"repeat_amount": 2
},
"created_ts": "2022-12-09T02:41:23.996205Z",
"updated_ts": "2022-12-09T02:42:19.037003Z"
}
],
"errors": []
}
Errors
Example of an attempt to change the expiration date to a date not in the future:
{
"data": [],
"errors": [
"expiration_ts must be at least one day after current time"
]
}
Error Code | Description | Examples |
---|---|---|
400 | Bad Request | 1. expiration_ts must be at least one day after current time |
403 | Forbidden | |
404 | Not Found |
Updated over 1 year ago