cURL
curl --request PUT \
--url https://us.api.flexprice.io/v1/coupons/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"metadata": {},
"name": "<string>"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.coupons.update_coupon(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.coupons.updateCoupon("<id>", {});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Coupons.UpdateCoupon(ctx, "<id>", types.UpdateCouponRequest{})
if err != nil {
log.Fatal(err)
}
if res.CouponResponse != nil {
// handle response
}
}{
"amount_off": "<string>",
"cadence": "once",
"coupon_code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"duration_in_periods": 123,
"environment_id": "<string>",
"id": "<string>",
"max_redemptions": 123,
"metadata": {},
"name": "<string>",
"percentage_off": "<string>",
"redeem_after": "<string>",
"redeem_before": "<string>",
"rules": {},
"status": "published",
"tenant_id": "<string>",
"total_redemptions": 123,
"type": "fixed",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Coupons
Update coupon
Use when changing coupon config (e.g. value, validity, or usage limits).
PUT
/
coupons
/
{id}
cURL
curl --request PUT \
--url https://us.api.flexprice.io/v1/coupons/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"metadata": {},
"name": "<string>"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.coupons.update_coupon(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.coupons.updateCoupon("<id>", {});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Coupons.UpdateCoupon(ctx, "<id>", types.UpdateCouponRequest{})
if err != nil {
log.Fatal(err)
}
if res.CouponResponse != nil {
// handle response
}
}{
"amount_off": "<string>",
"cadence": "once",
"coupon_code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"duration_in_periods": 123,
"environment_id": "<string>",
"id": "<string>",
"max_redemptions": 123,
"metadata": {},
"name": "<string>",
"percentage_off": "<string>",
"redeem_after": "<string>",
"redeem_before": "<string>",
"rules": {},
"status": "published",
"tenant_id": "<string>",
"total_redemptions": 123,
"type": "fixed",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Authorizations
ApiKeyAuthApiKeyAuth
Enter your API key in the format x-api-key <api-key>*
Path Parameters
Coupon ID
Response
OK
Available options:
once, repeated, forever Show child attributes
Show child attributes
Available options:
published, deleted, archived Available options:
fixed, percentage 
