Update a coupon
How to update an existing coupon via API
To update an existing coupon, send a PATCH
request to the /api/coupons/:id
endpoint, where id
is the ID of the resource that you want to update.
Here below the list of all the possible arguments that you can pass with the request body.
Request
PATCH https://yourdomain.commercelayer.io/api/coupons/:id
Arguments
Body Parameter | Type | Required |
---|---|---|
type |
| Required |
id |
| Required |
attributes.code |
| Optional |
attributes.customer_single_use |
| Optional |
attributes.usage_limit |
| Optional |
attributes.recipient_email |
| Optional |
attributes.expires_at |
| Optional |
attributes.reference |
| Optional |
attributes.reference_origin |
| Optional |
attributes.metadata |
| Optional |
relationships.promotion_rule |
| Optional |
relationships.coupon_recipient |
| Optional |
relationships.tags |
| Optional |
Example
The following request updates the coupon identified by the ID "xYZkjABcde":
Last updated