Payment methods

A payment method is a card or bank account a customer pays with. A payment with new card or bank details creates one, which can be saved to charge again later, such as for a subscription.

The PaymentMethod object

Name
object
Type
"payment_method",
Description
The object's type.
Name
id
Type
string,
Description
Unique identifier for the object.
Name
live
Type
boolean,
Description
true if the object is live, or false if it's in a sandbox.
Name
created_at
Type
integer,
Description
When the object was created, in milliseconds since the Unix epoch.
Name
active
Type
boolean,
Description
Whether the payment method is saved for future payments.
Name
allow_redisplay
Type
enum,
Description
Whether the payment method is offered to the customer at checkout and on invoice payment pages.
Properties
Name
apple_pay
Type
empty object or null,
Description
Present when type is apple_pay.
Name
billing_details
Type
object,
Description
Billing details for the payment method.
Properties
Name
card
Type
object or null,
Description
The card, when type is card.
Properties
Name
customer
Type
string or Customer or null,
Description
Expandable. The customer the payment method belongs to.
Name
type
Type
enum,
Description
The type of payment method.
Properties
Name
us_bank_account
Type
object or null,
Description
The bank account, when type is us_bank_account.
Properties

The PaymentMethod object

{
  "object": "payment_method",
  "id": "pm_VQ9SaYquIZTG2l0uRsmUr4",
  "live": false,
  "created_at": 1750000000000,
  "active": true,
  "allow_redisplay": "limited",
  "billing_details": {
    "address": {
      "city": "Los Angeles",
      "country": "US",
      "line1": "123 Main Street",
      "line2": null,
      "postal_code": "90001",
      "state": "CA"
    },
    "name": "John Doe",
    "email": "john.doe@example.com"
  },
  "apple_pay": null,
  "card": {
    "object": "card",
    "live": false,
    "id": "card_inJ1dWsOEGezQOWd69qUW5",
    "created_at": 1750000000000,
    "bin": "42424242",
    "brand": "Visa",
    "checks": {
      "address_line_1": "pass",
      "address_postal_code": "pass",
      "cvc": "pass"
    },
    "country": "US",
    "exp_month": 1,
    "exp_year": 2030,
    "fingerprint": "Jm4dQ8sV2pLx7NcR1bTz9w",
    "funding": "credit",
    "issuer": "Bias",
    "last4": "4242"
  },
  "us_bank_account": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "type": "card"
}

Get a payment method

Retrieve a payment method by its ID.

Required parameters

Name
id
Type
string,
Description
The ID of the payment method to retrieve.

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties

Returns

Returns the payment method.

Retrieve a payment method

const paymentMethod = await bias.paymentMethods.get("id");

Response example

{
  "object": "payment_method",
  "id": "pm_VQ9SaYquIZTG2l0uRsmUr4",
  "live": false,
  "created_at": 1750000000000,
  "active": true,
  "allow_redisplay": "limited",
  "billing_details": {
    "address": {
      "city": "Los Angeles",
      "country": "US",
      "line1": "123 Main Street",
      "line2": null,
      "postal_code": "90001",
      "state": "CA"
    },
    "name": "John Doe",
    "email": "john.doe@example.com"
  },
  "apple_pay": null,
  "card": {
    "object": "card",
    "live": false,
    "id": "card_inJ1dWsOEGezQOWd69qUW5",
    "created_at": 1750000000000,
    "bin": "42424242",
    "brand": "Visa",
    "checks": {
      "address_line_1": "pass",
      "address_postal_code": "pass",
      "cvc": "pass"
    },
    "country": "US",
    "exp_month": 1,
    "exp_year": 2030,
    "fingerprint": "Jm4dQ8sV2pLx7NcR1bTz9w",
    "funding": "credit",
    "issuer": "Bias",
    "last4": "4242"
  },
  "us_bank_account": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "type": "card"
}

List all payment methods

Retrieve a paginated list of payment methods.

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties
Name
ending_before
Type
string,
Description
The ID of the object to list before, for pagination.
Name
starting_after
Type
string,
Description
The ID of the object to list after, for pagination.
Name
limit
Type
integer, at least 1, at most 1000, default is 50
Description
The maximum number of objects to return, from 1 to 1000. Defaults to 50.
Name
filters
Type
object, object, or object,
Description
Filters for the list, combined with and and or.
Properties

Returns

Returns a list of payment methods.

List all payment methods

const paymentMethod = await bias.paymentMethods.list();

Response example

