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

Retrieve a Source

Retrieve information about an existing source including its type, amount, QR code data, and charge status.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`id`STRING(required)
The source ID to retrieve. Must start with src_ followed by test_ or live_ and a unique identifier.
Example:"src_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must be a valid source ID, Pattern: src_(test|live)_[0-9a-z]+

Responsesโ€‹

200

Successful retrieval

Source retrieved successfully. Returns the source object with all details.

Response includes:
  • id - Source identifier
  • type - Payment method type
  • flow - Payment flow (offline, redirect, app_redirect)
  • amount - Source amount
  • currency - Currency code
  • charge_status - Status of charge created with source (unknown, pending, successful, failed, expired)
  • scannable_code - QR code data if applicable
  • references - Payment references if applicable

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid public key
  • Incorrect HTTP Basic Auth format

404

Not found

Source not found. The specified source ID does not exist.

Common causes:
  • Invalid source ID format
  • Source ID does not exist in your account
  • Using test key to access live source (or vice versa)
  • Typo in source ID

Code samplesโ€‹

curl https://api.omise.co/sources/src_test_5xuy4w91xqz7d1w9u0t \
-u pkey_test_5xuy4w91xqz7d1w9u0t:

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
authentication_failureInvalid API keyVerify your public key is correct
not_foundSource not foundCheck source ID is valid and exists

Charge Status Valuesโ€‹

StatusDescription
unknownNo charge created with this source yet
pendingPayment is pending customer action
successfulPayment completed successfully
failedPayment failed
expiredPayment expired before completion

Try it outโ€‹

Required - 1 fields
โ–ผ