curl --request PUT \
--url https://api-sandbox.appcharge.com/offering/offer/popup/{offerSKU} \
--header 'Content-Type: application/json' \
--header 'x-publisher-token: <x-publisher-token>' \
--data '
{
"publisherOfferId": "Test_Popup_New",
"name": "Test_Popup",
"displayName": "<string>",
"description": "Best offer ever.",
"offerUiId": "64a55b82e06998282d3d9b59",
"offerExternalUiId": "b9c1e7a3d1f8b2a4c6e5d8f3",
"dynamicOfferUi": {
"badges": [
{
"publisherBadgeId": "badge1",
"badge": {
"badgeId": "6548afb2ed7ec741ac8deeff",
"publisherBadgeId": "badge1",
"position": "right",
"name": "test_badge",
"type": "emblem",
"emblem": {
"imageUrl": "<string>"
},
"ribbon": {
"text": "<string>",
"backgroundColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
},
"textColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
}
}
}
}
],
"salePercentage": 123,
"salePercentageDisplayType": "<string>"
},
"active": "true",
"startOver": true,
"showAfter": "<string>",
"triggers": [
{
"type": "event",
"eventName": "purchase",
"every": 123,
"rules": [
{
"fieldName": "publisherOfferId",
"operator": "in",
"value": [
"<string>"
]
}
]
}
],
"segments": "NewUser",
"productsSequence": [
{
"playerAvailability": 2,
"index": 1,
"priceInUsdCents": 300,
"products": [
{
"quantity": 500,
"publisherProductId": "product1"
}
]
}
]
}
'import requests
url = "https://api-sandbox.appcharge.com/offering/offer/popup/{offerSKU}"
payload = {
"publisherOfferId": "Test_Popup_New",
"name": "Test_Popup",
"displayName": "<string>",
"description": "Best offer ever.",
"offerUiId": "64a55b82e06998282d3d9b59",
"offerExternalUiId": "b9c1e7a3d1f8b2a4c6e5d8f3",
"dynamicOfferUi": {
"badges": [
{
"publisherBadgeId": "badge1",
"badge": {
"badgeId": "6548afb2ed7ec741ac8deeff",
"publisherBadgeId": "badge1",
"position": "right",
"name": "test_badge",
"type": "emblem",
"emblem": { "imageUrl": "<string>" },
"ribbon": {
"text": "<string>",
"backgroundColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
},
"textColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
}
}
}
}
],
"salePercentage": 123,
"salePercentageDisplayType": "<string>"
},
"active": "true",
"startOver": True,
"showAfter": "<string>",
"triggers": [
{
"type": "event",
"eventName": "purchase",
"every": 123,
"rules": [
{
"fieldName": "publisherOfferId",
"operator": "in",
"value": ["<string>"]
}
]
}
],
"segments": "NewUser",
"productsSequence": [
{
"playerAvailability": 2,
"index": 1,
"priceInUsdCents": 300,
"products": [
{
"quantity": 500,
"publisherProductId": "product1"
}
]
}
]
}
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: 'Test_Popup_New',
name: 'Test_Popup',
displayName: '<string>',
description: 'Best offer ever.',
offerUiId: '64a55b82e06998282d3d9b59',
offerExternalUiId: 'b9c1e7a3d1f8b2a4c6e5d8f3',
dynamicOfferUi: {
badges: [
{
publisherBadgeId: 'badge1',
badge: {
badgeId: '6548afb2ed7ec741ac8deeff',
publisherBadgeId: 'badge1',
position: 'right',
name: 'test_badge',
type: 'emblem',
emblem: {imageUrl: '<string>'},
ribbon: {
text: '<string>',
backgroundColor: {gradientDirection: '<string>', colorOne: '<string>', colorTwo: '<string>'},
textColor: {gradientDirection: '<string>', colorOne: '<string>', colorTwo: '<string>'}
}
}
}
],
salePercentage: 123,
salePercentageDisplayType: '<string>'
},
active: 'true',
startOver: true,
showAfter: '<string>',
triggers: [
{
type: 'event',
eventName: 'purchase',
every: 123,
rules: [{fieldName: 'publisherOfferId', operator: 'in', value: ['<string>']}]
}
],
segments: 'NewUser',
productsSequence: [
{
playerAvailability: 2,
index: 1,
priceInUsdCents: 300,
products: [{quantity: 500, publisherProductId: 'product1'}]
}
]
})
};
fetch('https://api-sandbox.appcharge.com/offering/offer/popup/{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/popup/{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' => 'Test_Popup_New',
'name' => 'Test_Popup',
'displayName' => '<string>',
'description' => 'Best offer ever.',
'offerUiId' => '64a55b82e06998282d3d9b59',
'offerExternalUiId' => 'b9c1e7a3d1f8b2a4c6e5d8f3',
'dynamicOfferUi' => [
'badges' => [
[
'publisherBadgeId' => 'badge1',
'badge' => [
'badgeId' => '6548afb2ed7ec741ac8deeff',
'publisherBadgeId' => 'badge1',
'position' => 'right',
'name' => 'test_badge',
'type' => 'emblem',
'emblem' => [
'imageUrl' => '<string>'
],
'ribbon' => [
'text' => '<string>',
'backgroundColor' => [
'gradientDirection' => '<string>',
'colorOne' => '<string>',
'colorTwo' => '<string>'
],
'textColor' => [
'gradientDirection' => '<string>',
'colorOne' => '<string>',
'colorTwo' => '<string>'
]
]
]
]
],
'salePercentage' => 123,
'salePercentageDisplayType' => '<string>'
],
'active' => 'true',
'startOver' => true,
'showAfter' => '<string>',
'triggers' => [
[
'type' => 'event',
'eventName' => 'purchase',
'every' => 123,
'rules' => [
[
'fieldName' => 'publisherOfferId',
'operator' => 'in',
'value' => [
'<string>'
]
]
]
]
],
'segments' => 'NewUser',
'productsSequence' => [
[
'playerAvailability' => 2,
'index' => 1,
'priceInUsdCents' => 300,
'products' => [
[
'quantity' => 500,
'publisherProductId' => 'product1'
]
]
]
]
]),
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/popup/{offerSKU}"
payload := strings.NewReader("{\n \"publisherOfferId\": \"Test_Popup_New\",\n \"name\": \"Test_Popup\",\n \"displayName\": \"<string>\",\n \"description\": \"Best offer ever.\",\n \"offerUiId\": \"64a55b82e06998282d3d9b59\",\n \"offerExternalUiId\": \"b9c1e7a3d1f8b2a4c6e5d8f3\",\n \"dynamicOfferUi\": {\n \"badges\": [\n {\n \"publisherBadgeId\": \"badge1\",\n \"badge\": {\n \"badgeId\": \"6548afb2ed7ec741ac8deeff\",\n \"publisherBadgeId\": \"badge1\",\n \"position\": \"right\",\n \"name\": \"test_badge\",\n \"type\": \"emblem\",\n \"emblem\": {\n \"imageUrl\": \"<string>\"\n },\n \"ribbon\": {\n \"text\": \"<string>\",\n \"backgroundColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n },\n \"textColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n }\n }\n }\n }\n ],\n \"salePercentage\": 123,\n \"salePercentageDisplayType\": \"<string>\"\n },\n \"active\": \"true\",\n \"startOver\": true,\n \"showAfter\": \"<string>\",\n \"triggers\": [\n {\n \"type\": \"event\",\n \"eventName\": \"purchase\",\n \"every\": 123,\n \"rules\": [\n {\n \"fieldName\": \"publisherOfferId\",\n \"operator\": \"in\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"segments\": \"NewUser\",\n \"productsSequence\": [\n {\n \"playerAvailability\": 2,\n \"index\": 1,\n \"priceInUsdCents\": 300,\n \"products\": [\n {\n \"quantity\": 500,\n \"publisherProductId\": \"product1\"\n }\n ]\n }\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/popup/{offerSKU}")
.header("x-publisher-token", "<x-publisher-token>")
.header("Content-Type", "application/json")
.body("{\n \"publisherOfferId\": \"Test_Popup_New\",\n \"name\": \"Test_Popup\",\n \"displayName\": \"<string>\",\n \"description\": \"Best offer ever.\",\n \"offerUiId\": \"64a55b82e06998282d3d9b59\",\n \"offerExternalUiId\": \"b9c1e7a3d1f8b2a4c6e5d8f3\",\n \"dynamicOfferUi\": {\n \"badges\": [\n {\n \"publisherBadgeId\": \"badge1\",\n \"badge\": {\n \"badgeId\": \"6548afb2ed7ec741ac8deeff\",\n \"publisherBadgeId\": \"badge1\",\n \"position\": \"right\",\n \"name\": \"test_badge\",\n \"type\": \"emblem\",\n \"emblem\": {\n \"imageUrl\": \"<string>\"\n },\n \"ribbon\": {\n \"text\": \"<string>\",\n \"backgroundColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n },\n \"textColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n }\n }\n }\n }\n ],\n \"salePercentage\": 123,\n \"salePercentageDisplayType\": \"<string>\"\n },\n \"active\": \"true\",\n \"startOver\": true,\n \"showAfter\": \"<string>\",\n \"triggers\": [\n {\n \"type\": \"event\",\n \"eventName\": \"purchase\",\n \"every\": 123,\n \"rules\": [\n {\n \"fieldName\": \"publisherOfferId\",\n \"operator\": \"in\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"segments\": \"NewUser\",\n \"productsSequence\": [\n {\n \"playerAvailability\": 2,\n \"index\": 1,\n \"priceInUsdCents\": 300,\n \"products\": [\n {\n \"quantity\": 500,\n \"publisherProductId\": \"product1\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/offering/offer/popup/{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\": \"Test_Popup_New\",\n \"name\": \"Test_Popup\",\n \"displayName\": \"<string>\",\n \"description\": \"Best offer ever.\",\n \"offerUiId\": \"64a55b82e06998282d3d9b59\",\n \"offerExternalUiId\": \"b9c1e7a3d1f8b2a4c6e5d8f3\",\n \"dynamicOfferUi\": {\n \"badges\": [\n {\n \"publisherBadgeId\": \"badge1\",\n \"badge\": {\n \"badgeId\": \"6548afb2ed7ec741ac8deeff\",\n \"publisherBadgeId\": \"badge1\",\n \"position\": \"right\",\n \"name\": \"test_badge\",\n \"type\": \"emblem\",\n \"emblem\": {\n \"imageUrl\": \"<string>\"\n },\n \"ribbon\": {\n \"text\": \"<string>\",\n \"backgroundColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n },\n \"textColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n }\n }\n }\n }\n ],\n \"salePercentage\": 123,\n \"salePercentageDisplayType\": \"<string>\"\n },\n \"active\": \"true\",\n \"startOver\": true,\n \"showAfter\": \"<string>\",\n \"triggers\": [\n {\n \"type\": \"event\",\n \"eventName\": \"purchase\",\n \"every\": 123,\n \"rules\": [\n {\n \"fieldName\": \"publisherOfferId\",\n \"operator\": \"in\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"segments\": \"NewUser\",\n \"productsSequence\": [\n {\n \"playerAvailability\": 2,\n \"index\": 1,\n \"priceInUsdCents\": 300,\n \"products\": [\n {\n \"quantity\": 500,\n \"publisherProductId\": \"product1\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"offerId": "655dc8a546822b3e7586b7b7",
"publisherOfferId": "offer1",
"name": "Test_popup",
"displayName": "<string>",
"description": "N/A",
"type": "Popup",
"createdBy": "API",
"offerUi": {
"offerUiId": "6548afb2ed7ec741ac8dee3a",
"externalId": "<string>",
"active": "true",
"offerUiType": "Popup",
"name": "test_offerUi",
"description": "Best Offer UI",
"backgroundImage": "https://media.appcharge.com/defaults/background.png",
"specialOffer": {
"templateType": "Single",
"presentOfferEndTimer": "false",
"title": "",
"fontSize": 18,
"fontWeight": "normal",
"fontColor": {
"colorOne": "black",
"colorTwo": "black",
"direction": "to right"
},
"backgroundColor": {
"colorOne": "black",
"colorTwo": "black",
"direction": "to right"
}
}
},
"dynamicOfferUi": {
"badges": [
{
"publisherBadgeId": "badge1",
"badge": {
"badgeId": "6548afb2ed7ec741ac8deeff",
"publisherBadgeId": "badge1",
"position": "right",
"name": "test_badge",
"type": "emblem",
"emblem": {
"imageUrl": "<string>"
},
"ribbon": {
"text": "<string>",
"backgroundColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
},
"textColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
}
}
}
}
],
"salePercentage": 123,
"salePercentageDisplayType": "<string>"
},
"active": "true",
"coolDownInHours": "1",
"segments": "[NewUser]",
"productsSequence": [
{
"index": 1,
"playerAvailability": 2,
"priceInUsdCents": 300,
"products": [
{
"quantity": 500,
"product": {
"publisherProductId": "product1",
"name": "test_product",
"textFontColorHex": "#FFFF",
"type": "Time",
"prefix": "100",
"suffix": "500",
"priority": "Main",
"images": [
{
"type": "<string>",
"url": "<string>"
}
],
"createdAt": "2023-07-05T12:01:06.113Z",
"updatedAt": "2023-07-05T12:01:06.113Z",
"productId": "655dc8a546822b3e7586b7b7"
}
}
]
}
],
"startOver": true,
"priority": 123,
"showAfter": "<string>",
"triggers": [
{
"type": "<string>",
"eventName": "<string>",
"every": 123,
"rules": [
"<unknown>"
]
}
],
"createdAt": "2023-07-05T12:01:06.113Z",
"updatedAt": "2023-07-05T12:01:06.113Z"
}Update Popup
curl --request PUT \
--url https://api-sandbox.appcharge.com/offering/offer/popup/{offerSKU} \
--header 'Content-Type: application/json' \
--header 'x-publisher-token: <x-publisher-token>' \
--data '
{
"publisherOfferId": "Test_Popup_New",
"name": "Test_Popup",
"displayName": "<string>",
"description": "Best offer ever.",
"offerUiId": "64a55b82e06998282d3d9b59",
"offerExternalUiId": "b9c1e7a3d1f8b2a4c6e5d8f3",
"dynamicOfferUi": {
"badges": [
{
"publisherBadgeId": "badge1",
"badge": {
"badgeId": "6548afb2ed7ec741ac8deeff",
"publisherBadgeId": "badge1",
"position": "right",
"name": "test_badge",
"type": "emblem",
"emblem": {
"imageUrl": "<string>"
},
"ribbon": {
"text": "<string>",
"backgroundColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
},
"textColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
}
}
}
}
],
"salePercentage": 123,
"salePercentageDisplayType": "<string>"
},
"active": "true",
"startOver": true,
"showAfter": "<string>",
"triggers": [
{
"type": "event",
"eventName": "purchase",
"every": 123,
"rules": [
{
"fieldName": "publisherOfferId",
"operator": "in",
"value": [
"<string>"
]
}
]
}
],
"segments": "NewUser",
"productsSequence": [
{
"playerAvailability": 2,
"index": 1,
"priceInUsdCents": 300,
"products": [
{
"quantity": 500,
"publisherProductId": "product1"
}
]
}
]
}
'import requests
url = "https://api-sandbox.appcharge.com/offering/offer/popup/{offerSKU}"
payload = {
"publisherOfferId": "Test_Popup_New",
"name": "Test_Popup",
"displayName": "<string>",
"description": "Best offer ever.",
"offerUiId": "64a55b82e06998282d3d9b59",
"offerExternalUiId": "b9c1e7a3d1f8b2a4c6e5d8f3",
"dynamicOfferUi": {
"badges": [
{
"publisherBadgeId": "badge1",
"badge": {
"badgeId": "6548afb2ed7ec741ac8deeff",
"publisherBadgeId": "badge1",
"position": "right",
"name": "test_badge",
"type": "emblem",
"emblem": { "imageUrl": "<string>" },
"ribbon": {
"text": "<string>",
"backgroundColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
},
"textColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
}
}
}
}
],
"salePercentage": 123,
"salePercentageDisplayType": "<string>"
},
"active": "true",
"startOver": True,
"showAfter": "<string>",
"triggers": [
{
"type": "event",
"eventName": "purchase",
"every": 123,
"rules": [
{
"fieldName": "publisherOfferId",
"operator": "in",
"value": ["<string>"]
}
]
}
],
"segments": "NewUser",
"productsSequence": [
{
"playerAvailability": 2,
"index": 1,
"priceInUsdCents": 300,
"products": [
{
"quantity": 500,
"publisherProductId": "product1"
}
]
}
]
}
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: 'Test_Popup_New',
name: 'Test_Popup',
displayName: '<string>',
description: 'Best offer ever.',
offerUiId: '64a55b82e06998282d3d9b59',
offerExternalUiId: 'b9c1e7a3d1f8b2a4c6e5d8f3',
dynamicOfferUi: {
badges: [
{
publisherBadgeId: 'badge1',
badge: {
badgeId: '6548afb2ed7ec741ac8deeff',
publisherBadgeId: 'badge1',
position: 'right',
name: 'test_badge',
type: 'emblem',
emblem: {imageUrl: '<string>'},
ribbon: {
text: '<string>',
backgroundColor: {gradientDirection: '<string>', colorOne: '<string>', colorTwo: '<string>'},
textColor: {gradientDirection: '<string>', colorOne: '<string>', colorTwo: '<string>'}
}
}
}
],
salePercentage: 123,
salePercentageDisplayType: '<string>'
},
active: 'true',
startOver: true,
showAfter: '<string>',
triggers: [
{
type: 'event',
eventName: 'purchase',
every: 123,
rules: [{fieldName: 'publisherOfferId', operator: 'in', value: ['<string>']}]
}
],
segments: 'NewUser',
productsSequence: [
{
playerAvailability: 2,
index: 1,
priceInUsdCents: 300,
products: [{quantity: 500, publisherProductId: 'product1'}]
}
]
})
};
fetch('https://api-sandbox.appcharge.com/offering/offer/popup/{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/popup/{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' => 'Test_Popup_New',
'name' => 'Test_Popup',
'displayName' => '<string>',
'description' => 'Best offer ever.',
'offerUiId' => '64a55b82e06998282d3d9b59',
'offerExternalUiId' => 'b9c1e7a3d1f8b2a4c6e5d8f3',
'dynamicOfferUi' => [
'badges' => [
[
'publisherBadgeId' => 'badge1',
'badge' => [
'badgeId' => '6548afb2ed7ec741ac8deeff',
'publisherBadgeId' => 'badge1',
'position' => 'right',
'name' => 'test_badge',
'type' => 'emblem',
'emblem' => [
'imageUrl' => '<string>'
],
'ribbon' => [
'text' => '<string>',
'backgroundColor' => [
'gradientDirection' => '<string>',
'colorOne' => '<string>',
'colorTwo' => '<string>'
],
'textColor' => [
'gradientDirection' => '<string>',
'colorOne' => '<string>',
'colorTwo' => '<string>'
]
]
]
]
],
'salePercentage' => 123,
'salePercentageDisplayType' => '<string>'
],
'active' => 'true',
'startOver' => true,
'showAfter' => '<string>',
'triggers' => [
[
'type' => 'event',
'eventName' => 'purchase',
'every' => 123,
'rules' => [
[
'fieldName' => 'publisherOfferId',
'operator' => 'in',
'value' => [
'<string>'
]
]
]
]
],
'segments' => 'NewUser',
'productsSequence' => [
[
'playerAvailability' => 2,
'index' => 1,
'priceInUsdCents' => 300,
'products' => [
[
'quantity' => 500,
'publisherProductId' => 'product1'
]
]
]
]
]),
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/popup/{offerSKU}"
payload := strings.NewReader("{\n \"publisherOfferId\": \"Test_Popup_New\",\n \"name\": \"Test_Popup\",\n \"displayName\": \"<string>\",\n \"description\": \"Best offer ever.\",\n \"offerUiId\": \"64a55b82e06998282d3d9b59\",\n \"offerExternalUiId\": \"b9c1e7a3d1f8b2a4c6e5d8f3\",\n \"dynamicOfferUi\": {\n \"badges\": [\n {\n \"publisherBadgeId\": \"badge1\",\n \"badge\": {\n \"badgeId\": \"6548afb2ed7ec741ac8deeff\",\n \"publisherBadgeId\": \"badge1\",\n \"position\": \"right\",\n \"name\": \"test_badge\",\n \"type\": \"emblem\",\n \"emblem\": {\n \"imageUrl\": \"<string>\"\n },\n \"ribbon\": {\n \"text\": \"<string>\",\n \"backgroundColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n },\n \"textColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n }\n }\n }\n }\n ],\n \"salePercentage\": 123,\n \"salePercentageDisplayType\": \"<string>\"\n },\n \"active\": \"true\",\n \"startOver\": true,\n \"showAfter\": \"<string>\",\n \"triggers\": [\n {\n \"type\": \"event\",\n \"eventName\": \"purchase\",\n \"every\": 123,\n \"rules\": [\n {\n \"fieldName\": \"publisherOfferId\",\n \"operator\": \"in\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"segments\": \"NewUser\",\n \"productsSequence\": [\n {\n \"playerAvailability\": 2,\n \"index\": 1,\n \"priceInUsdCents\": 300,\n \"products\": [\n {\n \"quantity\": 500,\n \"publisherProductId\": \"product1\"\n }\n ]\n }\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/popup/{offerSKU}")
.header("x-publisher-token", "<x-publisher-token>")
.header("Content-Type", "application/json")
.body("{\n \"publisherOfferId\": \"Test_Popup_New\",\n \"name\": \"Test_Popup\",\n \"displayName\": \"<string>\",\n \"description\": \"Best offer ever.\",\n \"offerUiId\": \"64a55b82e06998282d3d9b59\",\n \"offerExternalUiId\": \"b9c1e7a3d1f8b2a4c6e5d8f3\",\n \"dynamicOfferUi\": {\n \"badges\": [\n {\n \"publisherBadgeId\": \"badge1\",\n \"badge\": {\n \"badgeId\": \"6548afb2ed7ec741ac8deeff\",\n \"publisherBadgeId\": \"badge1\",\n \"position\": \"right\",\n \"name\": \"test_badge\",\n \"type\": \"emblem\",\n \"emblem\": {\n \"imageUrl\": \"<string>\"\n },\n \"ribbon\": {\n \"text\": \"<string>\",\n \"backgroundColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n },\n \"textColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n }\n }\n }\n }\n ],\n \"salePercentage\": 123,\n \"salePercentageDisplayType\": \"<string>\"\n },\n \"active\": \"true\",\n \"startOver\": true,\n \"showAfter\": \"<string>\",\n \"triggers\": [\n {\n \"type\": \"event\",\n \"eventName\": \"purchase\",\n \"every\": 123,\n \"rules\": [\n {\n \"fieldName\": \"publisherOfferId\",\n \"operator\": \"in\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"segments\": \"NewUser\",\n \"productsSequence\": [\n {\n \"playerAvailability\": 2,\n \"index\": 1,\n \"priceInUsdCents\": 300,\n \"products\": [\n {\n \"quantity\": 500,\n \"publisherProductId\": \"product1\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/offering/offer/popup/{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\": \"Test_Popup_New\",\n \"name\": \"Test_Popup\",\n \"displayName\": \"<string>\",\n \"description\": \"Best offer ever.\",\n \"offerUiId\": \"64a55b82e06998282d3d9b59\",\n \"offerExternalUiId\": \"b9c1e7a3d1f8b2a4c6e5d8f3\",\n \"dynamicOfferUi\": {\n \"badges\": [\n {\n \"publisherBadgeId\": \"badge1\",\n \"badge\": {\n \"badgeId\": \"6548afb2ed7ec741ac8deeff\",\n \"publisherBadgeId\": \"badge1\",\n \"position\": \"right\",\n \"name\": \"test_badge\",\n \"type\": \"emblem\",\n \"emblem\": {\n \"imageUrl\": \"<string>\"\n },\n \"ribbon\": {\n \"text\": \"<string>\",\n \"backgroundColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n },\n \"textColor\": {\n \"gradientDirection\": \"<string>\",\n \"colorOne\": \"<string>\",\n \"colorTwo\": \"<string>\"\n }\n }\n }\n }\n ],\n \"salePercentage\": 123,\n \"salePercentageDisplayType\": \"<string>\"\n },\n \"active\": \"true\",\n \"startOver\": true,\n \"showAfter\": \"<string>\",\n \"triggers\": [\n {\n \"type\": \"event\",\n \"eventName\": \"purchase\",\n \"every\": 123,\n \"rules\": [\n {\n \"fieldName\": \"publisherOfferId\",\n \"operator\": \"in\",\n \"value\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"segments\": \"NewUser\",\n \"productsSequence\": [\n {\n \"playerAvailability\": 2,\n \"index\": 1,\n \"priceInUsdCents\": 300,\n \"products\": [\n {\n \"quantity\": 500,\n \"publisherProductId\": \"product1\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"offerId": "655dc8a546822b3e7586b7b7",
"publisherOfferId": "offer1",
"name": "Test_popup",
"displayName": "<string>",
"description": "N/A",
"type": "Popup",
"createdBy": "API",
"offerUi": {
"offerUiId": "6548afb2ed7ec741ac8dee3a",
"externalId": "<string>",
"active": "true",
"offerUiType": "Popup",
"name": "test_offerUi",
"description": "Best Offer UI",
"backgroundImage": "https://media.appcharge.com/defaults/background.png",
"specialOffer": {
"templateType": "Single",
"presentOfferEndTimer": "false",
"title": "",
"fontSize": 18,
"fontWeight": "normal",
"fontColor": {
"colorOne": "black",
"colorTwo": "black",
"direction": "to right"
},
"backgroundColor": {
"colorOne": "black",
"colorTwo": "black",
"direction": "to right"
}
}
},
"dynamicOfferUi": {
"badges": [
{
"publisherBadgeId": "badge1",
"badge": {
"badgeId": "6548afb2ed7ec741ac8deeff",
"publisherBadgeId": "badge1",
"position": "right",
"name": "test_badge",
"type": "emblem",
"emblem": {
"imageUrl": "<string>"
},
"ribbon": {
"text": "<string>",
"backgroundColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
},
"textColor": {
"gradientDirection": "<string>",
"colorOne": "<string>",
"colorTwo": "<string>"
}
}
}
}
],
"salePercentage": 123,
"salePercentageDisplayType": "<string>"
},
"active": "true",
"coolDownInHours": "1",
"segments": "[NewUser]",
"productsSequence": [
{
"index": 1,
"playerAvailability": 2,
"priceInUsdCents": 300,
"products": [
{
"quantity": 500,
"product": {
"publisherProductId": "product1",
"name": "test_product",
"textFontColorHex": "#FFFF",
"type": "Time",
"prefix": "100",
"suffix": "500",
"priority": "Main",
"images": [
{
"type": "<string>",
"url": "<string>"
}
],
"createdAt": "2023-07-05T12:01:06.113Z",
"updatedAt": "2023-07-05T12:01:06.113Z",
"productId": "655dc8a546822b3e7586b7b7"
}
}
]
}
],
"startOver": true,
"priority": 123,
"showAfter": "<string>",
"triggers": [
{
"type": "<string>",
"eventName": "<string>",
"every": 123,
"rules": [
"<unknown>"
]
}
],
"createdAt": "2023-07-05T12:01:06.113Z",
"updatedAt": "2023-07-05T12:01:06.113Z"
}Headers
The publisher token
Path Parameters
The publisher Id of the offer.
Body
The new Id of the offer.
"Test_Popup_New"
The name of the offer. At least 3 letters.
"Test_Popup"
The display name of the offer. If not specified, the offer name will be used.
The description of the offer.
"Best offer ever."
The Internal ID for the Offer UI. The Offer UI is responsible to add UI elements to the offers such as background image and title. Once you create the Offer UI using the dashboard, you will get the internal ID. This must correspond with the type of offer you configure. In this case "Popup".
"64a55b82e06998282d3d9b59"
The offer UI ID as configured by the publisher. If offerExternalUiId is provided, then offerUiId will not be required.
"b9c1e7a3d1f8b2a4c6e5d8f3"
UI element that can be configured dynamically.
Show child attributes
Show child attributes
Is the offer active? true/false.
"true"
Popup will repeat itself.
Optional values: "login", "purchase"
An array of objects specifying the conditions under which the popup should be triggered.
Show child attributes
Show child attributes
The Ids of the player segments to be used in the segmentation algorithm. for example: [“NewUser”, “BigSpender”].
"NewUser"
Relevant only for rolling offers, for any other offer (store tile, single promotion) report all products under sequence ‘1’
Show child attributes
Show child attributes
Response
Update Offer by Id
The Id of the offer.
"655dc8a546822b3e7586b7b7"
The offer publisher Id.
"offer1"
The name of the offer.
"Test_popup"
The display name of the offer. If not specified, the offer name will be used.
The description of the offer. Conditionally returned.
"N/A"
The type of the offer. In this case "Popup"
"Popup"
The platform which the offer was created from (Dashboard, API)
"API"
Show child attributes
Show child attributes
UI element that can be configured dynamically.
Show child attributes
Show child attributes
Is the offer active? true/false.
"true"
Used for cooldown between orders. DEPRECATION WARNING: This field will be removed in future releases.
"1"
The Ids of the player segments to be used in the segmentation algorithm. for example: [“NewUser”, “BigSpender”].
"[NewUser]"
The products sequense containing the sets of products.
Show child attributes
Show child attributes
Will the popup repeat itself?
The priority of the PopUp.
Either "login" or "purchase"
An array of objects specifying the conditions under which the popup should be triggered.
Show child attributes
Show child attributes
the time when the offer was created, in UTC.
"2023-07-05T12:01:06.113Z"
the time when the offer was updated, in UTC.
"2023-07-05T12:01:06.113Z"
Was this page helpful?
