Deposits

Create and manage deposit requests and manage strategies that determine the deposit amounts to display on the page. Rebilly hosted deposit form provides a secure and compliant way to deposit funds. Deposit forms are customizable, and use fully responsive design, built-in error messaging and validation.

Important: These operations are experimental and may change.

Create a deposit request
Experimental

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.

Security
SecretApiKey or JWT
Bodyapplication/jsonrequired

Deposit request resource.

websiteIdstring, <= 50 charactersrequired

ID of the website associated with the deposit.

Example:"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"
customerIdstring, <= 50 characters(CustomerId)required

ID of the customer resource.

Example:"cus_0YV7DDSDD1C8DA64KHH2W33CPF"
strategyIdstring or null, <= 50 characters

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

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

For more information, see Create a deposit amount strategy.

Example:"dep_str_0YVJ64MAHTDPA97H8S7R5MYR1M"
currencystring, = 3 characters(CurrencyCode)required

Currency code in ISO 4217 format.

Example:"USD"
amountsArray of numbers or null

List of available deposit amounts.

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

amountLimitsobject or null, non-empty

Deposit amount limit information. Set optional minimum and maximum deposit amounts. Limits override amounts and customAmount values. If this value is null, deposit amount limits are not set.

customAmountobject 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 deposit amount strategy. For more information, see the strategyId property.

redirectUrlstring or null, (uri), <= 2083 characters

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

expirationTimestring or null, (date-time)

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

customPropertySetIdstring or null, <= 50 characters

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

Example:"4f6cf35x-2c4y-483z-a0a9-158621f77a21"
notificationUrlstring or null, (uri), <= 2083 characters

URL where a server-to-server POST notification is sent. This notification is sent when the transaction result is finalized after a timeout or an offsite interaction.

Do not interpret this notification as a confirmation, complete a GET request to confirm the result of the transaction. To ensure the request is not reattempted, when the result is confirmed, respond with a 2xx HTTP status code.

The following placeholders are available to use in this URI: {id} and {result}. These placeholders are replaced the with the transaction ID and result accordingly.

curl -i -X POST \
  https://www.rebilly.com/_mock/catalog/all/deposit-requests \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
    "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
    "strategyId": "dep_str_0YVJ64MAHTDPA97H8S7R5MYR1M",
    "currency": "USD",
    "amounts": [
      0.01
    ],
    "amountLimits": {
      "minimum": 0,
      "maximum": 0
    },
    "customAmount": {
      "minimum": 0.01,
      "multipleOf": 0.01,
      "maximum": 0.01
    },
    "redirectUrl": "http://example.com",
    "expirationTime": "2019-08-24T14:15:22Z",
    "customPropertySetId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
    "notificationUrl": "http://example.com"
  }'

Responses

Deposit request created.

Headers
Locationstring, (uri)

Location of the related resource.

Example:"https://api.rebilly.com/example"
X-RateLimit-Limitinteger

Total number of rate limit tokens for this request within a rate limit period. For more information, see Rate limits.

Example:3600
X-RateLimit-Remaininginteger

Remaining number of rate limit tokens for this request within the rate limit period. For example, in the sandbox environment, rate limits for non-GET endpoints are set at 3000 requests per 10 minutes.

Example:3600
Bodyapplication/json
idstring, <= 50 charactersread-only

ID of the deposit request.

Example:"dep_req_0YVJ65BSGYC3EAT58SEX8KY6J7"
websiteIdstring, <= 50 charactersrequired

ID of the website associated with the deposit.

Example:"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"
customerIdstring, <= 50 characters(CustomerId)required

ID of the customer resource.

Example:"cus_0YV7DDSDD1C8DA64KHH2W33CPF"
transactionIdsArray of strings

List of transaction IDs that are associated with the deposit request. This list includes transactions that are created from the deposit request. There is a maximum of one approved transaction in the list.

statusstringread-only

Status of the request.

Enum ValueDescription
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.

initiated

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

attempted

A funds deposit transaction was attempted and declined. This is a temporary state.

completed

A funds deposit transaction has been approved and completed. This is a permanent state.

expired

Request expired without an approved deposit transaction. This is a permanent state.

coinPurchasebooleanread-only

Specifies if the deposit is a coin purchase that credits the coin balance instead of the cash balance. Determined by the deposit amount strategy that is applied to the deposit request.

currencystring, = 3 characters(CurrencyCode)required

Currency code in ISO 4217 format.

Example:"USD"
amountsArray of numbers

List of available deposit amounts.

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

defaultAmountnumber or null, (double), >= 0.01

Value of the default amount in the amounts list. This value is calculated from the defaultIndex property of the deposit strategy that is applied to the deposit request.

customAmountobject 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.

redirectUrlstring, (uri), <= 2083 characters

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

expirationTimestring, (date-time)

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

propertiesSchemaobject or nullread-only

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

Example:
{ "type": "object", "properties": { "email": {}, "max": {} }, "required": [ "email" ] }
propertiesobject or nullread-only

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.

Example:
{ "email": "email@example.com", "max": "33" }
notificationUrlstring or null, (uri), <= 2083 characters

URL where a server-to-server POST notification is sent. This notification is sent when the transaction result is finalized after a timeout or an offsite interaction.

Do not interpret this notification as a confirmation, complete a GET request to confirm the result of the transaction. To ensure the request is not reattempted, when the result is confirmed, respond with a 2xx HTTP status code.

The following placeholders are available to use in this URI: {id} and {result}. These placeholders are replaced the with the transaction ID and result accordingly.

cashierTokenstring or nullread-only

JSON Web Token (JWT) used to complete the deposit request. This value is null if the deposit request is expired or completed.

customFieldsobject(ResourceCustomFields)

Custom fields related to the deposit request. Custom field values are copied to created transactions if matching custom fields (name, type) exist.

Default:{}
Example:
{ "foo": "bar" }
createdTimestring, (date-time)(CreatedTime)read-only

Date and time when the resource is created. This value is set automatically when the resource is created.

updatedTimestring, (date-time)(UpdatedTime)read-only

Date and time when the resource is updated. This value is set automatically when the resource is updated.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
{ "id": "dep_req_0YVJ65BSGYC3EAT58SEX8KY6J7", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "transactionIds": [ "string" ], "status": "created", "coinPurchase": true, "currency": "USD", "amounts": [ 0.01 ], "defaultAmount": 0.01, "customAmount": { "minimum": 0.01, "multipleOf": 0.01, "maximum": 0.01, "buttonText": {} }, "redirectUrl": "http://example.com", "expirationTime": "2019-08-24T14:15:22Z", "propertiesSchema": { "type": "object", "properties": {}, "required": [] }, "properties": { "email": "email@example.com", "max": "33" }, "notificationUrl": "http://example.com", "cashierToken": "string", "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "customer": {}, "website": {}, "transactions": [] } }