PayAdvantage 12.1.12


Apply a template to multiple direct debits

New endpoint: POST /v3/direct_debit_templates/{code}/applications

Applies a template's current version to a list of active direct debits. Requires the direct_debit_write permission, and the merchant must have direct debit templates enabled.

Request body

FieldTypeRequiredDescription
directDebitCodesstring[]YesCodes of the active direct debits to apply the template to. At least one.
dryRunbooleanNoWhen true, returns the result for each direct debit without changing anything. Defaults to false.
{
  "directDebitCodes": ["AB12CD", "EF34GH"],
  "dryRun": true
}

Behaviour

  • Dry run (dryRun: true): nothing changes. Every requested direct debit gets a pass, warn or fail result. Unknown or ineligible codes come back as fail rows, not an error.
  • Apply (dryRun omitted or false): all or nothing. If any direct debit fails a rule, the whole request is rejected with 422 naming the failing codes, and nothing is applied. Customers whose recurring amount or frequency changes are emailed the new details.
  • An unknown template returns 404. A fixed-total or yearly template returns 422.

Response

FieldTypeDescription
results[].codestringThe direct debit code.
results[].statusstringpass, warn or fail.
results[].reasonstringWhy, for warn or fail.
results[].currentRecurringAmountdecimalRecurring amount before the template is applied.
results[].currentFrequencystringFrequency before the template is applied.
results[].afterRecurringAmountdecimalRecurring amount once the template is applied.
results[].afterFrequencystringFrequency once the template is applied.

Payment descriptions increased to 100 characters

The maximum payment description length has increased from 50 to 100 characters. This change is backward compatible: descriptions of 50 characters or fewer work as before.

Affected endpoints

EndpointField
POST /v3/payment_requestsdescription
PATCH /v3/payment_requests/{code}description
POST /v3/credit_cards/{code}/chargesdescription
POST /v3/credit_card_iframesdescription
POST /v3/payment_iframesdescription
POST /v3/pay_idsdescription
POST /v3/direct_debitsdescription
POST /v3/direct_debit_templatesddrDescription
PATCH /v3/direct_debit_templates/{code}ddrDescription

Validation

A description longer than 100 characters returns 400:

Description exceeds the maximum length of 100 characters.