Earning Rules

Move earning rule to draft

Changed on
<Info>

<Badge color="gray">Documentation in progress</Badge>

This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact Voucherify support or your Technical Account Manager.

</Info>

Moves the earning rule from ACTIVE to DRAFT. No request body. Any other status returns 400 (invalid_state_transition). Returns 423 (connected_non_draft_program) when a non-draft program still uses the earning rule.

post/v2/loyalties/earning-rules/{earningRuleId}/draft

Request

  • Base URL
    https://api.voucherify.io
  • URL
    https://api.voucherify.io/v2/loyalties/earning-rules/{earningRuleId}/draft
  • Auth
    • API key in header X-App-Id and API key in header X-App-Token
    • or HTTP bearer

Response

Drafted earning rule

idstring required

Earning rule ID (lern_...).

namestring required

Earning rule name.

status'DRAFT' | 'ACTIVE' | 'INACTIVE' required

Current status. DELETED also exists internally but deleted rules are excluded from API reads.

start_datestring date-time nullable required

Date-time from which the rule is active. Can be null.

end_datestring date-time nullable required

Date-time until which the rule is active. Can be null.

metadataLoyaltyV2ActivityMetadata required

Arbitrary key-value metadata; any JSON object is accepted.

created_atstring date-time required

Creation timestamp (ISO 8601).

updated_atstring date-time nullable required

Last update timestamp (ISO 8601). null when never updated.

object'earning_rule' required

Object type marker. Always earning_rule.

Changes

    • breaking

      the /////////// response's property type changed from object to no type for status

    • breaking

      the /////////// response's property type changed from object to no type for status

    • breaking

      the ///////// response's property type changed from object to no type for status

    • breaking

      the ///////// response's property type changed from object to no type for status

    • breaking

      removed the required property //////////// from the response with the status

    • breaking

      removed the required property //////////// from the response with the status

    • breaking

      removed the required property ////////// from the response with the status

    • breaking

      removed the required property ////////// from the response with the status

    • info

      added to the /////////// response property allOf list for the response status

    • info

      added to the /////////// response property allOf list for the response status

    • info

      added to the ///////// response property allOf list for the response status

    • info

      added to the ///////// response property allOf list for the response status

    • info

      added subschema #4 subschema #5 to the ////////// response property allOf list for the response status

    • info

      added subschema #4 subschema #5 to the //////// response property allOf list for the response status

    • info

      removed subschema #4 subschema #5 from the ////////// response property allOf list for the response status

    • info

      removed subschema #4 subschema #5 from the //////// response property allOf list for the response status

    • breaking

      the /////////// response's property type changed from no type to object for status

    • breaking

      the /////////// response's property type changed from no type to object for status

    • breaking

      the ///////// response's property type changed from no type to object for status

    • breaking

      the ///////// response's property type changed from no type to object for status

    • info

      added subschema #4 subschema #5 to the ////////// response property allOf list for the response status

    • info

      added subschema #4 subschema #5 to the //////// response property allOf list for the response status

    • info

      removed from the /////////// response property allOf list for the response status

    • info

      removed from the /////////// response property allOf list for the response status

    • info

      removed from the ///////// response property allOf list for the response status

    • info

      removed from the ///////// response property allOf list for the response status

    • info

      removed subschema #4 subschema #5 from the ////////// response property allOf list for the response status

    • info

      removed subschema #4 subschema #5 from the //////// response property allOf list for the response status

    • info

      added the required property //////////// to the response with the status

    • info

      added the required property //////////// to the response with the status

    • info

      added the required property ////////// to the response with the status

    • info

      added the required property ////////// to the response with the status