{
  "object": "list",
  "items": [
    {
      "object": "payment_method",
      "id": "pm_VQ9SaYquIZTG2l0uRsmUr4",
      "live": false,
      "created_at": 1750000000000,
      "active": true,
      "allow_redisplay": "limited",
      "billing_details": {
        "address": {
          "city": "Los Angeles",
          "country": "US",
          "line1": "123 Main Street",
          "line2": null,
          "postal_code": "90001",
          "state": "CA"
        },
        "name": "John Doe",
        "email": "john.doe@example.com"
      },
      "apple_pay": null,
      "card": {
        "object": "card",
        "live": false,
        "id": "card_inJ1dWsOEGezQOWd69qUW5",
        "created_at": 1750000000000,
        "bin": "42424242",
        "brand": "Visa",
        "checks": {
          "address_line_1": "pass",
          "address_postal_code": "pass",
          "cvc": "pass"
        },
        "country": "US",
        "exp_month": 1,
        "exp_year": 2030,
        "fingerprint": "Jm4dQ8sV2pLx7NcR1bTz9w",
        "funding": "credit",
        "issuer": "Bias",
        "last4": "4242"
      },
      "us_bank_account": null,
      "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
      "type": "card"
    }
  ],
  "has_more": true
}

Update a payment method

Updates change a payment method’s customer, billing details or allow_redisplay.

Bias offers a saved payment method back to its customer in Checkout and on invoice payment pages only when allow_redisplay is always. That’s set when the customer chooses to save it. To offer one saved another way, such as through the API or for a subscription, set allow_redisplay to always here or when you create the payment.

Required parameters

Name
id
Type
string,
Description
The ID of the payment method to update.

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties
Name
billing_details
Type
object,
Description
Billing details for the payment method.
Properties
Name
customer
Type
string or null,
Description
The customer the payment method belongs to.
Name
allow_redisplay
Type
enum,
Description
Whether the payment method is offered to the customer at checkout and on invoice payment pages.
Properties

Returns

Returns the updated payment method.

Update a payment method

const paymentMethod = await bias.paymentMethods.update("id");

Response example

{
  "object": "payment_method",
  "id": "pm_VQ9SaYquIZTG2l0uRsmUr4",
  "live": false,
  "created_at": 1750000000000,
  "active": true,
  "allow_redisplay": "limited",
  "billing_details": {
    "address": {
      "city": "Los Angeles",
      "country": "US",
      "line1": "123 Main Street",
      "line2": null,
      "postal_code": "90001",
      "state": "CA"
    },
    "name": "John Doe",
    "email": "john.doe@example.com"
  },
  "apple_pay": null,
  "card": {
    "object": "card",
    "live": false,
    "id": "card_inJ1dWsOEGezQOWd69qUW5",
    "created_at": 1750000000000,
    "bin": "42424242",
    "brand": "Visa",
    "checks": {
      "address_line_1": "pass",
      "address_postal_code": "pass",
      "cvc": "pass"
    },
    "country": "US",
    "exp_month": 1,
    "exp_year": 2030,
    "fingerprint": "Jm4dQ8sV2pLx7NcR1bTz9w",
    "funding": "credit",
    "issuer": "Bias",
    "last4": "4242"
  },
  "us_bank_account": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "type": "card"
}

Deactivate a payment method

Deactivating a payment method permanently stops it from being charged. Subscriptions and unpaid invoices that used it charge the customer’s default_payment_method instead.

Required parameters

Name
id
Type
string,
Description
The ID of the payment method to deactivate.

Returns

Returns the deactivated payment method.

Deactivate a payment method

const paymentMethod = await bias.paymentMethods.deactivate("id");

Response example

{
  "object": "payment_method",
  "id": "pm_VQ9SaYquIZTG2l0uRsmUr4",
  "live": false,
  "created_at": 1750000000000,
  "active": true,
  "allow_redisplay": "limited",
  "billing_details": {
    "address": {
      "city": "Los Angeles",
      "country": "US",
      "line1": "123 Main Street",
      "line2": null,
      "postal_code": "90001",
      "state": "CA"
    },
    "name": "John Doe",
    "email": "john.doe@example.com"
  },
  "apple_pay": null,
  "card": {
    "object": "card",
    "live": false,
    "id": "card_inJ1dWsOEGezQOWd69qUW5",
    "created_at": 1750000000000,
    "bin": "42424242",
    "brand": "Visa",
    "checks": {
      "address_line_1": "pass",
      "address_postal_code": "pass",
      "cvc": "pass"
    },
    "country": "US",
    "exp_month": 1,
    "exp_year": 2030,
    "fingerprint": "Jm4dQ8sV2pLx7NcR1bTz9w",
    "funding": "credit",
    "issuer": "Bias",
    "last4": "4242"
  },
  "us_bank_account": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "type": "card"
}