Commerce Webstore Payments Token

Tokenize a payment for a Commerce store checkout.

To access this resource, you need a B2B Commerce license and the system permissions included in the Buyer (B2B stores only) preconfigured permission set.

Resource
1/commerce/webstores/webstoreId/payments/token
Available version
55.0
HTTP methods
POST
Request body for POST
Root XML tag
<paymentTokenRequest>
JSON example
1{
2   "billingAddress":{
3      "name":"John Doe",
4      "street":"123 Acme Drive",
5      "city":"Los Angeles",
6      "region":"CA",
7      "country":"US",
8      "postalCode":"90001"
9  }
10   "cardPaymentMethod":{
11      "cardHolderName":"John Doe",
12      "cardNumber":"4242424242424242",
13      "expiryMonth":"12",
14      "expiryYear":"24",
15      "cvv":"141",
16      "cardType":"Visa"
17   }
18   "hasSubscriptionProduct": true,
19}
Properties
Name Type Description Required or Optional Available Version
billingAddress Checkout Address Input Billing address for the checkout. Don't include a value for shipToPhoneNumber on the Checkout Address Input. This field is ingored in the payment request. Optional 55.0
card​PaymentM​ethod Card Payment Method Tokenization Input Credit card payment method to tokenize. Required 55.0
hasSubscription​Product Boolean Indicates whether the cart has subscription products (true) or not (false).

This field is used for third-party payment gateway integrations with Commerce subscriptions. When set to true, it triggers the AuthorizationRequest Apex class to include the SavedPaymentMethod for payment authorization.

To use this field, you must have the required permission. Contact Salesforce Customer Support for more help.

Optional 67.0
Response body for POST
Payment Token