Linked Account Object API NEW
หัวข้อทั้งหมดในหน้านี้
Enable secure and seamless purchases directly from your customers' bank accounts using Direct Debit. Customers can link their bank account to your website or application for faster checkout, eliminating the need to enter payment details for future purchases.
This document explains the Linked Accounts Object API functions.
Objects and Endpoints
Object | Endpoint |
---|---|
linked_account: The account to link for direct debit. |
Linked account object attributes
object id livemode location registration_uri return_uri type status last_digits metadata failure_code failure_message registered_at expires_at created_at |
Response on Success{ "object": "linked_account", "id": "lnac_test_5zylnmmt2kl9chq3ip1", "livemode": false, "location": "/linked_accounts/lnac_test_5zylnmmt2kl9chq3ip1", "registration_uri": "http://test.staging-omise.co/register?ref=lnac_test_5zylnmmt2kl9", "return_uri": "https://example.com/accounts/345678/complete", "type": "direct_debit_kbank", "status": "pending", "last_digits": null, "metadata": {}, "failure_code": null, "failure_message": null, "registered_at": null, "expires_at": "2024-06-04T04:11:14Z", "created_at": "2024-06-03T04:11:14Z" } |
Create a linked account object
Create a linked account object that you can use to link an account for direct debit.
Linked account object creation example call
Curl example: curl https://api.omise.co/linked_accounts \ -u $OMISE_SECRET_KEY: \ -d "type=direct_debit_kbank" \ -d "return_uri=https://example.com/accounts/345678/complete" |
Linked account creation parameters
Linked account creation response codes
Code | Example |
---|---|
200 - OK | See Response on Success |
400 - Bad Request Check whether the required parameters are valid. |
{ "object": "error", "location": "https://www.omise.co/api-errors#bad-request", "code": "bad_request", "message": "Type is not supported" } { "object": "error", "location": "https://www.omise.co/api-errors#bad-request", "code": "bad_request", "message": "Type is required" } { "object": "error", "location": "https://www.omise.co/api-errors#bad-request", "code": "bad_request", "message": "Return uri is not a valid URI" } { "object": "error", "location": "https://www.omise.co/api-errors#bad-request", "code": "bad_request", "message": "Return uri is required" } |
401 - Unauthorized Check whether the authentication key is valid. |
{ "object": "error", "location": "https://www.omise.co/api-errors#authentication-failure", "code": "authentication_failure", "message": "authentication failed" } |
Retrieve a linked account object
Retrieves the details of a linked account object.
Linked account object retrieval example call
Curl example: curl https://api.omise.co/linked_accounts/lnac_test_5zylnmmt2kl9chq3ip1 \
-u $OMISE_SECRET_KEY:
Retrieve a linked account object with ID lnac_test_5zylnmmt2kl9chq3ip1. |
Linked account object retrieval parameters
Linked account object retrieval response codes
Code | Example |
---|---|
200 - OK | See Response on Success |
401 - Unauthorized Check whether the authentication key is valid. |
{ "object": "error", "location": "https://www.omise.co/api-errors#authentication-failure", "code": "authentication_failure", "message": "authentication failed" } |
404 - Not found Check whether the ID is valid. |
{ "object": "error", "location": "https://www.omise.co/api-errors#not-found", "code": "not_found", "message": "linked account lnac_test_5zylnmmt2kl9chq3i1 was not found" } |
500 - Internal Server Error Check whether you have included the ID in the API call. |
{ "status": 500, "error": "Internal Server Error" } |
Delete a linked account object
Deletes a linked account object.
Linked account object deletion example call
Curl example: curl https://api.omise.co/linked_accounts/lnac_test_5zylnmmt2kl9chq3ip1 \
-X DELETE \
-u $OMISE_SECRET_KEY:
Delete a linked account object with ID lnac_test_5zylnmmt2kl9chq3ip1. |
Linked account object deletion parameters
Linked account object deletion response codes
Code | Example |
---|---|
200 - OK | See Response on Success |
400 - Bad Request Check whether the linked account is registered. |
{ "object": "error", "location": "https://www.omise.co/api-errors#bad-request", "code": "bad_request", "message": "linked account is not registered" } |
401 - Unauthorized Check whether the authentication key is valid. |
{ "object": "error", "location": "https://www.omise.co/api-errors#authentication-failure", "code": "authentication_failure", "message": "authentication failed" } |
404 - Not found Check whether the ID is valid. |
{ "object": "error", "location": "https://www.omise.co/api-errors#not-found", "code": "not_found", "message": "linked account lnac_test_5zylnmmt2kl9chq3i1 was not found" } |
500 - Internal Server Error Check whether you have included the ID in the API call. |
{ "status": 500, "error": "Internal Server Error" } |