Create Repeat Payment Using MOTO
POST /pay/v1/repeat-payments
Headers
Content-Type string
Content type.
Authorization string
Access token generated from create token request.
Attributes
payment_type string
Repeat payment type. It must be either of the following values.
fixed_schedule
variable_schedule
payment_intent string
Payment intent generated from create intent request.
customer_name string
Customer name.
customer_email string
Customer email.
reference string
Reference value. Unique textual details of the schedule
customer_address string
Customer address.
customer_postcode string
Customer postcode.
currency string
Currency that the payments will be processed in
frequency string
Payment cycle frequency. It is required when creating a Fixed Schedule.
Possible values are
days
weeks
months
frequency_duration integer
Payment frequency duration. It is required when creating a Fixed Schedule.
start_payment_date date
Date on which the first payment will be captured. It is required when creating a Fixed Schedule.
Default value set to today.
first_amount decimal (optional)
First payment amount.
When creating a Fixed Schedule, the first amount value can be customised.
recurring_amount decimal
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 unlimited or limited instalments.
Possible values are
true
false
installments integer
Number of instalments. It is required when creating a Fixed Schedule if the process has limited instalments.
final_amount decimal (optional)
Final payment amount.
This can be used when creating a Fixed Schedule if there are limited instalments.
If there are unlimited instalments, this field should not be used.
final_payment_date date (optional)
Date on which the final payment will be captured.
Final date can be customised along with the final amount when creating a Fixed Schedule.
This can only be used if there are limited instalments. If there are unlimited instalments, this field should not be used.
This date must be after the start payment date and also after the 2nd last recurring date.
paymentToken string
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.
schedule_set array
Schedule set is a array set of date and amount where date will be the key and 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
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
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
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
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........." } }
Create Repeat Payment Using ECOM
POST /pay/v1/repeat-payments
Headers
Headers
Content-Type string
Content type.
Authorization string
Access token generated from create token request.
User-Agent string
User agent.
Accept string
Accept
Accept-Encoding string
Accept encoding.
Accept-Charset string
Accept charset.
Attributes
payment_type string
Repeat payment type. It must be either of the following values.
fixed_schedule
variable_schedule
payment_intent string
Payment intent generated from create intent request.
customer_name string
Customer name.
customer_email string
Customer email.
reference string
Reference value. Unique textual details of the schedule
customer_address string
Customer address.
customer_postcode string
Customer postcode.
currency string
Currency that the payments will be processed in
frequency string
Payment cycle frequency. It is required when creating a Fixed Schedule.
Possible values are
days
weeks
months
frequency_duration integer
Payment frequency duration. It is required when creating a Fixed Schedule.
start_payment_date date
Date on which the first payment will be captured. It is required when creating a Fixed Schedule.
Default value set to today.
first_amount decimal (optional)
First payment amount.
When creating a Fixed Schedule, the first amount value can be customised.
recurring_amount decimal
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 unlimited or limited instalments.
Possible values are
true
false
installments integer
Number of instalments. It is required when creating a Fixed Schedule if the process has limited instalments.
final_amount decimal (optional)
Final payment amount.
This can be used when creating a Fixed Schedule if there are limited instalments.
If there are unlimited instalments, this field should not be used.
final_payment_date date (optional)
Date on which the final payment will be captured.
Final date can be customised along with the final amount when creating a Fixed Schedule.
This can only be used if there are limited instalments. If there are unlimited instalments, this field should not be used.
This date must be after the start payment date and also after the 2nd last recurring date.
paymentToken string
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.
schedule_set array
Schedule set is a array set of date and amount where date will be the key and amount will be its value. It is required for Variable Schedule payment. This array needs to have minimum 2 set of values.
device_timezone integer
Device timezone value which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
device_capabilities string
Device capabilities which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
device_accept_language string
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_resolution string
Device accept language which can be fetched using javascript and assigned to the respective hosted input field. This value is required in 3DS.
remote_address string
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
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
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
<!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
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
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........." } }
Get all repeat payments
Get all the repeat payments created from the same merchant account.
Results can be filtered by using the below query parameters. payment_type
need to be passed as query param without which result can't be fetched.
GET /pay/v1/pay/repeat-payments
Headers
Content-Type string
Content type.
Authorization string
Access token generated from create token request.
Query parameters
payment_type string
Repeat payment type.
fixed_schedule
variable_schedule
page integer (optional)
Page Number.
status string (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
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
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........." } ] } ]
Get repeat payment
Get details of a specific repeat payment using id.
GET /pay/v1/pay/repeat-payments/{id}
Headers
Content-Type string
Content type.
Authorization string
Access token generated from create token request.
Query parameters
payment_type string
Repeat payment type.
fixed_schedule
variable_schedule
Request
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
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": "23-02-2023", "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-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-Type string
Content type.
Authorization string
Access token generated from create token request.
Attributes
payment_type string
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_id integer (optional)
Recurring id is need to be passed to delete a specific recurring event of Fixed and Variable schedule payment.
Request
DELETE https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/{id} HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... { "payment_type": "fixed_schedule", "recurring_id": 123 }
Response
HTTP/1.1 200 OK Content-Type: application/json { "success": true, "message": "Deleted successfully" }
Refund a processed payment
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.
This request can be used to refund a processed payment that has a captured
or completed
status
DELETE /pay/v1/repeat-payments/cancel/{id}
Headers
Content-Type string
Content type.
Authorization string
Access token generated from create token request.
Attributes
payment_type string
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_id integer
Recurring id needs to be passed to refund a specific payment from a Fixed or Variable schedule.
Request
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
HTTP/1.1 200 OK Content-Type: application/json { "success": true, "message": "Cancelled successfully" }
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 recurring_id
(fetched from get repeat payment request) needs to be passed along with the id
(repeat schedule id) in request url.
POST /pay/v1/repeat-payments/retry/{id}
Headers
Content-Type string
Content type.
Authorization string
Access token generated from create token request.
Attributes
payment_type string
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_id integer
Recurring id needs to be passed to retry a specific payment from a Fixed or Variable schedule.
Request
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/retry/{id} HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... { "payment_type": "fixed_schedule", "recurring_id": 123 }
Response
HTTP/1.1 200 OK Content-Type: application/json { "success": true, "message": "Payment retried successfully" }
Add a new card
Update the card being used for any specific repeat schedule.
The new card details will be used to action all the future payments of that schedule.
In this scenario, the paymentToken
need to be passed along with id
(repeat schedule id) in 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/card/{id}
Headers
Content-Type string
Content type.
Authorization string
Access token generated from create token request.
Attributes
payment_type string
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
paymentToken string
Payment token is need to be passed to add any new card for Fixed and Variable schedule.
Request
POST https://secure.blinkpayment.co.uk/api/pay/v1/repeat-payments/card/{id} HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... { "payment_type": "fixed_schedule", "paymentToken": "ey............." }
Response
HTTP/1.1 200 OK Content-Type: application/json { "success": true, "message": "Card updated" }