Coupons
Update coupon
Update an existing coupon
PUT
/
v1
/
coupons
Update coupon
curl --request PUT \
--url https://api.example.com/v1/couponsimport requests
url = "https://api.example.com/v1/coupons"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://api.example.com/v1/coupons', 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/coupons",
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/coupons"
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/coupons")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/coupons")
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": {
"name": "PARTNERO25_UPDATED",
"uuid_code": "coupon_123",
"active": true,
"coupon_discount_type": "percent",
"coupon_discount_amount": 25,
"coupon_duration_type": "months",
"coupon_duration_value": 11,
"redemption_specific_date_status": false,
"redemption_specific_date_value": null,
"redemption_times_status": true,
"redemption_times_value": 24,
"metadata": [],
"additional_info": {
"redemptions": [
{
"redeemed_at": "2025-05-07T17:53:32.000000Z",
"transaction_key": "order_4561"
}
]
},
"times_redeemed": 4,
"created_at": "2025-05-07T17:43:26.000000Z",
"updated_at": "2025-05-07T17:53:32.000000Z",
"deleted_at": null
},
"status": 1,
"message": "Coupon updated in the app successfully.",
"synchronization_enabled": false,
"synchronization_successful": false,
"synchronization_message": ""
}
Endpoint
PUT https://api.partnero.com/v1/coupons
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
uuid_code | string | Yes | Coupon’s unique identifier |
name | string | No | Updated customer-facing 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 coupon, or no transaction with that key exists, the request is a silent no-op |
sync | object | No | Optional object to assign a sync provider to a coupon that doesn’t have one yet. See Assigning a sync provider on update |
sync.provider | string | No | One of stripe, shopify, woocommerce, paddle. Must be currently connected. Can only be set when the coupon currently has no sync provider |
Promotion codes cannot be updated through this endpoint. Use the promotion code update endpoint instead.
Request
cURL
curl --location --request PUT 'https://api.partnero.com/v1/coupons' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"uuid_code": "coupon_123",
"name": "PARTNERO25_UPDATED"
}'
Assigning a sync provider on update
You can attach a sync provider to a coupon that was created without one. This is a one-way assignment: once a coupon has a sync provider, it cannot be changed or removed via the API.cURL
curl --location --request PUT 'https://api.partnero.com/v1/coupons' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"uuid_code": "coupon_123",
"sync": { "provider": "stripe" }
}'
-
422if the provider is not connected to the program:{ "errors": { "sync.provider": ["stripe is not connected for this program."] } } -
422if the coupon already has a differentsync.provider:{ "errors": { "sync.provider": ["sync.provider is already set on this coupon and cannot be changed."] } }
Record a redemption
To record a redemption against an existing coupon — useful when your checkout doesn’t run through a connected payment integration — setredeem to true and (optionally) pass the originating transaction_key so the redemption is not double-counted on retries.
cURL
curl --location --request PUT 'https://api.partnero.com/v1/coupons' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"uuid_code": "coupon_123",
"redeem": true,
"transaction_key": "order_4561"
}'
Response
{
"data": {
"name": "PARTNERO25_UPDATED",
"uuid_code": "coupon_123",
"active": true,
"coupon_discount_type": "percent",
"coupon_discount_amount": 25,
"coupon_duration_type": "months",
"coupon_duration_value": 11,
"redemption_specific_date_status": false,
"redemption_specific_date_value": null,
"redemption_times_status": true,
"redemption_times_value": 24,
"metadata": [],
"additional_info": {
"redemptions": [
{
"redeemed_at": "2025-05-07T17:53:32.000000Z",
"transaction_key": "order_4561"
}
]
},
"times_redeemed": 4,
"created_at": "2025-05-07T17:43:26.000000Z",
"updated_at": "2025-05-07T17:53:32.000000Z",
"deleted_at": null
},
"status": 1,
"message": "Coupon updated in the app successfully.",
"synchronization_enabled": false,
"synchronization_successful": false,
"synchronization_message": ""
}
⌘I
Update coupon
curl --request PUT \
--url https://api.example.com/v1/couponsimport requests
url = "https://api.example.com/v1/coupons"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://api.example.com/v1/coupons', 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/coupons",
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/coupons"
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/coupons")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/coupons")
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": {
"name": "PARTNERO25_UPDATED",
"uuid_code": "coupon_123",
"active": true,
"coupon_discount_type": "percent",
"coupon_discount_amount": 25,
"coupon_duration_type": "months",
"coupon_duration_value": 11,
"redemption_specific_date_status": false,
"redemption_specific_date_value": null,
"redemption_times_status": true,
"redemption_times_value": 24,
"metadata": [],
"additional_info": {
"redemptions": [
{
"redeemed_at": "2025-05-07T17:53:32.000000Z",
"transaction_key": "order_4561"
}
]
},
"times_redeemed": 4,
"created_at": "2025-05-07T17:43:26.000000Z",
"updated_at": "2025-05-07T17:53:32.000000Z",
"deleted_at": null
},
"status": 1,
"message": "Coupon updated in the app successfully.",
"synchronization_enabled": false,
"synchronization_successful": false,
"synchronization_message": ""
}
