Skip to content

Partially updates a coupon code with the specified ID.

Request

This method will patch an existing coupon code with the specified ID, using the HTTP PATCH specification.

Security
knox-authorizer
Path
tenantIdstringrequired

The id of the tenant being accessed.

idstringrequired

The ID of the coupon code to patch.

Bodyapplication/jsonrequired

The patch directives conforming to RFC 6902.

Array [
opstring(Op)required

The operation

Enum:"add""copy""move""remove""replace""test"
pathstring(Path)required

The JSON path

valuestring(Value)
]
curl -i -X PATCH \
  'https://docs.api.rhythmsoftware.com/_mock/apis/commerce/commerce-v1/couponCodes/{tenantId}/{id}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "op": "add",
      "path": "string",
      "value": "string"
    }
  ]'

Responses

The coupon code was patched successfully.

Headers
Access-Control-Allow-Headersstring
Access-Control-Allow-Methodsstring
Access-Control-Allow-Originstring
Bodyapplication/json
contact_idstring(Contact)required

The contact

coupon_idstring(Coupon)required

The ID of the associated coupon

coupon_typestring(Coupon Type)\-coupons$required

The type of coupon

custom_field_valuesArray of objects(Custom Field Values)
eligibility_criteriaobject(Eligibility Criteria)required

The criteria to use

enable_coupon_ownershipboolean(Enable Coupon Ownership)

Enable the idea that a coupon can be owned by a contact/organization

enable_eligibility_criteriaboolean(Enable Eligibility Criteria)

If true, eligibility criteria is applied to the coupon code

enable_restricted_contactsboolean(Enable Restricted Contacts)

If true, this coupon is restricted only to certain contacts

enable_restricted_organizationsboolean(Enable Restricted Organizations)

If true, this coupon is restricted only to certain organizations

idstring(ID)^[\w|-]+$required

The unique, string identifier of this coupon code

is_activeboolean(Is Active)

Whether or not this coupon code is active

maximum_number_of_total_usesnumber(Maximum Number Of Total Uses)required
One of:

The maximum number of total uses

>= 1
integer
Value:1
maximum_number_of_uses_per_customernumber(Maximum Number Of Uses Per Customer)required
One of:

The maximum number of total uses for a given customer

>= 1
integer
Value:1
maximum_number_of_uses_per_organizationinteger, >= 1(Maximum Number Of Uses Per Organization)

The maximum number of total uses per contacts of an organization

namestring(Name)

The name of the coupon code - used to identify the owner

notesstring(Notes)

Notes

order_idstring(Order)

The order id tied to this code

order_line_item_idstring(Order Line Item)
organization_idstring(Organization)required

The organization

owner_typestring(Owner Type)required
One of:

The owner of the code

string
Enum:"contact""organization"
restricted_contactsArray of objects, non-emptyrequired
restricted_organizationsArray of objects, non-emptyrequired
sys_bulk_load_atstring(Sys Bulk Load At)

If this record was loaded via bulk, the timestamp when the record was processed

sys_bulk_load_idstring(Sys Bulk Load)

If this record was loaded via bulk, the ID of the bulk load process

sys_bulk_load_pkstring(Sys Bulk Load Pk)

If this record was loaded via bulk, the tenant and key of the bulk load process used as a partition key

sys_bulk_load_record_nonumber, (float)(Sys Bulk Load Record No)

If this record was loaded via bulk, the record number in the source file

sys_bulk_load_source_filestring(Sys Bulk Load Source File)

If this record was loaded via bulk, the source file

sys_calculated_field_errorstring(Sys Calculated Field Error)

The error associated with the calculated field

sys_calculated_field_errorsArray of objects
sys_configuration_snapshot_idstring(Sys Configuration Snapshot)

If a snapshot was restored/applies to this record, the ID of the snapshot

sys_created_atstring, (date-time)(Sys Created At)required

The date/time that this record was created, expressed in ISO-8601 date format

sys_created_by_idstring(Sys Created By)required

The ID of the user that created this record

sys_deleted_by_idstring(Sys Deleted By)

The ID of the user that deleted (or last tried to delete) this object

sys_directivestring(Sys Directive)

