Create Saved Payment Method Synchronously
In the synchronous flow, the gateway returns the token directly to the client. The client then immediately calls the SavedPaymentMethod sObject API to create the record with the received token and metadata.
Here’s the high-level workflow for creating a saved payment method record synchronously.

Here are the steps to create a saved payment method synchronously using the tokenized payment details received from a third-party payment gateway:
-
The client builds the synchronous gateway adapater. See Building a Synchronous Gateway Adapter.
-
The client calls the payment gateway with the payment details entered through the buyer component.
-
The gateway tokenizes the payment and returns the gateway token directly to the buyer component.
-
The client calls the SavedPaymentMethod sObject API to create the saved payment method record with the token and additional metadata details received from the gateway.
Sample JSON request
Sample JSON response
See Also