Schema
Calculation
The fixed-value or percentage benefit for vouchers, direct quantity discounts and cashback earning. Fields that do not apply are returned as null. Percentage benefits round half up once to minor units before applying an optional cap.
Overview
Properties
type
string
Required
Allowed values
fixedpercentagefixed_value
oneOf
Required
Nullable
Yes
One of
One of 1
null
One of 2
reference
References Positive Money.
percentage
oneOf
Required
Nullable
Yes
One of
One of 1
null
One of 2
string
The percentage discount, supplied as a string.
Example
10
Pattern
^(?:0\.[1-9]|[1-9][0-9]?(?:\.[0-9])?|100)$
percentage_cap
oneOf
Required
Nullable
Yes
One of
One of 1
null
One of 2
reference
References Positive Money.
Composition
One of
One of 1
object
Nested properties
type
string
Required
Allowed values
fixedfixed_value
reference
Required
References Positive Money.
percentage
null
percentage_cap
null
One of 2
object
Nested properties
type
string
Required
Allowed values
percentagefixed_value
null
percentage
string
Required
The percentage discount, supplied as a string.
Example
10
Pattern
^(?:0\.[1-9]|[1-9][0-9]?(?:\.[0-9])?|100)$
percentage_cap
oneOf
Nullable
Yes
One of
One of 1
null
One of 2
reference
References Positive Money.
Used by
Raw YAML
Download source
title: Calculation
type: object
x-tags:
- Models
description: The fixed-value or percentage benefit for vouchers, direct quantity discounts and cashback
earning. Fields that do not apply are returned as null. Percentage benefits round half up once to minor
units before applying an optional cap.
required:
- type
- fixed_value
- percentage
- percentage_cap
properties:
type:
type: string
enum:
- fixed
- percentage
fixed_value:
oneOf:
- type: "null"
- $ref: ./PositiveMoney.yaml
percentage:
oneOf:
- type: "null"
- &a1
type: string
pattern: ^(?:0\.[1-9]|[1-9][0-9]?(?:\.[0-9])?|100)$
example: "10"
description: The percentage discount, supplied as a string.
percentage_cap:
oneOf:
- type: "null"
- $ref: ./PositiveMoney.yaml
oneOf:
- title: Fixed benefit
type: object
required:
- type
- fixed_value
properties:
type:
type: string
enum:
- fixed
fixed_value:
$ref: ./PositiveMoney.yaml
percentage:
type: "null"
percentage_cap:
type: "null"
- title: Percentage benefit
type: object
required:
- type
- percentage
properties:
type:
type: string
enum:
- percentage
fixed_value:
type: "null"
percentage: *a1
percentage_cap:
oneOf:
- type: "null"
- $ref: ./PositiveMoney.yaml