Means for passing directive information into an object processing logic

sys_external_idstring(Sys External)

The ID that a record has from an external system or data import

sys_has_files_in_s3boolean(Sys Has Files In S3)

If true, this record has files in S3. If false, it doesnt, so no need to hit S3 upon deletion

sys_last_bulk_data_operation_idstring(Sys Last Bulk Data Operation)

If this record was last touched by a bulk data operation, the ID of that operation

sys_last_bulk_data_operation_sys_versionstring(Sys Last Bulk Data Operation Sys Version)

If this record was last touched by a bulk data operation, the sys_version at the time of that operation

sys_last_modified_atstring, (date-time)(Sys Last Modified At)required

The date/time that this record record was last modified, expressed in ISO-8601 date format

sys_last_modified_by_idstring(Sys Last Modified By)required

The ID of the user that last modified this record

sys_last_security_contextobject(Sys Last Security Context)

The security context of the last insert, modify, or delete performed on this item

sys_lockedboolean(Sys Locked)

If set, this record is locked and cannot be changed via the API

sys_snapshot_base_versionnumber, (float)(Sys Snapshot Base Version)

The version to use as a base when creating a configuration snapshot; if not set, 1 is used. Helpful when creating a sandbox

sys_versionnumber, (float)(Sys Version)

A number representing the version of this record in the database

typestring(Type)

The type of coupon

Enum:"multi use""single use"
valid_fromstring, (date-time)(Valid From)

Date/time at which the code begins to be valid

valid_untilstring, (date-time)(Valid Until)

Expiration date

Response
{ "contact_id": "string", "coupon_id": "string", "coupon_type": "string", "custom_field_values": [ { … } ], "eligibility_criteria": { "advanced_rule_error_message": "string", "advanced_rules": {}, "age_restrictions": { … }, "award_options": { … }, "award_recipients": true, "by_location": true, "certificants": true, "certification_options": { … }, "committee_member_options": { … }, "committee_members": true, "custom_logic_options": { … }, "customer_type": "contact", "donor_options": { … }, "donors": true, "enable_advanced_rules": true, "enable_age_restrictions": true, "enable_custom_logic": true, "enable_entitlement_restrictions": true, "enable_expression": true, "enable_organization_restrictions": true, "enable_status_restriction": true, "entitlement_restrictions": [ … ], "event_registration_options": { … }, "event_registrations": true, "expression": "string", "expression_error_message": "string", "location": { … }, "logic_operator": "and", "member_options": { … }, "members": true, "non_members": true, "organization_restrictions": { … }, "status_restrictions": [ … ], "use_organization_for_eligibility": true }, "enable_coupon_ownership": true, "enable_eligibility_criteria": true, "enable_restricted_contacts": true, "enable_restricted_organizations": true, "id": "string", "is_active": true, "maximum_number_of_total_uses": 1, "maximum_number_of_uses_per_customer": 1, "maximum_number_of_uses_per_organization": 1, "name": "string", "notes": "string", "order_id": "string", "order_line_item_id": "string", "organization_id": "string", "owner_type": "contact", "restricted_contacts": [ { … } ], "restricted_organizations": [ { … } ], "sys_bulk_load_at": "string", "sys_bulk_load_id": "string", "sys_bulk_load_pk": "string", "sys_bulk_load_record_no": 0.1, "sys_bulk_load_source_file": "string", "sys_calculated_field_error": "string", "sys_calculated_field_errors": [ { … } ], "sys_configuration_snapshot_id": "string", "sys_created_at": "2019-08-24T14:15:22Z", "sys_created_by_id": "string", "sys_deleted_by_id": "string", "sys_directive": "string", "sys_external_id": "string", "sys_has_files_in_s3": true, "sys_last_bulk_data_operation_id": "string", "sys_last_bulk_data_operation_sys_version": "string", "sys_last_modified_at": "2019-08-24T14:15:22Z", "sys_last_modified_by_id": "string", "sys_last_security_context": {}, "sys_locked": true, "sys_snapshot_base_version": 0.1, "sys_version": 0.1, "type": "multi use", "valid_from": "2019-08-24T14:15:22Z", "valid_until": "2019-08-24T14:15:22Z" }