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

{
  "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

{
  "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