cURL
curl --request PUT \
--url https://api-sandbox.appcharge.com/offering/offer/{offerSKU} \
--header 'Content-Type: application/json' \
--header 'x-publisher-token: <x-publisher-token>' \
--data '
{
"publisherOfferId": "offer1",
"name": "Updated_Bundle",
"type": "Bundle",
"active": true,
"segments": [
"BigSpender"
],
"productsSequence": [
{
"index": 1,
"priceInUsdCents": 500,
"products": []
}
],
"priceDiscount": {
"priceBeforeDiscount": 1500,
"discount": 20,
"type": "fixed_amount"
}
}
'import requests
url = "https://api-sandbox.appcharge.com/offering/offer/{offerSKU}"
payload = {
"publisherOfferId": "offer1",
"name": "Updated_Bundle",
"type": "Bundle",
"active": True,
"segments": ["BigSpender"],
"productsSequence": [
{
"index": 1,
"priceInUsdCents": 500,
"products": []
}
],
"priceDiscount": {
"priceBeforeDiscount": 1500,
"discount": 20,
"type": "fixed_amount"
}
}
headers = {
"x-publisher-token": "<x-publisher-token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-publisher-token': '<x-publisher-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
publisherOfferId: 'offer1',
name: 'Updated_Bundle',
type: 'Bundle',
active: true,
segments: ['BigSpender'],
productsSequence: [{index: 1, priceInUsdCents: 500, products: []}],
priceDiscount: {priceBeforeDiscount: 1500, discount: 20, type: 'fixed_amount'}
})
};
fetch('https://api-sandbox.appcharge.com/offering/offer/{offerSKU}', 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-sandbox.appcharge.com/offering/offer/{offerSKU}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'publisherOfferId' => 'offer1',
'name' => 'Updated_Bundle',
'type' => 'Bundle',
'active' => true,
'segments' => [
'BigSpender'
],
'productsSequence' => [
[
'index' => 1,
'priceInUsdCents' => 500,
'products' => [
]
]
],
'priceDiscount' => [
'priceBeforeDiscount' => 1500,
'discount' => 20,
'type' => 'fixed_amount'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-publisher-token: <x-publisher-token>"
],
]);
$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-sandbox.appcharge.com/offering/offer/{offerSKU}"
payload := strings.NewReader("{\n \"publisherOfferId\": \"offer1\",\n \"name\": \"Updated_Bundle\",\n \"type\": \"Bundle\",\n \"active\": true,\n \"segments\": [\n \"BigSpender\"\n ],\n \"productsSequence\": [\n {\n \"index\": 1,\n \"priceInUsdCents\": 500,\n \"products\": []\n }\n ],\n \"priceDiscount\": {\n \"priceBeforeDiscount\": 1500,\n \"discount\": 20,\n \"type\": \"fixed_amount\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-publisher-token", "<x-publisher-token>")
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.put("https://api-sandbox.appcharge.com/offering/offer/{offerSKU}")
.header("x-publisher-token", "<x-publisher-token>")
.header("Content-Type", "application/json")
.body("{\n \"publisherOfferId\": \"offer1\",\n \"name\": \"Updated_Bundle\",\n \"type\": \"Bundle\",\n \"active\": true,\n \"segments\": [\n \"BigSpender\"\n ],\n \"productsSequence\": [\n {\n \"index\": 1,\n \"priceInUsdCents\": 500,\n \"products\": []\n }\n ],\n \"priceDiscount\": {\n \"priceBeforeDiscount\": 1500,\n \"discount\": 20,\n \"type\": \"fixed_amount\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/offering/offer/{offerSKU}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-publisher-token"] = '<x-publisher-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"publisherOfferId\": \"offer1\",\n \"name\": \"Updated_Bundle\",\n \"type\": \"Bundle\",\n \"active\": true,\n \"segments\": [\n \"BigSpender\"\n ],\n \"productsSequence\": [\n {\n \"index\": 1,\n \"priceInUsdCents\": 500,\n \"products\": []\n }\n ],\n \"priceDiscount\": {\n \"priceBeforeDiscount\": 1500,\n \"discount\": 20,\n \"type\": \"fixed_amount\"\n }\n}"
response = http.request(request)
puts response.read_body{
"offerId": "<string>",
"publisherOfferId": "<string>",
"name": "<string>",
"displayName": "<string>",
"description": "<string>",
"type": "<string>",
"createdBy": "<string>",
"offerUi": {
"offerUiId": "<string>",
"externalId": "<string>",
"active": true,
"offerUiType": "<string>",
"name": "<string>",
"description": "<string>",
"backgroundImage": "<string>",
"specialOffer": {
"templateType": "<string>",
"presentOfferEndTimer": true,
"title": "<string>",
"fontSize": 123,
"fontWeight": "<string>",
"fontColor": {
"colorOne": "<string>",
"colorTwo": "<string>",
"direction": "<string>"
},
"backgroundColor": {
"colorOne": "<string>",
"colorTwo": "<string>",
"direction": "<string>"
}
}
},
"dynamicOfferUi": {
"badges": [
{
"publisherBadgeId": "<string>",
"position": "<string>"
}
],
"salePercentage": 123,
"salePercentageDisplayType": "percentage"
},
"active": true,
"segments": [
"<string>"
],
"productsSequence": [
{
"index": 123,
"playerAvailability": 123,
"priceInUsdCents": 123,
"products": [
{
"quantity": 123,
"product": {
"publisherProductId": "<string>",
"name": "<string>",
"textFontColorHex": "<string>",
"type": "<string>",
"prefix": "<string>",
"suffix": "<string>",
"priority": "<string>",
"images": [
{
"type": "<string>",
"url": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"productId": "<string>"
}
}
]
}
],
"startOver": true,
"priority": 123,
"showAfter": "<string>",
"triggers": [
{
"type": "<string>",
"eventName": "<string>",
"every": 123,
"rules": [
"<unknown>"
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Offers V1 API
Update Offer
PUT
/
offering
/
offer
/
{offerSKU}
cURL
curl --request PUT \
--url https://api-sandbox.appcharge.com/offering/offer/{offerSKU} \
--header 'Content-Type: application/json' \
--header 'x-publisher-token: <x-publisher-token>' \
--data '
{
"publisherOfferId": "offer1",
"name": "Updated_Bundle",
"type": "Bundle",
"active": true,
"segments": [
"BigSpender"
],
"productsSequence": [
{
"index": 1,
"priceInUsdCents": 500,
"products": []
}
],
"priceDiscount": {
"priceBeforeDiscount": 1500,
"discount": 20,
"type": "fixed_amount"
}
}
'import requests
url = "https://api-sandbox.appcharge.com/offering/offer/{offerSKU}"
payload = {
"publisherOfferId": "offer1",
"name": "Updated_Bundle",
"type": "Bundle",
"active": True,
"segments": ["BigSpender"],
"productsSequence": [
{
"index": 1,
"priceInUsdCents": 500,
"products": []
}
],
"priceDiscount": {
"priceBeforeDiscount": 1500,
"discount": 20,
"type": "fixed_amount"
}
}
headers = {
"x-publisher-token": "<x-publisher-token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-publisher-token': '<x-publisher-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
publisherOfferId: 'offer1',
name: 'Updated_Bundle',
type: 'Bundle',
active: true,
segments: ['BigSpender'],
productsSequence: [{index: 1, priceInUsdCents: 500, products: []}],
priceDiscount: {priceBeforeDiscount: 1500, discount: 20, type: 'fixed_amount'}
})
};
fetch('https://api-sandbox.appcharge.com/offering/offer/{offerSKU}', 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-sandbox.appcharge.com/offering/offer/{offerSKU}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'publisherOfferId' => 'offer1',
'name' => 'Updated_Bundle',
'type' => 'Bundle',
'active' => true,
'segments' => [
'BigSpender'
],
'productsSequence' => [
[
'index' => 1,
'priceInUsdCents' => 500,
'products' => [
]
]
],
'priceDiscount' => [
'priceBeforeDiscount' => 1500,
'discount' => 20,
'type' => 'fixed_amount'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-publisher-token: <x-publisher-token>"
],
]);
$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-sandbox.appcharge.com/offering/offer/{offerSKU}"
payload := strings.NewReader("{\n \"publisherOfferId\": \"offer1\",\n \"name\": \"Updated_Bundle\",\n \"type\": \"Bundle\",\n \"active\": true,\n \"segments\": [\n \"BigSpender\"\n ],\n \"productsSequence\": [\n {\n \"index\": 1,\n \"priceInUsdCents\": 500,\n \"products\": []\n }\n ],\n \"priceDiscount\": {\n \"priceBeforeDiscount\": 1500,\n \"discount\": 20,\n \"type\": \"fixed_amount\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-publisher-token", "<x-publisher-token>")
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.put("https://api-sandbox.appcharge.com/offering/offer/{offerSKU}")
.header("x-publisher-token", "<x-publisher-token>")
.header("Content-Type", "application/json")
.body("{\n \"publisherOfferId\": \"offer1\",\n \"name\": \"Updated_Bundle\",\n \"type\": \"Bundle\",\n \"active\": true,\n \"segments\": [\n \"BigSpender\"\n ],\n \"productsSequence\": [\n {\n \"index\": 1,\n \"priceInUsdCents\": 500,\n \"products\": []\n }\n ],\n \"priceDiscount\": {\n \"priceBeforeDiscount\": 1500,\n \"discount\": 20,\n \"type\": \"fixed_amount\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/offering/offer/{offerSKU}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-publisher-token"] = '<x-publisher-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"publisherOfferId\": \"offer1\",\n \"name\": \"Updated_Bundle\",\n \"type\": \"Bundle\",\n \"active\": true,\n \"segments\": [\n \"BigSpender\"\n ],\n \"productsSequence\": [\n {\n \"index\": 1,\n \"priceInUsdCents\": 500,\n \"products\": []\n }\n ],\n \"priceDiscount\": {\n \"priceBeforeDiscount\": 1500,\n \"discount\": 20,\n \"type\": \"fixed_amount\"\n }\n}"
response = http.request(request)
puts response.read_body{
"offerId": "<string>",
"publisherOfferId": "<string>",
"name": "<string>",
"displayName": "<string>",
"description": "<string>",
"type": "<string>",
"createdBy": "<string>",
"offerUi": {
"offerUiId": "<string>",
"externalId": "<string>",
"active": true,
"offerUiType": "<string>",
"name": "<string>",
"description": "<string>",
"backgroundImage": "<string>",
"specialOffer": {
"templateType": "<string>",
"presentOfferEndTimer": true,
"title": "<string>",
"fontSize": 123,
"fontWeight": "<string>",
"fontColor": {
"colorOne": "<string>",
"colorTwo": "<string>",
"direction": "<string>"
},
"backgroundColor": {
"colorOne": "<string>",
"colorTwo": "<string>",
"direction": "<string>"
}
}
},
"dynamicOfferUi": {
"badges": [
{
"publisherBadgeId": "<string>",
"position": "<string>"
}
],
"salePercentage": 123,
"salePercentageDisplayType": "percentage"
},
"active": true,
"segments": [
"<string>"
],
"productsSequence": [
{
"index": 123,
"playerAvailability": 123,
"priceInUsdCents": 123,
"products": [
{
"quantity": 123,
"product": {
"publisherProductId": "<string>",
"name": "<string>",
"textFontColorHex": "<string>",
"type": "<string>",
"prefix": "<string>",
"suffix": "<string>",
"priority": "<string>",
"images": [
{
"type": "<string>",
"url": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"productId": "<string>"
}
}
]
}
],
"startOver": true,
"priority": 123,
"showAfter": "<string>",
"triggers": [
{
"type": "<string>",
"eventName": "<string>",
"every": 123,
"rules": [
"<unknown>"
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Headers
The publisher token
Path Parameters
The publisher Id of the offer.
Body
application/json
The publisher offer Id
The name of the offer (at least 3 letters)
The type of the offer - Bundle, SpecialOffer
Whether the offer is active
Show child attributes
Show child attributes
If not specified, the offer name will be used
The description of the offer (conditionally returned)
Internal ID for the Offer UI (required if offerExternalUiId not provided)
The offer UI ID as configured by the publisher (if provided, offerUiId is not required)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Update Offer by Id
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I
