Upsert a deposit strategy

Creates or updates (upserts) a deposit strategy with a specified ID.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

ID of the resource.

Request Body schema: application/json
required

Deposit strategy resource.

name
required
string

Name of the strategy.

required
object

Deposit strategy amounts configuration.

calculator
required
string

Deposit amounts calculator. This field specifies if amounts are calculated using an absolute or percentage calculation.

Amounts are specified in baseAmount, and increments are specified in increments.

Example: baseAmount: 10 and increments: [20, 50, 100].

  • If the calculator is set to absolute: the amounts displayed to the customer are [10, 30, 60, 110].
  • If the calculator is set to percent: the amounts displayed to the customer are [10, 12, 15, 20].
Enum: "absolute" "percent"
baseAmount
required
number <double> >= 0.01

First amount that is displayed to customer.

increments
required
Array of numbers <double>

List of incremental amounts that are displayed to customer.

For more information, see the calculator property.

adjustBaseToLastDeposit
boolean
Default: false

Specifies if the base amount must be adjusted based on the last deposit. If this value is true, the baseAmount is changed to the last successful deposit amount made using Create a deposit request.

If the customer has no successful deposits, baseAmount is not adjusted.

required
object or null

Custom amount restrictions. If this value is null, custom amounts are prohibited. If customAmount is not specified when a deposit request is created, amount restrictions are determined from the chosen strategy. For more information, see the strategyId property.

minimum
required
number <double> >= 0.01

Minimum custom amount.

multipleOf
required
number <double> >= 0.01

Multiple by which the custom amount increases.

For example, if minimum is equal to 5.30, and multipleOf is 0.50, the valid custom amount is 5.30, 5.80, 6.30, 6.80 and so on until the maximum value is reached.

A valid custom amount must be equal to minimum + X * multipleOf, where X is any non negative integer.

maximum
required
number <double> >= 0.01

Maximum custom amount. This value must be equal to minimum + X * multipleOf, where X is any positive integer.

filter
string
Default: ""

Filter that uses deposit request properties to determine if a deposit strategy is applicable for the request. If this field is empty, the strategy is applicable for any request.

Responses
200

Deposit strategy updated.

Response Schema: application/json
name
required
string

Name of the strategy.

required
object

Deposit strategy amounts configuration.

calculator
required
string

Deposit amounts calculator. This field specifies if amounts are calculated using an absolute or percentage calculation.

Amounts are specified in baseAmount, and increments are specified in increments.

Example: baseAmount: 10 and increments: [20, 50, 100].

  • If the calculator is set to absolute: the amounts displayed to the customer are [10, 30, 60, 110].
  • If the calculator is set to percent: the amounts displayed to the customer are [10, 12, 15, 20].
Enum: "absolute" "percent"
baseAmount
required
number <double> >= 0.01

First amount that is displayed to customer.

increments
required
Array of numbers <double>

List of incremental amounts that are displayed to customer.

For more information, see the calculator property.

adjustBaseToLastDeposit
boolean
Default: false

Specifies if the base amount must be adjusted based on the last deposit. If this value is true, the baseAmount is changed to the last successful deposit amount made using Create a deposit request.

If the customer has no successful deposits, baseAmount is not adjusted.

required
object or null

Custom amount restrictions. If this value is null, custom amounts are prohibited. If customAmount is not specified when a deposit request is created, amount restrictions are determined from the chosen strategy. For more information, see the strategyId property.

minimum
required
number <double> >= 0.01

Minimum custom amount.

multipleOf
required
number <double> >= 0.01

Multiple by which the custom amount increases.

For example, if minimum is equal to 5.30, and multipleOf is 0.50, the valid custom amount is 5.30, 5.80, 6.30, 6.80 and so on until the maximum value is reached.

A valid custom amount must be equal to minimum + X * multipleOf, where X is any non negative integer.

maximum
required
number <double> >= 0.01

Maximum custom amount. This value must be equal to minimum + X * multipleOf, where X is any positive integer.

id
string <= 50 characters

ID of the deposit strategy.

filter
string
Default: ""

Filter that uses deposit request properties to determine if a deposit strategy is applicable for the request. If this field is empty, the strategy is applicable for any request.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

Array of objects (SelfLink)

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Value: "self"
201

Deposit strategy created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
name
required
string

Name of the strategy.

required
object

Deposit strategy amounts configuration.

calculator
required
string

Deposit amounts calculator. This field specifies if amounts are calculated using an absolute or percentage calculation.

Amounts are specified in baseAmount, and increments are specified in increments.

Example: baseAmount: 10 and increments: [20, 50, 100].

  • If the calculator is set to absolute: the amounts displayed to the customer are [10, 30, 60, 110].
  • If the calculator is set to percent: the amounts displayed to the customer are [10, 12, 15, 20].
Enum: "absolute" "percent"
baseAmount
required
number <double> >= 0.01

First amount that is displayed to customer.

increments
required
Array of numbers <double>

List of incremental amounts that are displayed to customer.

For more information, see the calculator property.

adjustBaseToLastDeposit
boolean
Default: false

Specifies if the base amount must be adjusted based on the last deposit. If this value is true, the baseAmount is changed to the last successful deposit amount made using Create a deposit request.

If the customer has no successful deposits, baseAmount is not adjusted.

required
object or null

Custom amount restrictions. If this value is null, custom amounts are prohibited. If customAmount is not specified when a deposit request is created, amount restrictions are determined from the chosen strategy. For more information, see the strategyId property.

minimum
required
number <double> >= 0.01

Minimum custom amount.

multipleOf
required
number <double> >= 0.01

Multiple by which the custom amount increases.

For example, if minimum is equal to 5.30, and multipleOf is 0.50, the valid custom amount is 5.30, 5.80, 6.30, 6.80 and so on until the maximum value is reached.

A valid custom amount must be equal to minimum + X * multipleOf, where X is any non negative integer.

maximum
required
number <double> >= 0.01

Maximum custom amount. This value must be equal to minimum + X * multipleOf, where X is any positive integer.

id
string <= 50 characters

ID of the deposit strategy.

filter
string
Default: ""

Filter that uses deposit request properties to determine if a deposit strategy is applicable for the request. If this field is empty, the strategy is applicable for any request.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

Array of objects (SelfLink)

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Value: "self"
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

409

Conflict.

422

Invalid data sent.

put/deposit-strategies/{id}
Request samples
application/json
{
  • "name": "string",
  • "filter": "depositRequest.currency:USD",
  • "amounts": {
    },
  • "customAmount": {
    }
}
Response samples
application/json
{
  • "id": "dep_str_0YVJ64MAHTDPA97H8S7R5MYR1M",
  • "name": "string",
  • "filter": "depositRequest.currency:USD",
  • "amounts": {
    },
  • "customAmount": {
    },
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}