coupons

Update a coupon

patch/coupons/{couponId}

Request

  • Base URL
    https://{your_organization_slug}.commercelayer.io/api
  • URL
    https://{your_organization_slug}.commercelayer.io/api/coupons/{couponId}
  • Auth
    HTTP bearer

Path parameters

couponIdstring required

The resource's id

Request body

Example request

{
  "data": {
    "id": "XAyRWNUzyN",
    "attributes": {
      "code": "04371af2-70b3-48d7-8f4e-316b374224c3",
      "usage_limit": 50,
      "recipient_email": "john@example.com",
      "expires_at": "2018-01-01T12:00:00.000Z",
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "promotion_rule": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "coupon_recipient": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "tags": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      }
    }
  }
}

Response

The updated coupon object

Changes

    • breaking

      added the new required request property ///

    • breaking

      request property / was restricted to a list of enum values

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property // became nullable

    • info

      the request property default value coupons was removed

    • info

      added the new coupons enum value to the request property /

    • info

      added the media type application/vnd.api+json for the response with the status