PaymentMethod (v1.0.0)

Represents a payment instrument a customer can use, like a credit card or bank account.

Overview

The PaymentMethod entity represents a specific payment instrument registered by a customer, such as a credit card or a linked bank account. It stores necessary (non-sensitive) details required to initiate payments and links to the associated customer and billing address.

Security Note: Sensitive details like full card numbers or bank account numbers should never be stored directly. Rely on tokenization provided by payment gateways.

Entity Properties

NameTypeRequiredDescription
paymentMethodIdUUIDRequiredUnique identifier for the payment method.
customerIdUUIDRequiredIdentifier of the customer who owns this payment method.
typestringRequiredThe type of payment method.
detailsobjectRequiredContains type-specific, often sensitive details (e.g., last 4 digits of card, card brand, bank name, account type, token). **Never store raw PANs or sensitive data.**
isDefaultbooleanRequiredIndicates if this is the customer's default payment method.
billingAddressIdUUIDRequiredIdentifier for the billing address verified for this payment method.
statusstringRequiredCurrent status of the payment method.
createdAtDateTimeRequiredTimestamp when the payment method was added.
updatedAtDateTimeRequiredTimestamp when the payment method was last updated.

Relationships

  • Customer: A payment method belongs to one Customer.
  • Address: Linked to a specific billing Address.
  • Payment: Used to make Payment transactions.
  • Subscription: May be designated as the payment method for a Subscription.

Examples

  • Jane Doe’s default Visa card ending in 1234, expiring 12/2025, status Active.
  • John Smith’s linked bank account (Chase, Checking), status Active.
  • An old MasterCard ending in 5678 belonging to Jane Doe, status Expired.