Promotion codes
Update promotion code
Update an existing promotion code
PUT
/
v1
/
promotion-codes
Update promotion code
curl --request PUT \
--url https://api.example.com/v1/promotion-codesimport requests
url = "https://api.example.com/v1/promotion-codes"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://api.example.com/v1/promotion-codes', 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.example.com/v1/promotion-codes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$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.example.com/v1/promotion-codes"
req, _ := http.NewRequest("PUT", url, nil)
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.example.com/v1/promotion-codes")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/promotion-codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"code": "PROMO123",
"first_time_order": true,
"limit_to_specific_partner": false,
"coupon_specific_partners": [],
"limit_to_specific_customer": false,
"coupon_specific_customers": [],
"minimum_order_status": true,
"minimum_order_value": 22,
"expiration_date_status": false,
"expiration_date_value": null,
"redemption_times_status": false,
"redemption_times_value": null,
"metadata": {
"campaign": "summer_sale"
},
"additional_info": {
"redemptions": [
{
"redeemed_at": "2025-05-09T07:11:04.000000Z",
"transaction_key": "order_4561"
}
]
},
"times_redeemed": 2
},
"status": 1,
"message": "Promotion code updated in the app successfully."
}
Endpoint
PUT https://api.partnero.com/v1/promotion-codes
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Promotion code to update. Allowed characters: A-Z, a-z, 0-9, -, _. Max 100 characters |
limit_to_specific_partner | boolean | No | Restrict to a specific partner |
coupon_specific_partners | object | Yes* | Required if limit_to_specific_partner is true. Shape: { id, full_name } |
metadata | object | No | Custom key-value pairs (merged into existing metadata) |
redeem | boolean | No | When true, records a redemption: increments times_redeemed and appends an entry to additional_info.redemptions |
transaction_key | string | No | Optional transaction identifier paired with redeem. Must match the key of an existing transaction in this program (created via POST /v1/transactions). Used to deduplicate redemptions — if the same transaction_key was already recorded for this code, or no transaction with that key exists, the request is a silent no-op |
Request
cURL
curl --location --request PUT 'https://api.partnero.com/v1/promotion-codes' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"code": "PROMO123",
"metadata": {
"campaign": "summer_sale"
}
}'
Record a redemption
Useredeem to record that a customer applied this promotion code, for cases where the checkout doesn’t run through a connected payment integration. Pass a transaction_key to deduplicate retries.
cURL
curl --location --request PUT 'https://api.partnero.com/v1/promotion-codes' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"code": "PROMO123",
"redeem": true,
"transaction_key": "order_4561"
}'
Response
{
"data": {
"code": "PROMO123",
"first_time_order": true,
"limit_to_specific_partner": false,
"coupon_specific_partners": [],
"limit_to_specific_customer": false,
"coupon_specific_customers": [],
"minimum_order_status": true,
"minimum_order_value": 22,
"expiration_date_status": false,
"expiration_date_value": null,
"redemption_times_status": false,
"redemption_times_value": null,
"metadata": {
"campaign": "summer_sale"
},
"additional_info": {
"redemptions": [
{
"redeemed_at": "2025-05-09T07:11:04.000000Z",
"transaction_key": "order_4561"
}
]
},
"times_redeemed": 2
},
"status": 1,
"message": "Promotion code updated in the app successfully."
}
⌘I
Update promotion code
curl --request PUT \
--url https://api.example.com/v1/promotion-codesimport requests
url = "https://api.example.com/v1/promotion-codes"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://api.example.com/v1/promotion-codes', 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.example.com/v1/promotion-codes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$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.example.com/v1/promotion-codes"
req, _ := http.NewRequest("PUT", url, nil)
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.example.com/v1/promotion-codes")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/promotion-codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"code": "PROMO123",
"first_time_order": true,
"limit_to_specific_partner": false,
"coupon_specific_partners": [],
"limit_to_specific_customer": false,
"coupon_specific_customers": [],
"minimum_order_status": true,
"minimum_order_value": 22,
"expiration_date_status": false,
"expiration_date_value": null,
"redemption_times_status": false,
"redemption_times_value": null,
"metadata": {
"campaign": "summer_sale"
},
"additional_info": {
"redemptions": [
{
"redeemed_at": "2025-05-09T07:11:04.000000Z",
"transaction_key": "order_4561"
}
]
},
"times_redeemed": 2
},
"status": 1,
"message": "Promotion code updated in the app successfully."
}
