Top up by direct debit

Resources

The recovery of direct debit top-up can be done through:

- /api/[domaine_partenaire]/users/AppUserId/payins/directdebits
OR
- /api/[domaine_partenaire]/users/AppUserId/mandates/mandateid/directdebits

1.DirectDebits

Contains the information about a direct debit top-up

Property Type Example Description
Id Long 123 Top-up ID
OrderId String xh02 Payment identifier in the third-party application
CreationDate DateTime 2014-01-10T15:49:58. 791121+02:00 Top-up creation date
PaymentDate DateTime 2014-01-13T00:00:00. 000000+02:00 Expected date of a top-up (between 3 and 6 business days from the creation date)
Amount Long 2350 Top-up amount (in cents)
Fee Long Fee amount (the property "amount" does not include the fee amount)
Status Int 1 Top-up status
0 = Waiting
1 = Completed
2 = Refunded
3 = Failed
4 = Waiting for validation
5 = Cancelled
Beneficiary SubAccountRef Item containg the details of the recipient sub-account. If not precised, it is the main account of the connected user which is used
IsMine Bool True True if the account holder is also the bank account holder (it is a top-up, and not a payment)
Message String Payment message (limited to 140 caracters)
Mandate MandateRef Mandate reference used for direct debit
Schedules PaymentSchedule Table of installments (more installments for direct debit)
Motif String echeance-avril Reason for the debit

2.SubaccountRef

This item allows to identify the accounts between which the operations are made.

Property Type Example Description
Id Long 98 Account identifier
AppAccountId String "123" Account identifier provided by the third-party application
DisplayName String "Jean Dupont" Display account name
Href Uri "/api/[domainePartenaire] /accounts/123" Uri for the account details

3.BankAccountRef

This item allows to identify the user’s bank account.

Property Type Example Description
Id Long 98 Bank account identifier
Href Uri "/api/[domainePartenaire]
/bankaccounts/98"
Uri for details of the bank account

4.MandateRef

This item allows to identify a direct debit mandate

Property Type Example Description
Id Long 45 Mandate ID
Href Uri "/api/[domainePartenaire]
/mandates/45"
Uri for mandate details

Create a direct debit top-up

To create a direct debit top-up, please have a look at the example in the right margin.

The mandatory parameters are:
- orderid
- mandate
- amout
-  ismine

Precision : Expect a delay between the debit of the paying bank account and the credit of the beneficiary user account.

Send the data of the top-up made by a third-party server

The third-party server needs to provide the S-money server with an url server, so that the S-money server can communicate the direct debit top-up validation (within 3 to 6 business days).

The HTTP POST method is used to invoke the S-money server.

The parameters of the HTTP request are:

Parameters Type Description
id string Transfer operation reference in the third-party application (orderid)
error Int Error code for failed payments, 0, if no errors.
type Int Operation type
7 = direct debit top-up
status Int Operation status
-1 = unknown
0 = en attente
1 = completed
2 = refunded
3 = refused
4 = waiting for validation
sequencenumber Int Direct debit sequence number (if multiple direct debit)
userid String User identifier in the third-party application
userstatus Int User status
0 = Not confirmed
1 = OK
2 = Frozen
3 = On the fly
4 = Being closed
5 = Closed

Retrieve the list of direct debit top-ups

To retrieve the list of direct debit top-ups, please have a look at the example in the right margin.

To retrieve the list of direct debit top-ups on a domain-level, the URL will be:
GET /api/[domaine_partenaire]/payins/directdebits

To retrieve the list of a user direct debit top-ups, the URL will be:
GET /api/[domaine_partenaire]/users/appuserid/payins/directdebits

Retrieve a direct debit top-up

To retrieve a direct debit top-up, please have a look at the example in the right margin.

To retrieve a direct debit top-up on a domain-level, the URL will be: GET/api/[domaine_partenaire]/payins/directdebits

To retrieve a user direct debit top-up, the URL will be:
Pour récupérer le chargement par prélèvement d’un utilisateur, l’URL sera : GET/api/[domaine_partenaire]/users/appuserid/payins/directdebits

Error cases:

HTTP code Error code Explication
404 356 Operation cannot be found

Cancel a direct debit

To cancel a direct debit, please have a look at the example in the right margin.

Error cases

HTTP codeError codeExplication
404 356 Operation cannot be found

Modify a direct debit

To modify a direct debit, please have a look at the example in the right margin.

Error cases

HTTP codeError codeExplication
404 356 Operation cannot be found