---
schema_version: "1"
id: 09cb7a0b0003d65649c97ae4d376792629318a6cd08d58b6124156ebde9c67ef
title: "Example: Create a Saved Payment Method for Bank or Alternative Payment Method"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/salesforce-commerce/guides/d2c-commerce/b2b-comm-spm-import-tokens-create-example-for-bankorapm.md
canonical_url: https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-comm-spm-import-tokens-create-example-for-bankorapm.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ba3d74905e6bf1a7272aa34b121f5953c0bdd39d1d22a329c58f6c0bf204bf48
products:
  - B2B Commerce Developer Guide
  - Salesforce APIs
---
# Example: Create a Saved Payment Method for Bank or Alternative Payment Method

Create Saved Payment Methods (SPM) for bank or alternative payment methods in one of two ways:

- Salesforce-Supported Types: Use supported types, such as `sepa_debit`, `bancontact`, `ideal`, `us_bank_account` (ACH), `bacs_debit`, and `au_becs_debit`.

  Or

- Extended Payment Method Types: If the `type` isn’t supported by Salesforce, set `type` to `extd_apm_type` and provide the exact payment method type recognized by your payment gateway in the `extendedPaymentMethodType` field.

**note:** The `ExtendedPaymentMethodType` field and extended types (`extd_apm_type`, `extd_wallet`) are supported only for third-party gateways.

**Sample JSON request**

```json
{
  "merchantAccountId": "8zbSM0000000EkXYAU",
  "referenceOwnerId": "001SM00000GPtUqYAL",
  "paymentGatewayId": "0b0SM0000002nsfYAA",
  "status": "Active",
  "usageType": "OFFSESSION",
  "name": "AmazonPay...001",
  "gatewayReference": "cus_TS4IZLLrrbsYce",
  "gatewayToken": "pm_1SVA9qIQmmvzCzdJsQb2fogA",
  "last4": "1234",
  "type": "extd_apm_type",
  "checksum": "UNIQUE_GATEWAY_HASH_Wallet_1090901",
  "extendedPaymentMethodType": "klarna"
}
```

**Sample JSON response**

```json
{
  "id": "12qSM000000qKx7YAE",
  "success": true,
  "errors": []
}
```

Here’s a sample UI showing example records created for `extd_apm_type`.
**note:** In this example, `ExtendedPaymentMethodType` is set to klarna for testing. You can use any value not supported by Salesforce and customize your implementation as needed.

![Example of a saved payment method record for a bank or alternative payment method showing field values and status](https://developer.salesforce.com/media/d2c-commerce/example_spm_apm.png '{"class": "image-lg", "title": "Saved Payment Method for Bank or Alternative Payment Method"}')
