Validate a subscription contract would be eligible for a promotion
  • 22 Nov 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

Validate a subscription contract would be eligible for a promotion

  • Dark
    Light

Article summary

Post
/promotion/v1/promotions/{promotionId}/_validate

Validate a subscription contract would be eligible for a promotion.

Security
HTTP
Type bearer
Path parameters
promotionId
stringRequired
Min length1
Body parameters
Expand All
object

The request data of a subscription contract for the promotion validation.

subscriptionContract
object Required
createdAt
string | null Required

The date and time the subscription contract was created. When it's null, means it's a new subscription contract

subscriptionTypeId
string Required

The subscription type ID of the subscription contract.

discounts
Array of object

A list of discount codes applied to the subscription contract.

Example[ { "code": "100OFF", "terminationCriteria": { "orderOrdinal": 3 } } ]
object
code
string Required

The discount code to apply to the subscription contract.

terminationCriteria
object

The order ordinal beyond which the discount code will no longer be applied.

orderOrdinal
integer Required
addedAt
string

The date and time the discount code was added.

Responses
200

Validation result

Expand All
object
data
object
valid
boolean

Whether the subscription contract is eligible for the promotion.

message
string

A message stating the subscription contract is eligible for the promotion, or explaining why not.

meta
object

Additional information about the resource.

property*
401

Unauthorized

Expand All
object
errors
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

403

Forbidden

Expand All
object
errors
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

404

Not Found

Expand All
object
errors
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

429

Too Many Requests

Expand All
object
errors
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

500

Internal Server Error

Expand All
object
errors
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.

503

Service Unavailable

Expand All
object
errors
Array of object

Details of problems encountered processing the request.

object

Details of a problem encountered processing the request.

status
string

The HTTP status code applicable to the problem

title
string

A short-human readable description of the problem, this should not change from occurrence to occurrence.

detail
string

A human-readable explanation specific to this occurrence of the problem.


Was this article helpful?