Skip to content

Offer_Code_Update

Request

Soft delete functionality for offer codes. This endpoint implements soft deletion using PATCH. Behavior:

  • Updates the is_deleted field to mark offer codes as deleted
  • Returns a custom success message when is_deleted changes from False to True
  • Prevents restoration by rejecting attempts to change is_deleted from True to False
  • Returns HTTP 400 Bad Request for invalid deletion state transitions
Security
basicAuth
Path
idintegerrequired

The ID of the offer code

merchant_uuidstring, (uuid)required

The external organization ID of the merchant. aka: external_org_id

Body
request_user_idstring, (uuid)

External Partner user ID of an existing user set up at Momnt who creating the Offer Code. This user must be an active merchant admin user for the Merchant used in the contractor_id path.

namestring, [ 2 .. 80 ] characters

The name of the Offer Code. Alpha string between 2 and 80 characters. Spaces are allowed.

is_activeboolean

Boolean field indication whether the merchant wants this Offer Code turned on or not after creation.

rate_sheet_merchant_product_pricesArray of any, [ 2 .. 7 ] items

The value of the rate_sheet_merchant_product_price_id (found in the Merchant Rate Sheet Query) of the products the Merchant wants to add to this rate sheet.

curl -i -X PATCH \
  -u '<username>:<password>' \
  'https://momnt-api-docs.redocly.app/_mock/docs/openapi/sponsor_merchant_v1/api/v1/sponsor/merchants/{merchant_uuid}/offer-code/{id}/' \
  -H 'Content-Type: application/json' \
  -d '{
    "request_user_id": "25639547-c9b9-4774-aa30-dd374668b0e0",
    "name": "string",
    "is_active": true,
    "rate_sheet_merchant_product_prices": [
      null,
      null
    ]
  }'

Responses

Bodyapplication/json
request_user_idstring, (uuid)

External Partner user ID of an existing user set up at Momnt who creating the Offer Code. This user must be an active merchant admin user for the Merchant used in the contractor_id path.

namestring, [ 2 .. 80 ] charactersrequired

The name of the Offer Code. Alpha string between 2 and 80 characters. Spaces are allowed.

is_activeboolean

Boolean field indication whether the merchant wants this Offer Code turned on or not after creation.

rate_sheet_merchant_product_pricesArray of any

The value of the rate_sheet_merchant_product_price_id (found in the Merchant Rate Sheet Query) of the products the Merchant wants to add to this rate sheet.

messagestring

Used on the response to return a message when the offer code name is changed. And it will be the only field when the offer code is removed.

Response
{ "request_user_id": "25639547-c9b9-4774-aa30-dd374668b0e0", "name": "string", "is_active": true, "rate_sheet_merchant_product_prices": [ null ], "message": "string" }