Create a promotion
curl --request POST \
--url https://api.fourthwall.com/open-api/v1.0/promotions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"discount": {
"percentage": 123,
"type": "PERCENTAGE",
"money": {
"value": 10,
"currency": "USD"
},
"freeShipping": true
},
"type": "MEMBERSHIPS_MULTI",
"codes": [
"<string>"
],
"subscriptionType": {
"type": "ALL"
},
"tiers": {
"type": "ALL"
}
}
'import requests
url = "https://api.fourthwall.com/open-api/v1.0/promotions"
payload = {
"code": "<string>",
"discount": {
"percentage": 123,
"type": "PERCENTAGE",
"money": {
"value": 10,
"currency": "USD"
},
"freeShipping": True
},
"type": "MEMBERSHIPS_MULTI",
"codes": ["<string>"],
"subscriptionType": { "type": "ALL" },
"tiers": { "type": "ALL" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: '<string>',
discount: {
percentage: 123,
type: 'PERCENTAGE',
money: {value: 10, currency: 'USD'},
freeShipping: true
},
type: 'MEMBERSHIPS_MULTI',
codes: ['<string>'],
subscriptionType: {type: 'ALL'},
tiers: {type: 'ALL'}
})
};
fetch('https://api.fourthwall.com/open-api/v1.0/promotions', 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.fourthwall.com/open-api/v1.0/promotions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'code' => '<string>',
'discount' => [
'percentage' => 123,
'type' => 'PERCENTAGE',
'money' => [
'value' => 10,
'currency' => 'USD'
],
'freeShipping' => true
],
'type' => 'MEMBERSHIPS_MULTI',
'codes' => [
'<string>'
],
'subscriptionType' => [
'type' => 'ALL'
],
'tiers' => [
'type' => 'ALL'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.fourthwall.com/open-api/v1.0/promotions"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"discount\": {\n \"percentage\": 123,\n \"type\": \"PERCENTAGE\",\n \"money\": {\n \"value\": 10,\n \"currency\": \"USD\"\n },\n \"freeShipping\": true\n },\n \"type\": \"MEMBERSHIPS_MULTI\",\n \"codes\": [\n \"<string>\"\n ],\n \"subscriptionType\": {\n \"type\": \"ALL\"\n },\n \"tiers\": {\n \"type\": \"ALL\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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.post("https://api.fourthwall.com/open-api/v1.0/promotions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\",\n \"discount\": {\n \"percentage\": 123,\n \"type\": \"PERCENTAGE\",\n \"money\": {\n \"value\": 10,\n \"currency\": \"USD\"\n },\n \"freeShipping\": true\n },\n \"type\": \"MEMBERSHIPS_MULTI\",\n \"codes\": [\n \"<string>\"\n ],\n \"subscriptionType\": {\n \"type\": \"ALL\"\n },\n \"tiers\": {\n \"type\": \"ALL\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fourthwall.com/open-api/v1.0/promotions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\",\n \"discount\": {\n \"percentage\": 123,\n \"type\": \"PERCENTAGE\",\n \"money\": {\n \"value\": 10,\n \"currency\": \"USD\"\n },\n \"freeShipping\": true\n },\n \"type\": \"MEMBERSHIPS_MULTI\",\n \"codes\": [\n \"<string>\"\n ],\n \"subscriptionType\": {\n \"type\": \"ALL\"\n },\n \"tiers\": {\n \"type\": \"ALL\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"code": "<string>",
"discount": {
"percentage": 123,
"type": "FLAT_RATE",
"money": {
"value": 10,
"currency": "USD"
},
"freeShipping": true,
"shippingOption": "Included"
},
"status": "Live",
"requirements": {
"minimumOrderValue": {
"value": 10,
"currency": "USD"
}
},
"usageCount": 123,
"limits": {
"maximumUsesNumber": 123,
"oneUsePerCustomer": true
},
"appliesTo": {
"type": "ENTIRE_ORDER"
},
"type": "SHOP_AUTO_APPLYING",
"title": "<string>"
}
Promotions
Create Promotion
Rate limit: 100 requests / 10 seconds per shop. See Rate limiting.
Creates a promotion
POST
/
open-api
/
v1.0
/
promotions
Create a promotion
curl --request POST \
--url https://api.fourthwall.com/open-api/v1.0/promotions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"discount": {
"percentage": 123,
"type": "PERCENTAGE",
"money": {
"value": 10,
"currency": "USD"
},
"freeShipping": true
},
"type": "MEMBERSHIPS_MULTI",
"codes": [
"<string>"
],
"subscriptionType": {
"type": "ALL"
},
"tiers": {
"type": "ALL"
}
}
'import requests
url = "https://api.fourthwall.com/open-api/v1.0/promotions"
payload = {
"code": "<string>",
"discount": {
"percentage": 123,
"type": "PERCENTAGE",
"money": {
"value": 10,
"currency": "USD"
},
"freeShipping": True
},
"type": "MEMBERSHIPS_MULTI",
"codes": ["<string>"],
"subscriptionType": { "type": "ALL" },
"tiers": { "type": "ALL" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: '<string>',
discount: {
percentage: 123,
type: 'PERCENTAGE',
money: {value: 10, currency: 'USD'},
freeShipping: true
},
type: 'MEMBERSHIPS_MULTI',
codes: ['<string>'],
subscriptionType: {type: 'ALL'},
tiers: {type: 'ALL'}
})
};
fetch('https://api.fourthwall.com/open-api/v1.0/promotions', 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.fourthwall.com/open-api/v1.0/promotions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'code' => '<string>',
'discount' => [
'percentage' => 123,
'type' => 'PERCENTAGE',
'money' => [
'value' => 10,
'currency' => 'USD'
],
'freeShipping' => true
],
'type' => 'MEMBERSHIPS_MULTI',
'codes' => [
'<string>'
],
'subscriptionType' => [
'type' => 'ALL'
],
'tiers' => [
'type' => 'ALL'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.fourthwall.com/open-api/v1.0/promotions"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"discount\": {\n \"percentage\": 123,\n \"type\": \"PERCENTAGE\",\n \"money\": {\n \"value\": 10,\n \"currency\": \"USD\"\n },\n \"freeShipping\": true\n },\n \"type\": \"MEMBERSHIPS_MULTI\",\n \"codes\": [\n \"<string>\"\n ],\n \"subscriptionType\": {\n \"type\": \"ALL\"\n },\n \"tiers\": {\n \"type\": \"ALL\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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.post("https://api.fourthwall.com/open-api/v1.0/promotions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\",\n \"discount\": {\n \"percentage\": 123,\n \"type\": \"PERCENTAGE\",\n \"money\": {\n \"value\": 10,\n \"currency\": \"USD\"\n },\n \"freeShipping\": true\n },\n \"type\": \"MEMBERSHIPS_MULTI\",\n \"codes\": [\n \"<string>\"\n ],\n \"subscriptionType\": {\n \"type\": \"ALL\"\n },\n \"tiers\": {\n \"type\": \"ALL\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fourthwall.com/open-api/v1.0/promotions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\",\n \"discount\": {\n \"percentage\": 123,\n \"type\": \"PERCENTAGE\",\n \"money\": {\n \"value\": 10,\n \"currency\": \"USD\"\n },\n \"freeShipping\": true\n },\n \"type\": \"MEMBERSHIPS_MULTI\",\n \"codes\": [\n \"<string>\"\n ],\n \"subscriptionType\": {\n \"type\": \"ALL\"\n },\n \"tiers\": {\n \"type\": \"ALL\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"code": "<string>",
"discount": {
"percentage": 123,
"type": "FLAT_RATE",
"money": {
"value": 10,
"currency": "USD"
},
"freeShipping": true,
"shippingOption": "Included"
},
"status": "Live",
"requirements": {
"minimumOrderValue": {
"value": 10,
"currency": "USD"
}
},
"usageCount": 123,
"limits": {
"maximumUsesNumber": 123,
"oneUsePerCustomer": true
},
"appliesTo": {
"type": "ENTIRE_ORDER"
},
"type": "SHOP_AUTO_APPLYING",
"title": "<string>"
}
OAuth scope:
promotions_writeAPI keys have full access to this endpoint.Authorizations
oauthbasicAuth
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
- MEMBERSHIPS_MULTI
- MEMBERSHIPS_MULTI
- MEMBERSHIPS_MULTI
- MEMBERSHIPS_MULTI
- MEMBERSHIPS_SINGLE
- SHOP_MULTI
- SHOP_SINGLE
- Percentage
- Percentage
- Percentage
- Percentage
Show child attributes
Show child attributes
Allowed value:
"MEMBERSHIPS_MULTI"Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- All Members
- All Members
- All Members
- Annual Members Only
- Monthly Members Only
Show child attributes
Show child attributes
- All Tiers
- All Tiers
- Selected Tiers
Show child attributes
Show child attributes
Response
OK
- Auto Applying Shop Promotion
- Auto Applying Shop Promotion
- Auto Applying Shop Promotion
- Auto Applying Shop Promotion
- Auto Applying Shop Promotion
- Multi Memberships Promotion
- Multi Shop Promotion
- Single Memberships Promotion
- Single Shop Promotion
- Fixed Amount
- Fixed Amount
- Fixed Amount
- Fixed Amount
- Free Products
- Free Shipping
- Percentage
- Fixed Amount
- Fixed Amount
- Fixed Amount
- Fixed Amount
- Free Products
- Free Shipping
- Percentage
- Fixed Amount
- Fixed Amount
- Fixed Amount
- Fixed Amount
- Free Products
- Free Shipping
- Percentage
- Fixed Amount
- Fixed Amount
- Fixed Amount
- Fixed Amount
- Free Products
- Free Shipping
- Percentage
Show child attributes
Show child attributes
Available options:
Live, Ended, Archived, AllUsed Show child attributes
Show child attributes
Show child attributes
Show child attributes
- Entire Order
- Entire Order
- Entire Order
- Entire Order With Excluded Products
- Selected Products
- Entire Order
- Entire Order
- Entire Order
- Entire Order With Excluded Products
- Selected Products
- Entire Order
- Entire Order
- Entire Order
- Entire Order With Excluded Products
- Selected Products
- Entire Order
- Entire Order
- Entire Order
- Entire Order With Excluded Products
- Selected Products
- Entire Order
- Entire Order
- Entire Order
- Entire Order With Excluded Products
- Selected Products
Show child attributes
Show child attributes
Allowed value:
"SHOP_AUTO_APPLYING"