curl --request POST \
--url https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive', 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.exowpee.com/v1/discount/campaigns/{campaign}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <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"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/discount/campaigns/{campaign}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"activation_mode": "<string>",
"code": "<string>",
"status": "<string>",
"discount_type": "<string>",
"tier_basis": "<string>",
"currency_code": "<string>",
"currency_exponent": 123,
"application_scope": "<string>",
"access_mode": "<string>",
"combination_policy": "<string>",
"usage_limit": 123,
"usage_pool_limit": 123,
"usage_limit_per_customer": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"metadata": {},
"conditions": "<array>",
"tiers": "<array>",
"stockable_units": [
"<unknown>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Archive a discount campaign
Retires a campaign while keeping its history; it can no longer be edited unless it is returned to draft.
curl --request POST \
--url https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive', 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.exowpee.com/v1/discount/campaigns/{campaign}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <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"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/discount/campaigns/{campaign}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/discount/campaigns/{campaign}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"activation_mode": "<string>",
"code": "<string>",
"status": "<string>",
"discount_type": "<string>",
"tier_basis": "<string>",
"currency_code": "<string>",
"currency_exponent": 123,
"application_scope": "<string>",
"access_mode": "<string>",
"combination_policy": "<string>",
"usage_limit": 123,
"usage_pool_limit": 123,
"usage_limit_per_customer": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"metadata": {},
"conditions": "<array>",
"tiers": "<array>",
"stockable_units": [
"<unknown>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}discount_campaigns.archive
Conditions
- Only a draft, active or paused campaign can be archived.
- The campaign status becomes archived: its discounts stop applying and it can no longer be edited until it is returned to draft.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the discount campaign (27-character KSUID string).
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, name, description, activation_mode, code, status, discount_type, tier_basis, currency_code, currency_exponent, application_scope, access_mode, combination_policy, usage_limit, usage_pool_limit, usage_limit_per_customer, starts_at, ends_at, metadata, created_at, updated_at, stockable_units.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: conditions, tiers.
Response
Resource (only with response=resource).
Identifier of the campaign (27-character KSUID string).
Name of the campaign.
Free-text description, or null when none was given.
How the campaign starts to apply: automatic (to every eligible order) or code (only when the customer gives the campaign code). Cannot be changed after creation.
Code the customer gives, stored in capitals. Null for an automatic campaign.
Lifecycle status: draft (being set up, not applied), active (applied to orders), paused (temporarily not applied) or archived (retired, read-only). Changed only by the activate, pause, archive and draft actions.
How the discount is computed: percentage (tiers give a percentage) or fixed (tiers give a fixed amount). Cannot be changed after creation.
Amount compared with the tier minimums: order (the whole order) or eligible_stockables (only the lines targeted by the campaign).
Currency of the campaign amounts, copied from the company when the campaign was created.
Number of decimal places of the currency (0 for XOF). An amount in minor units divided by 10 to this power gives the amount in the currency.
What the discount applies to: order (the whole order) or stockables (only the product units chosen for the campaign). Cannot be changed after creation.
Who may use the campaign: public (everyone) or restricted (only customers given access). Cannot be changed after creation.
Whether the campaign can be combined with other campaigns: exclusive or stackable.
Maximum number of orders that can use the campaign in total. Null means no limit.
Maximum number of orders without a customer that can use the campaign. Null means no limit.
Maximum number of orders each customer can use the campaign on. Null means no limit.
Moment the campaign starts to be eligible, in ISO 8601 (UTC).
Moment the campaign stops being eligible, in ISO 8601 (UTC). Null means no end date.
Free-form data stored with the campaign by the client, or null.
Conditions an order must meet for the campaign to apply. Returned only when selected with ?include=conditions.
Discount levels of the campaign, ordered by minimum amount. Returned only when selected with ?include=tiers.
Identifiers of the product units targeted by the campaign (27-character KSUID strings). Empty when application_scope is order, since targets can only be set on a stockables campaign.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).