Newer Version Available

This content describes an older version of this product. View Latest

Commerce Webstore Checkout Payments

Payment for a Commerce store checkout.

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

In API version 63.0 and later, the Commerce Webstore Checkout Payments API is re-enterable. If a payment already exists for a cart, a POST request for an authorized or post-authorized payment handles the existing authorization or payment as follows.
  • If the existing payment is a PaymentAuthorization, the authorization is reversed.
  • If the existing payment is a captured payment, a refund is issued.
If the request includes a new billing address, this is also updated.
Resource
1/commerce/webstores/webstoreId/checkouts/activeOrCheckoutId/payments
Values for activeOrCheckoutId are:
  • checkoutId—ID of the checkout.
  • active—Active checkout.
Available version
55.0
HTTP methods
POST
Request body for POST
Root XML tag
<checkoutPaymentInput>
JSON example for authorized payment
1{
2   "requestType":"Auth",
3   "paymentToken":"cardPaymentMethodId",
4   "billingAddress":{
5      "name":"John Doe",
6      "street":"123 Acme Drive",
7      "city":"Los Angeles",
8      "region":"CA",
9      "country":"US",
10      "postalCode":"90001"
11  }
12}
JSON example for post authorized payment
1{
2   "requestType":"PostAuth",
3   "paymentToken": 'pi_0swefj329r4ljsdfk',
4   "billingAddress":{
5      "name":"John Doe",
6      "street":"123 Acme Drive",
7      "city":"Los Angeles",
8      "region":"CA",
9      "country":"US",
10      "postalCode":"90001"
11   }
12 }
JSON example for simple purchase order
1{
2   "requestType": "SimplePurchaseOrder",
3   "paymentToken": "000348957393223",
4   "billingAddress":{
5      "name":"John Doe",
6      "street":"123 Acme Drive",
7      "city":"Los Angeles",
8      "region":"CA",
9      "country":"US",
10      "postalCode":"90001"
11  }
12}
Properties
Name Type Description Required or Optional Available Version
billing​Address 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
payment​Token String Payment token value has a different meaning depending on the request type.

If the request type is Auth, the value is a card payment method ID.

If the request type is SimplePurchaseOrder, the value is a purchase order number.

If the request type is PostAuth, the value is a string that identifies the payment transaction so it can be validated by the payment gateway adapter’s PostAuth handler.

Required if requestType is Auth, PostAuth, or SimplePurchaseOrder 55.0
payments​Data String Additional data from a payment request for custom checkout implementations. Supports up to four key-value pairs. paymentsData is only applicable to requests with a requestType of Auth or PostAuth. Simple purchase orders don’t support paymentsData. Optional 55.0
request​Type String Type of payment request. Valid values are:
  • Auth—Payment authorization request.
  • PostAuth— Record a payment transaction that happened outside of the Salesforce platform
  • SimplePurchaseOrder— Use a purchase order as a form of payment
Required 55.0
Response body for POST
Checkout Payment