SpareSpare Docs
GuidesAPI Reference

Variable On Demand

Instructions fields for VariableOnDemand on POST /payment-requests.

VariableOnDemand creates a mandate where the payer pre-authorizes up to a max amount per debit, and you trigger each debit later. Payments can be initiated at any time within the consent window. There is no fixed payment date list.

Shared root fields (type, creditorAccount, redirects, and the rest) live on the Payment Request Deep Dives intro. This page covers Variable On Demand instructions and the type-specific root field additionalCreditorAccounts.

The schedule object is the same shape as Fixed On Demand, except periodicSchedule takes maxAmount instead of amount.

When To Use

Use VariableOnDemand when each debit amount can vary up to a defined maximum, and you initiate payments at any time after the payer authorizes the consent. There is no fixed payment date list.

Typical products:

  • Account sweeping
  • Cab booking and similar apps that charge when a trip completes
  • Point-of-sale or in-app purchases where amount and timing depend on the payer's activity

For a fixed amount with the same trigger model, use Fixed On Demand.

Example use cases

Account sweeping (round-up). A payer enrolls in a sweeping service. After each transaction on their current account, you transfer the difference up to the nearest AED 10 into their savings account at another bank. The payer sets a savings goal of AED 5,000 and a weekly cap of AED 100.

Point of sale. A coffee shop offers Open Finance checkout. The payer authorizes a VariableOnDemand consent once. Each purchase triggers a debit for that order amount, subject to a maximum individual payment and a daily spending limit.

Controlled financial support. A payer sets a monthly allowance of AED 2,500 for a family member. The family member can draw that amount in one debit or several smaller ones. After the monthly limit is reached, further requests wait until the next monthly period starts (for example on the 4th of each month).

Type-Specific Root Fields

FieldPresenceDescription
additionalCreditorAccountsOptionalExtra creditor accounts beyond creditorAccount. Only valid on VariableOnDemand. Primary + additional must total at most 10. Each account must be unique by scheme + identification.

Instructions

FieldPresenceDescription
periodicScheduleRequiredConsent window, max debit amount, rolling period (frequency), and controls.
maxCumulativeAmountConditionalMaximum cumulative value of payments over the lifetime of the consent. When set, must be greater than periodicSchedule.maxAmount. Counts toward the minimum control set below.
maxCumulativeNumberOfPaymentsOptionalMaximum cumulative number of payments over the lifetime of the consent. Must be greater than zero when set. This lifetime count is separate from the per-period control set.

Minimum control set

You must provide at least two of these three parameters:

  1. maxCumulativeAmount
  2. controls.maxCumulativeAmountPerPeriod (must be greater than periodicSchedule.maxAmount)
  3. controls.maxCumulativeNumberOfPaymentsPerPeriod

periodicSchedule

FieldPresenceDescription
frequencyRequiredRolling period for controls: Day, Week, Month, or Year. Limits in controls reset at the start of each new period.
startDateRequiredMandate window start. May be today or a future date.
endDateRequiredInclusive end bound. Must be after startDate and in the future.
maxAmountRequiredCeiling for each triggered debit. Must be greater than zero.
controlsRequiredRolling per-period limits. Supply the fields needed to meet the minimum control set above.

controls (rolling period)

controls applies to on-demand types only. It sets limits for one frequency period. When that period ends, the counters reset and the same limits apply again.

Example: frequency is Week and maxCumulativeAmountPerPeriod is AED 100. Within that week you may initiate debits up to AED 100 in total. Anything beyond AED 100 in the same week is rejected. The AED 100 allowance resets at the start of the next week.

FieldPresenceDescription
maxCumulativeAmountPerPeriodConditionalMaximum cumulative value of payments within the defined period. When set, must be greater than zero and greater than periodicSchedule.maxAmount.
maxCumulativeNumberOfPaymentsPerPeriodConditionalMaximum cumulative number of payments within the defined period. When set, must be greater than zero.

Example Request

Complete body for a Variable On Demand balance sweep. The example meets the minimum control set with maxCumulativeAmount and maxCumulativeAmountPerPeriod.

{
  "type": "VariableOnDemand",
  "creditorType": "MERCHANT",
  "creditorReference": "SWEEP01",
  "merchantReference": "vod-sweep-01",
  "purpose": "GDDS",
  "creditorAccount": {
    "schemeName": "IBAN",
    "identification": "AE070331234567890123456",
    "name": "Acme Trading LLC"
  },
  "additionalCreditorAccounts": [
    {
      "schemeName": "IBAN",
      "identification": "AE070331234567890123457",
      "name": "Acme Settlements LLC"
    }
  ],
  "successRedirectUrl": "https://merchant.example/payments/success",
  "failureRedirectUrl": "https://merchant.example/payments/failure",
  "instructions": {
    "maxCumulativeNumberOfPayments": 20,
    "maxCumulativeAmount": { "amount": "200.00", "currency": "AED" },
    "periodicSchedule": {
      "frequency": "Week",
      "startDate": "2026-08-12",
      "endDate": "2027-08-01",
      "maxAmount": { "amount": "50.00", "currency": "AED" },
      "controls": {
        "maxCumulativeAmountPerPeriod": { "amount": "100.00", "currency": "AED" }
      }
    }
  }
}

What Fails

Spare rejects the create when:

  • additionalCreditorAccounts is set on any type other than VariableOnDemand
  • Primary plus additionalCreditorAccounts total more than 10 accounts
  • An account in additionalCreditorAccounts duplicates creditorAccount or another additional entry by scheme + identification
  • periodicSchedule is missing
  • frequency, startDate, endDate, or maxAmount is missing inside periodicSchedule
  • maxAmount is zero or negative
  • fewer than two of maxCumulativeAmount, maxCumulativeAmountPerPeriod, and maxCumulativeNumberOfPaymentsPerPeriod are provided
  • maxCumulativeAmountPerPeriod is set and is not greater than periodicSchedule.maxAmount
  • maxCumulativeAmount is set and is not greater than periodicSchedule.maxAmount
  • root maxCumulativeAmount is negative
  • controls.maxCumulativeAmountPerPeriod is set to zero or a negative value
  • maxCumulativeNumberOfPayments or a per-period count cap is set to zero or a negative value
  • startDate is in the past
  • endDate is on or before startDate, or is not in the future
  • isInternationalPayment is true (not supported on this type)

See Error codes for response shapes.

On this page