Create a deposit request

Creates a deposit request. To complete the deposit, the customer is redirected to the deposit link. After the deposit, the customer is redirected to the redirectUrl. Corresponding transaction webhooks are sent to webhooks subscribers.

SecuritySecretApiKey or JWT
Request
Request Body schema: application/json
required

Deposit request resource.

websiteId
required
string <= 50 characters

Website ID of the deposit. This value specifies the website with which the deposit is associated.

customerId
required
string (CustomerId) <= 50 characters

ID of the customer resource.

currency
required
string (CurrencyCode) = 3 characters

Currency code in ISO 4217 format.

strategyId
string or null <= 50 characters

ID of a strategy to be applied for this request for amounts and customAmount. If this field is not specified, a randomly selected strategy with a matching filter value is applied for empty amounts and customAmount. If there is no matching strategy, the default strategy with the following parameters is applied for empty amounts and customAmount:

  amounts:
    calculator: absolute
    baseAmount: 10
    increments: [10, 20]
    adjustBaseToLastDeposit: true
  customAmount:
    minimum: 1
    multipleOf: 1
    maximum: 10000

For more information, see Create a deposit strategy.

amounts
Array of numbers or null <double>

List of available deposit amounts.

If amounts is not specified when a deposit request is created, amounts are determined from the chosen strategy. For more information, see the strategyId property.

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.

redirectUrl
string or null <uri>

URL to redirect the customer to when a deposit is completed. The default value is the website URL.

expirationTime
string or null <date-time>

Date and time at which the deposit request expires. The default expiration time is one hour after the time the request is created.

customPropertySetId
string or null <= 50 characters

ID of a custom property set to apply to the request propertiesSchema.

Responses
201

Deposit request created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
websiteId
required
string <= 50 characters

Website ID of the deposit. This value specifies the website with which the deposit is associated.

customerId
required
string (CustomerId) <= 50 characters

ID of the customer resource.

currency
required
string (CurrencyCode) = 3 characters

Currency code in ISO 4217 format.

id
string <= 50 characters

ID of the deposit request.

transactionId
string or null <= 50 characters

ID of the transaction that is used in the deposit request.

status
string

Status of the request.

Enum: Description
created

Request is created, but it has not been visited by a customer. This is a temporary state.

pending

Request has been visited by a customer, but no funds have been deposited yet. This is a temporary state.

completed

A funds deposit transaction has been initiated. This is a permanent state.

expired

Request expired without a deposit attempt. This is a permanent state.

amounts
Array of numbers <double>

List of available deposit amounts.

If amounts is not specified when a deposit is created, amounts are determined from the chosen strategy. For more information, see the strategyId property.

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.

redirectUrl
string <uri>

URL to redirect the customer to when a deposit is completed. The default value is the website URL.

expirationTime
string <date-time>

Date and time at which the deposit request expires. The default expiration time is one hour from the time the request is created.

propertiesSchema
object or null

Defines properties the user can complete when they use the hosted deposit form. This field accepts JSON-schema drafts 4, 6, and 7.

object or null

Properties that are available for the user to complete when they use the hosted deposit form. Use this object to describe fields that are rendered and completed on the hosted deposit form.

property name*
additional property
string
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

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Enum: "self" "deposit" "transaction"
object

Embedded objects that are requested by the expand query parameter.

customer
object
website
object
transaction
object
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data sent.

post/deposit-requests
Request samples
application/json
{
  • "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
  • "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
  • "strategyId": "dep_str_0YVJ64MAHTDPA97H8S7R5MYR1M",
  • "currency": "USD",
  • "amounts": [
    ],
  • "customAmount": {
    },
  • "redirectUrl": "http://example.com",
  • "expirationTime": "2019-08-24T14:15:22Z",
  • "customPropertySetId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
}
Response samples
application/json
{
  • "id": "dep_req_0YVJ65BSGYC3EAT58SEX8KY6J7",
  • "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
  • "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
  • "transactionId": "txn_0YVDTQJ8YWDGQACV2N2N5SPWQ0",
  • "status": "created",
  • "currency": "USD",
  • "amounts": [
    ],
  • "customAmount": {
    },
  • "redirectUrl": "http://example.com",
  • "expirationTime": "2019-08-24T14:15:22Z",
  • "propertiesSchema": {
    },
  • "properties": {
    },
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ],
  • "_embedded": {
    }
}