Skip to navigation

Save code rules

code never changes after create. After the first redemption only expiresOn, officeIds, planIds and status may change; anything else returns 422 locked_after_redemption. The server enforces this, not only the UI.

Authentication

AuthorizationBearer

API session token from POST /v1/admin/session (8 hours). Sign-in itself is Google Workspace; see research R2.

Path parameters

codeIdstringRequired

Request

This endpoint expects an object.
statusenumRequired
Allowed values:
discountsobjectRequired
officeIdslist of stringsRequired
codestringOptional<=100 characters

Set on create, fixed afterwards. Blank on create = generated. Unique across offices, not case-sensitive.

planIdslist of stringsOptional
redemptionLimitintegerOptional>=1
expiresOndateOptional
Last valid day, office local time.
campaignobjectOptional
versionintegerOptional

Version you last read. Omit on create; required on update. A stale value returns 409 version_conflict.

Response

Saved
statusenum
Allowed values:
discountsobject
officeIdslist of strings
idstringOptionalRead-only<=255 characters

Server-generated.

codestringOptional<=100 characters

Set on create, fixed afterwards. Blank on create = generated. Unique across offices, not case-sensitive.

planIdslist of stringsOptional
redemptionLimitintegerOptional>=1
redemptionCountintegerOptionalRead-only
expiresOndateOptional
Last valid day, office local time.
campaignobjectOptional
lockedFieldslist of stringsOptionalRead-only
After the first redemption, everything except expiresOn, officeIds, planIds and status.
shareUrlstringOptionalRead-onlyformat: "uri"
versionintegerOptional

Version you last read. Omit on create; required on update. A stale value returns 409 version_conflict.

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error