Skip to main content
Version: 2019-05-29 (Current)

Create a Linked Account

Create a new linked account to initiate payment method registration. The response includes a registration_uri where the account holder can complete the registration process.


Request Parametersโ€‹

Required - 2 fieldsRequired Parameters
โ–ผ
`type`STRING(required)
Type of linked account. Available types depend on the payment method (e.g., direct_debit_kbank, direct_debit_scb, direct_debit_bbl for Thai banks).
Example:"direct_debit_kbank"
`return_uri`STRING(required)
URI to redirect the account holder after completing the registration process.
Example:"https://example.com/linked-accounts/complete"
Optional - 2 fieldsOptional Parameters

Responsesโ€‹

200

Linked account created successfully

Linked account created. Redirect the account holder to the registration_uri to complete registration.

Linked account object fields:
  • object - Always "linked_account"
  • id - Linked account ID (lacct_*). Store this in your database.
  • livemode - Whether this is a live or test mode linked account
  • status - Account status: failed, expired, pending, successful, or deleted
  • type - Type of linked account
  • last_digits - Last digits of the linked account identifier (if applicable)
  • registration_uri - URI where the account holder completes registration
  • return_uri - URI to redirect after registration
  • expires_at - When the registration link expires
  • created_at - Linked account creation timestamp
  • registered_at - When registration was completed (null if pending)
  • failure_code - Error code if registration failed (null if not failed)
  • failure_message - Error message if registration failed (null if not failed)
  • metadata - Custom key-value data

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Missing required parameter (type or return_uri)
  • Invalid type value
  • Invalid return_uri format
  • Invalid citizen_id format
  • Metadata exceeds 15,000 characters

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key
  • Incorrect HTTP Basic Auth format

422

Unprocessable entity

The request was valid but could not be processed.

Common causes:
  • Linked account type not enabled for your account
  • Account limit reached
  • Payment method not available in your region

5xx

Server error

Server-side error occurred. These are rare but should be handled gracefully.

How to handle:

Code samplesโ€‹

curl https://api.omise.co/linked_accounts \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "type=direct_debit_kbank" \
-d "return_uri=https://example.com/linked-accounts/complete"

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
bad_requestMissing or invalid parametersCheck that type and return_uri are valid
authentication_failureInvalid API keyVerify your secret key is correct
invalid_linked_account_typeType not supportedCheck available linked account types
not_enabledFeature not enabledContact support to enable linked accounts

Linked Account Status Valuesโ€‹

StatusDescription
pendingRegistration in progress, awaiting completion
successfulRegistration completed successfully
failedRegistration failed (check failure_code and failure_message)
expiredRegistration link expired before completion
deletedLinked account has been deleted

Linked Account Fieldsโ€‹

FieldDescription
idLinked account ID (store this in your database)
typeType of linked account
statusCurrent status of the linked account
registration_uriURL for account holder to complete registration
return_uriRedirect URL after registration
last_digitsLast digits of the account identifier
expires_atExpiration time for registration link
registered_atWhen registration was completed
failure_codeError code if registration failed
failure_messageHuman-readable error message
metadataCustom key-value data
created_atLinked account creation timestamp

๐Ÿ”‘API Credentials

Try it outโ€‹

Required - 2 fields
โ–ผ
Additional - 2 fields
Your IP: ...Loading...