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

Delete a Customer

Permanently delete a customer and all associated cards from your account. This action is irreversible and should be used carefully.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`id`STRING(required)
Customer ID to delete (must be a valid customer ID starting with cust_).
Example:"cust_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must be a valid customer ID

Responsesโ€‹

200

Customer deleted successfully

Customer and all associated cards permanently deleted.

Deletion effects:
  • Customer profile is permanently removed
  • All associated cards are deleted
  • Customer metadata is permanently removed
  • Past charges remain in records but customer field becomes null
  • Deletion cannot be undone

400

Bad request

Invalid customer ID format.

Common causes:
  • Customer ID format is invalid
  • ID does not start with cust_

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

404

Not found

Customer not found.

Common causes:
  • Customer ID does not exist
  • Customer has already been deleted

Code samplesโ€‹

curl https://api.omise.co/customers/cust_test_5xuy4w91xqz7d1w9u0t \
-X DELETE \
-u skey_test_5xuy4w91xqz7d1w9u0t:

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
bad_requestInvalid customer ID formatCheck ID format
authentication_failureInvalid API keyVerify your secret key is correct
not_foundCustomer not foundVerify customer ID exists
conflictCustomer has active subscriptionsCancel subscriptions before deleting

Deletion Responseโ€‹

FieldDescription
objectObject type (always "customer")
idID of the deleted customer
deletedBoolean flag (always true for successful deletions)
livemodeWhether this was a live mode customer

Try it outโ€‹

Required - 1 fields
โ–ผ