Anchor | ||||
---|---|---|---|---|
|
Create Repeat Payment Using MOTO
using MOTO
Create a repeat payment schedule.
A schedule can either be on a Variable or Fixed basis
POST /pay/v1/repeat-payments
Headers
Content-Typestring
Content type.
Authorizationstring
Access token generated from create token request.
Attributes - (Required for all schedules)
payment_typestring
Repeat payment type. It must be either of the following values.
fixed_schedule
variable_schedule
payment_intentstring
Payment intent generated from create intent request.customer_namestring
Customer name.customer_emailstring
Customer email.
referencestring
Reference value. Unique textual paymentTokenstring
Tokenised card value. In create intent response, ccElement
will be returned in element array if repeat payment is enabled for that merchant account. User can populate ccElement
as a part of the create repeat request form to generate and pass paymentToken value. Please go through the process from payment page, to generate paymentToken.
customer_namestring
Customer name.
customer_emailstring
Customer email.
referencestring
Reference value. Unique textual details of the schedule
customer_addressstring
Customer address.
customer_postcodestring
Customer postcode.
currencystring
Currency that the payments will be processed in
Specific fields for a Fixed schedule - (These cannot be used in conjunction with the below Variable schedule specific fields)
frequencystring
Payment cycle frequency. It is required when creating a Fixed Schedule.
Possible values are
days
weeks
months
frequency_durationinteger
Payment frequency duration. It is required when creating a Fixed Schedule.
(E.g. “2” and “days” will be every 2 days)
start_payment_datedate
Date on which the first payment will be captured.
It is required when creating a Fixed Schedule.
Default value set to today.
first_amountdecimal (optional)
First payment amount.
When creating a Fixed Schedule, the first amount value can be customised.
recurring_amountdecimal
Recurring amount for each instalment. It is required when creating a Fixed Schedule.
is_limited_installments boolean
When creating a Fixed Schedule, it is required to mention if the process has schedule will have unlimited or limited instalments.
Possible values are
true
false
installmentsinteger
Number of instalmentsinstallments.
It is required when creating a Fixed Schedule if the process has limited instalments.final_amountdecimal ( is_limited_installments field is true (i.e. it has limited instalments)
If is_limited_installments is true, then these 2 fields can also be added |
---|
final_amountdecimal (optional) final_payment_datedate (optional) |
paymentTokenstring
Tokenised card value. In create intent response, ccElement
will be returned in element array if repeat payment is enabled for that merchant account. User can populate ccElement
as a part of the create repeat request form to generate and pass paymentToken value. Please go through the process from payment page, to generate paymentToken. If, repeat payment request is created form a existing transaction, then this value is not required.Specific fields for a Variable schedule - (This cannot be used in conjunction with any of the above Fixed schedule specific fields)
schedule_setarray
Schedule set is a array set of date and amount where the date will be the key and the amount will be its value.
It is required for Variable Schedule payment. This array needs to have minimum 2 set of values.
Request for fixed schedule
Code Block |
---|
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... { "payment_type": "fixed_schedule", "payment_intent": "pi_rj..........", "customer_name": "Test developer", "customer_email": "test@gmail.com", "reference": "schedule payment with limited installments", "customer_address": "Uk....", "customer_postcode": "119083", "frequency": "days", "frequency_duration": 1, "currency": "GBP", "first_amount": 20.03, "recurring_amount": 15.01, "final_amount": 10.08, "is_limited_installments": true, "installments": 3, "start_payment_date": "23-02-2023", "final_payment_date": "25-02-2023", "paymentToken": "ey............" } |
Response
Code Block |
---|
HTTP/1.1 201 Created Content-Type: application/json { "id": 123, "payment_type": "fixed_schedule", "status": "active", "customer_name": "Test developer", "customer_email": "test@gmail.com, "reference": "schedule payment with limited installments", "address": "Uk....", "postcode": "119083", "currency": "GBP", "start_payment_date": "23-02-2023", "final_payment_date": "25-02-2023", "recurring_amount": "15.01", "is_limited_installments": true, "installments": 3, "frequency": "days", "frequency_duration": 1, "is_active": "true", "recurring_data": { "recurring_id": 1, "payment_date": "23-02-2023", "reference": "Payment 1" "processed_amount": 20.03, "is_processed": true, "status": "captured", "xref": "AKY........." }, { "recurring_id": 2, "payment_date": "24-02-2023", "reference": "Payment 2" "processed_amount": 15.01, "is_processed": false, "status": "pending", "xref": "AKY........." }, { "recurring_id": 3, "payment_date": "25-02-2023", "reference": "Payment 3" "processed_amount": 10.08, "is_processed": false, "status": "pending", "xref": "AKY........." } } |
Request for variable schedule
Code Block |
---|
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... { "payment_type": "variable_schedule", "payment_intent": "pi_rj..........", "customer_name": "Test developer", "customer_email": "test@gmail.com", "reference": "variable schedule", "customer_address": "Uk....", "customer_postcode": "119083", "currency": "GBP", "paymentToken": "ey............", "schedule_set": { "13-02-2023": 20.02, "16-02-2023": 22.02, "25-02-2023": 26.02 } } |
Response
Code Block |
---|
HTTP/1.1 201 Created Content-Type: application/json { "id": 123, "payment_type": "variable_schedule", "status": "active", "customer_name": "Test developer", "customer_email": "test@gmail.com, "reference": "variable schedule", "address": "Uk....", "postcode": "119083", "currency": "GBP", "start_payment_date": "13-02-2023", "final_payment_date": "25-02-2023", "recurring_amount": null, "is_limited_installments": false, "installments": null, "frequency": "N/A" "frequency_duration": "N/A" "is_active": true, "recurring_data": { "recurring_id": 1, "payment_date": "13-02-2023", "reference": "Payment 1" "processed_amount": 20.02, "is_processed": true, "status": "captured", "xref": "AKY........." }, { "recurring_id": 2, "payment_date": "16-02-2023", "reference": "Payment 2" "processed_amount": 22.02, "is_processed": false, "status": "pending", "xref": "AKY........." }, { "recurring_id": 3, "payment_date": "25-02-2023", "reference": "Payment 3" "processed_amount": 26.02, "is_processed": false, "status": "pending", "xref": "AKY........." } } |
Anchor | ||||
---|---|---|---|---|
|
Create Repeat Payment Using ECOM
POST /pay/v1/repeatCreate a repeat payment schedule.
A schedule can either be on a Variable or Fixed basis
POST /pay/v1/repeat-payments
Headers
Headers
Content-Typestring
Content type.
Authorizationstring
Access token generated from create token request.
User-Agentstring
User agent.
Acceptstring
Accept
Accept-Encodingstring
Accept encoding.
Accept-Charsetstring
Accept charset.
Attributes - (required for all schedules)
payment_typestring
Repeat payment type. It must be either of the following values.
fixed_schedule
variable_schedule
payment_intentstring
Payment intent generated from create intent request.
paymentTokenstring
Tokenised card value. In create intent response, ccElement
will be returned in element array if repeat payment is enabled for that merchant account. User can populate ccElement
as a part of the create repeat request form to generate and pass paymentToken value. Please go through the process from payment page, to generate paymentToken.
customer_namestring
Customer name.
customer_emailstring
Customer email.
referencestring
Reference value. Unique textual details of the schedule
customer_addressstring
Customer address.
customer_postcodestring
Customer postcode.
currencystring
Currency that the payments will be processed in
Specific fields for a Fixed schedule - (These cannot be used in conjunction with the below Variable schedule specific fields)
frequencystring
Payment cycle frequency. It is required when creating a Fixed Schedule.
Possible values are
days
weeks
months
frequency_durationinteger
Payment frequency duration. It is required when creating a Fixed Schedule.
(E.g. “2” and “days” will be every 2 days)
start_payment_datedate
Date on which the first payment will be captured.
It is required when creating a Fixed Schedule.
Default value set to today.
first_amountdecimal (optional)
First payment amount.
When creating a Fixed Schedule, the first amount value can be customised.
recurring_amountdecimal
Recurring amount for each instalment. It is required when creating a Fixed Schedule.
is_limited_installments boolean
When creating a Fixed Schedule, it is required to mention if the process has schedule will have unlimited or limited instalments.
Possible values are
true
false
installmentsinteger
Number of instalmentsinstallments.
It is required when creating a Fixed Schedule if the process is_limited_installments field is true (i.e. it has limited instalments.)
If is_limited_installments is true, then these 2 fields can also be added |
---|
final_amountdecimal (optional) final_payment_datedate (optional) |
paymentTokenstring
Tokenised card value. In create intent response, ccElement
will be returned in element array if repeat payment is enabled for that merchant account. User can populate ccElement
as a part of the create repeat request form to generate and pass paymentToken value. Please go through the process from payment page, to generate paymentToken. If, repeat payment request is created form a existing transaction, then this value is not required.Specific fields for a Variable schedule - (This cannot be used in conjunction with any of the above Fixed schedule specific fields)
schedule_setarray
Schedule set is a array set of date and amount where the date will be the key and the amount will be its value.
It is required for Variable Schedule payment. This array needs to have minimum 2 set of values.
Specific fields for ECOM
device_timezoneinteger
Device timezone value which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
device_capabilitiesstring
Device capabilities which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
device_accept_languagestring
Device accept language which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
device_screen_resolutionstring
Device accept language which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
remote_addressstring
Remote address which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
Request for fixed schedule
Code Block |
---|
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... User-Agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36", Accept: "*/*" Accept-Encoding: "gzip, deflate, br" Accept-Charset: "" { "payment_type": "fixed_schedule", "payment_intent": "pi_rj..........", "customer_name": "Test developer", "customer_email": "test@gmail.com", "reference": "fixed schedule payment with unlimited installments", "customer_address": "Uk....", "customer_postcode": "119083", "frequency": "days", "frequency_duration": 1, "currency": "GBP", "recurring_amount": 15.01, "is_limited_installments": false, "start_payment_date": "23-02-2023", "paymentToken": "ey............", "device_timezone" : "-330", "device_capabilities" : "javascript", "device_accept_language" : "en-GB", "device_screen_resolution" : "1366x768x24", "remote_address" : "123.123.123.123" } |
Response
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json { "acsform": "<form id="form3ds22" method="post" action="https://acs.********"><input type="hidden" name="creq" value="********"> <input type="hidden" name="threeDSPageSessions[427**************][bfreq]" value="*******"> <input type="hidden" name="threeDSPageSessions[427**************][threeDSRef]" value="****"> <input id="btnSubmit" type="submit" class="button expanded btn btn-primary" value="Process Payment"> </form>" } |
HTML Page
Code Block |
---|
<!DOCTYPE html> <html> <head> <script> onload = () => document.forms[0].submit(); </script> </head> <body> <form id="form3ds22" method="post" action="https://acs.********"><input type="hidden" name="creq" value="********"> <input type="hidden" name="threeDSPageSessions[427**************][bfreq]" value="*******"> <input type="hidden" name="threeDSPageSessions[427**************][threeDSRef]" value="****"> <input id="btnSubmit" type="submit" class="button expanded btn btn-primary" value="Process Payment"> </form> </body> </html> |
Request for variable schedule
Code Block |
---|
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... User-Agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36", Accept: "*/*" Accept-Encoding: "gzip, deflate, br" Accept-Charset: "" { "payment_type": "variable_schedule", "payment_intent": "pi_rj..........", "customer_name": "Test developer", "customer_email": "test@gmail.com", "reference": "variable schedule payment with 3ds", "customer_address": "Uk....", "customer_postcode": "119083", "currency": "GBP", "paymentToken": "ey............", "device_timezone" : "-330", "device_capabilities" : "javascript", "device_accept_language" : "en-GB", "device_screen_resolution" : "1366x768x24", "remote_address" : "123.123.123.123", "schedule_set": { "13-02-2023": 20.02, "16-02-2023": 22.02, "25-02-2023": 26.02 } } |
Response
Code Block |
---|
HTTP/1.1 201 Created Content-Type: application/json { "id": 123, "payment_type": "variable_schedule", "status": "active", "customer_name": "Test developer", "customer_email": "test@gmail.com, "reference": "variable schedule payment with 3ds", "address": "Uk....", "Postcode": "119083", "currency": "GBP", "start_payment_date": "13-02-2023", "final_payment_date": "25-03-2023", "recurring_amount": 20.02, "is_limited_installments": true, "installments": 12, "frequency": "N/A" "frequency_duration": "N/A" "is_active": true, "recurring_data": { "recurring_id": 1, "payment_date": "13-02-2023", "reference": "Payment 1" "processed_amount": 20.02, "is_processed": true, "status": "accepted", "xref": "AKY........." }, { "recurring_id": 2, "payment_date": "16-03-2023", "reference": "Payment 2" "processed_amount": 22.02, "is_processed": true, "status": "declined", "xref": "AKY........." }, { "recurring_id": 3, "payment_date": "25-03-2023", "reference": "Payment 3" "processed_amount": 26.02, "is_processed": false, "status": "pending", "xref": "AKY........." } } |
Anchor | ||||
---|---|---|---|---|
|
Get all repeat payments
Get the details of all the repeat payments payment schedules created from the same merchant account.
Results
The results can be filtered by using the below query parameters. payment_type
need to be passed as query param without which result the results can't be fetched.
GET /pay/v1/pay/repeat-payments
Headers
Content-Typestring
Content type.
Authorizationstring
Access token generated from create token request.
Query parameters
payment_typestring
Repeat payment type.
fixed_schedule
variable_schedule
pageinteger (optional)
Page Number.
statusstring (optional)
Repeat payment status.
Active - This means the payments have started
Pending - This means the first payment has not yet been processed
Cancelled - This means the schedule has been cancelled. No further payments will be processed
Completed - This means all the payments have been processed. No further payments will be processed
Request
Code Block |
---|
GET https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments?payment_type=variable_schedule&status=active&page=1&payment_type=variable_schedule HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... |
Response
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json { "pageNumber": 1, "pageSize": 50, "totalResults": 7, "data": [ { "id": 8, "payment_type": "variable_schedule", "status": "Active", "customer_name": "customername here", "customer_email": "email@gmail.co.uk", "reference": "Variable schedule test", "address": "2", "postcode": "3", "currency": "GBP", "start_payment_date": "19-02-2024", "final_payment_date": "21-02-2024", "recurring_amount": null, "is_limited_installments": false, "installments": null, "frequency": "N/A", "frequency_duration": "N/A", "is_active": true, "recurring_data": [ { "recurring_id": 190, "payment_date": "2024-02-19", "reference": "Payment 1", "processed_amount": "21.02", "is_processed": true, "status": "Captured", "xref": "AKY........." }, { "recurring_id": 191, "payment_date": "2024-02-20", "reference": "Payment 2", "processed_amount": "1.02", "is_processed": false, "status": "Pending", "xref": "AKY........." }, { "recurring_id": 192, "payment_date": "2024-02-21", "reference": "Payment 3", "processed_amount": "23.02", "is_processed": false, "status": "Pending", "xref": "AKY........." } ] } ] |
Anchor | ||||
---|---|---|---|---|
|
Get repeat payment
Get details of a specific repeat payment schedule using id.
GET /pay/v1/pay/repeat-payments/{id}
Headers
Content-Typestring
Content type.
Authorizationstring
Access token generated from create token request.
Query parameters
payment_typestring
Repeat payment type.
fixed_schedule
variable_schedule
Request
Code Block |
---|
GET https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/123?payment_type=fixed_schedule HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... |
Response
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json { "id": 123, "payment_type": "fixed_schedule", "status": "active", "customer_name": "Test developer", "customer_email": "test@gmail.com, "reference": "test payment ......", "address": "Uk....", "Postcode": "119083", "Currency": "GBP", "start_payment_date": "23-02-2023", "final_payment_date": "25-03-2023", "recurring_amount": 20.02, "is_limited_installments": true, "installments": 3, "frequency": "days", "frequency_duration": 1, "is_active": true, "recurring_data": { "recurring_id": 1, "payment_date": "232024-02-202323", "reference": "Payment 1" "processed_amount": 20.02, "is_processed": true, "status": "captured" "xref": "eygh...." }, { "recurring_id": 2, "payment_date": "24-02-2023", "reference": "Payment 2" "processed_amount": 20.02, "is_processed": false, "status": "pending" "xref": "eygh...." }, { "recurring_id": 3, "payment_date": "25-02-2023", "reference": "Payment 3" "processed_amount": 20.02, "is_processed": false, "status": "removed" "xref": "eygh...." } } |
Delete-a-scheduled-payment/Cancel-all-remaining-payments
Delete a specific future recurring payment of a Repeat schedule using recurring id (fetched from get repeat payment request.)
This will delete the future payment from both fixed and variable schedules.The
recurring_id
needs to be passed along with the main id
(repeat schedule id) in request url to delete any specific recurring payment. If the
recurring_id
is not passed then it will delete all the future recurring payments of that schedule.DELETE /pay/v1/repeat-payments/{id}
Headers
Content-TypestringContent type.Authorizationstring
Access token generated from create token request.
Attributes
payment_typestringRepeat payment type. It must be either of the following values. It is passed to identify the type of the specific repeat payment.
fixed_schedule
variable_schedule
Recurring id is need to be passed to delete a specific recurring event of Fixed and Variable schedule payment.
Request
Code Block |
---|
DELETE https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/{id} HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... {"xref": "eygh...." }, { "recurring_id": 2, "payment_date": "2024-02-24", "reference": "Payment 2" "processed_amount": 20.02, "is_processed": false, "status": "pending" "xref": "eygh...." }, { "recurring_id": 3, "payment_typedate": "fixed_schedule2024-02-25", "recurring_idreference": 123 } |
Response
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json {"Payment 3" "processed_amount": 20.02, "successis_processed": truefalse, "messagestatus": "Deleted successfully" } |
Refund any processed repeat payment using repeat schedule id and recurring id.
In this scenario, id
(repeat schedule id) need to be passed in request url along with recurring_id
and payment_type
in request body.
captured
or completed
status removed"
"xref": "eygh...."
}
} |
Anchor | ||||
---|---|---|---|---|
|
Delete a scheduled payment/Cancel all remaining payments
This can be used:
To delete a schedule and all its remaining payments that havent been processed yet, using just the main schedule
id
To delete a specific future payment from a schedule, using the
id
and therecurring_id
The schedule id
and recurring_id
can be fetched from get repeat payment request.
This will delete the future payment from both fixed and variable schedules.
DELETE /pay/v1/repeat-payments/cancel/{id}
Headers
Content-Typestring
Content type.
Authorizationstring
Access token generated from create token request.
Attributes
payment_typestring
Repeat payment type. It must be either of the following values. It is passed to identify the type of the specific repeat payment.
fixed_schedule
variable_schedule
recurring_idinteger (optional)
Recurring id needs is need to be passed to refund delete a specific payment from a Fixed or recurring event of Fixed and Variable schedule payment.
Request
Code Block |
---|
DELETE https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/cancel/{id} HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG...
{
"payment_type": "fixed_schedule",
"recurring_id": 123
} |
Response
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json { "success": true, "message": "CancelledDeleted successfully" } |
Anchor |
---|
|
|
Refund a processed payment
that failedRetry Refund any specific payment which was able to run on the scheduled day but returned a declined status due to some issue for that Repeat schedule.
This will run the payment for both fixed and variable schedulesprocessed repeat payment using repeat schedule id and recurring id.
In this scenario, the recurring_id
(fetched from get repeat payment requestrepeat schedule id) needs to be passed along in the request url, with the id
(repeat schedule id) in request url.
POST recurring_id
and payment_type
in the request body.
This request can be used to refund a processed payment that has a captured
or completed
status
DELETE /pay/v1/repeat-payments/retrycancel/{id}
Headers
Content-Typestring
Content type.
Authorizationstring
Access token generated from create token request.
Attributes
payment_typestring
Repeat payment type. It must be either of the following values. It is passed to identify the type of the specific repeat payment.
fixed_schedule
variable_schedule
recurring_idinteger
Recurring id needs to be passed to retry refund a specific payment from a Fixed or Variable schedule.
Request
Code Block |
---|
POSTDELETE https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/retrycancel/{id} HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... { "payment_type": "fixed_schedule", "recurring_id": 123 } |
Response
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json { "success": true, "message": "Payment retriedCancelled successfully" } |
Anchor |
---|
|
|
The new card details will be used to action all the future payments of that schedule
Retry a processed payment that failed
Retry any specific payment which was able to run on the scheduled day but returned a declined status due to some issue for that Repeat schedule.
This will run the payment for both fixed and variable schedules.
In this scenario, the paymentToken
need recurring_id
(fetched from get repeat payment request) needs to be passed in the body, along with the id
(repeat schedule id) in the request url. (Payment token should be fetched in same way by populating a hosted payment page using ccElement
from Create intent request)
POST/pay/v1/repeat-payments/cardretry/{id}
Headers
Content-Typestring
Content type.
Authorizationstring
Access token generated from create token request.
Attributes
payment_typestring
Repeat payment type. It must be either of the following values. It is passed to identify the type of the specific repeat payment.
fixed_schedule
variable_schedule
paymentTokenstring
Payment token is need recurring_idinteger
Recurring id needs to be passed to add any new card for Fixed and retry a specific payment from a Fixed or Variable schedule.
Request
Code Block |
---|
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/cardretry/{id} HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... { "payment_type": "fixed_schedule", "paymentTokenrecurring_id": "ey............."123 } |
Response
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json { "success": true, "message": "CardPayment retried updatedsuccessfully" } |