Complete a checkout with Stripe
You can use Shopify's integration with Stripe to tokenize credit cards on behalf of merchants that have enabled Shopify Payments as their payment gateway solution.
Requirements
Anchor link to section titled "Requirements"- You've learned how to create a checkout with the Checkout API.
- You have a Stripe Connect account to process credit cards as a Shopify sales channel app.
Step 1: Obtain token create access
Anchor link to section titled "Step 1: Obtain token create access"You'll need token create access to tokenize credit cards on behalf of Shopify's Custom accounts in Stripe.
To get token create access, provide Shopify with your Stripe account id
. You can query for this id
using the Stripe API.
Step 2: Retrieve shopify_payments_account_id
Anchor link to section titled "Step 2: Retrieve shopify_payments_account_id"When you create a checkout object for a transaction, Shopify returns the merchant's shopify_payments_account_id
.
Step 3: Send shopify_payments_account_id
and the card information to Stripe
Anchor link to section titled "Step 3: Send shopify_payments_account_id and the card information to Stripe"Send the merchant's shopify_payments_account_id
and the card information from your platform account to Stripe using the tokens endpoint. The secret key corresponds to your Stripe secret key which you can get from the API section of your Stripe account.
A successful request returns a token for the customer's credit card.
Step 4: Send the token to Shopify
Anchor link to section titled "Step 4: Send the token to Shopify"Send the token using the Checkout API to process the payment in Shopify. The unique_token
can be any client-generated unique identifier:
A successful request completes payment using the Stripe token and a corresponding order is created in the shop.
For more information about vaulting with Stripe, refer to the Stripe API Reference.