ApiMandates class provides methods to create and manage direct debit mandates, which authorize recurring payments from a bank account.
Methods
Create
Create a new mandate.The Mandate object to create
Optional idempotency key for safe retries
\MangoPay\Mandate - The created Mandate object
Example:
Get
Get a mandate by its ID.The unique identifier of the mandate
\MangoPay\Mandate - The Mandate object
Example:
Cancel
Cancel an active mandate.The ID of the mandate to cancel
\MangoPay\Mandate - The updated Mandate object
Example:
GetAll
Retrieve all mandates.Pagination object (passed by reference)
Filtering options
Sorting options
\MangoPay\Mandate[] - Array of Mandate objects
Example:
GetTransactions
Retrieve all transactions for a specific mandate.The ID of the mandate
Pagination object (passed by reference)
Filtering options
Sorting options
\MangoPay\Transaction[] - Array of Transaction objects
Example:
To get mandates for a specific user, use
$api->Users->GetMandates($userId, $pagination, $sorting)Mandate Entity
TheMandate entity represents a direct debit mandate authorization.
Properties
The unique identifier of the mandate
Unix timestamp of when the mandate was created
Custom data for your use
The ID of the bank account to associate with this mandate
The ID of the user who owns the mandate
The mandate scheme type:
SEPA or BACS (completed once mandate is submitted)The language for the mandate confirmation page:
EN, FR, NL, DE, ES, IT, PL, PTThe URL to view/download the mandate document
The URL to redirect the user to for mandate confirmation
The URL where the user is redirected after mandate confirmation
The status of the mandate:
CREATED, SUBMITTED, ACTIVE, FAILED, EXPIREDThe result code of the mandate
The result message explaining the result code
The type of mandate:
DIRECT_DEBITHow the mandate is created:
WEBThe unique bank reference for the mandate
Mandate Flow
Step 1: Create the Mandate
Step 2: User Confirmation
Step 3: Check Mandate Status
Step 4: Use the Mandate for Direct Debit Pay-ins
SEPA vs BACS Mandates
SEPA (Single Euro Payments Area)
- Used for bank accounts in the European Economic Area
- Supports EUR currency
- Scheme is determined automatically based on bank account country
BACS (Bankers’ Automated Clearing Services)
- Used for bank accounts in the United Kingdom
- Supports GBP currency
- Scheme is determined automatically based on bank account country
Once a mandate is
ACTIVE, it can be used for multiple direct debit pay-ins until it expires or is canceled.