> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The PaymentMethod Object

The `PaymentMethod` object defines a customer’s method of paying for your product or service. This is an umbrella object that includes subobjects that specify the details of various payment types, such as credit card, electronic check, and PayPal. An instance of the `PaymentMethod` object refers to only one payment type. When creating an instance, specify the payment type to which this object refers by populating the `type` attribute and then adding the related details. For example, for a credit-card payment, add details such as the card number and its expiration date in the corresponding subobject.

Although this object offers methods to independently create a new payment method in Subscribe, to validate payment, and so on, you might create `PaymentMethod` objects indirectly through `Account`, `AutoBill`, or `Transaction` objects, as follows:

**Note:** Use of the forward slash character (/) in identifiers is not allowed. See [Merchant Identifiers](Merchant_Identifiers) for more information.

* When creating an `Account` object, you can specify multiple `PaymentMethod` objects owned by the account in the `paymentMethods` attribute of the `Account` object.
* When creating an `AutoBill` object, you can specify a payment method for the rebilling transactions generated by the `AutoBill` object in its `paymentMethod` attribute. Otherwise, the `AutoBill` rebill transactions use the payment method available with the account.
* When creating a `Transaction` object, you can specify the `sourcePaymentMethod` attribute to define the means by which this transaction will be paid.

In the last two cases, Subscribe creates the `PaymentMethod` object and associates it with the underlying `Account` object. For example, if you specify a `PaymentMethod` object in a `Transaction` object’s `sourcePaymentMethod` attribute, Subscribe attaches the `PaymentMethod` object to the `Account` object on the `Transaction` object. You can turn off this behavior by setting the `active` flag on the `PaymentMethod` object to false.

* **[PaymentMethod Data Members](../topics/PaymentMethod_Data_Membe)**

* **[PaymentMethod Subobjects](../topics/PaymentMethod_Subobjects)**

* **[PaymentMethod Methods](../topics/PaymentMethod_Methods)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.