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

Create a Link

Create a new payment link with the specified parameters. Links can be shared across any platform and configured for single-use or multiple-use.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 4 fieldsRequired Parameters
โ–ผ
`amount`INTEGER(required)
Payment amount in smallest currency unit (satangs for THB, cents for USD). Use 0 to allow customer-specified amounts.
Example:100000
Constraints:Minimum: 0
`currency`STRING(required)
ISO 4217 three-letter currency code in lowercase.
Example:"thb"
Values:thb, jpy, sgd, myr, usd
`title`STRING(required)
Link name displayed to customers on the payment page.
Example:"Invoice #12345 Payment"
`description`STRING(required)
Link details and additional context shown to customers.
Example:"Monthly subscription payment for January 2025"
Recommended - 1 fieldRecommended Parameters
Additional - 1 fieldAdditional Parameters

Responsesโ€‹

200

Successful creation

Link created successfully. Returns a complete link object with a payment_uri that can be shared with customers.

Key response fields:
  • payment_uri - Shareable URL for customers to make payment
  • used - Indicates if single-use link has been consumed
  • multiple - Indicates if link allows multiple payments
  • charges - List of charges made with this link

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Missing required fields (amount, currency, title, description)
  • Invalid currency code
  • Invalid amount (negative value)
  • Invalid data format

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

Code samplesโ€‹

curl https://api.omise.co/links \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "amount=100000" \
-d "currency=thb" \
-d "title=Invoice #12345 Payment" \
-d "description=Monthly subscription payment for January 2025"

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
bad_requestMissing or invalid parametersCheck all required fields are provided
authentication_failureInvalid API keyVerify your secret key is correct
invalid_amountAmount validation failedEnsure amount is 0 or positive integer
invalid_currencyUnsupported currencyUse supported currency codes (thb, jpy, sgd, myr, usd)
FieldDescription
usedSingle-use link consumption status (true if used)
multipleWhether link allows multiple uses
payment_uriShareable URL for customer payment

Try it outโ€‹

Required - 4 fields
โ–ผ
Recommended - 1 fields
Additional - 1 fields