Complete a checkout with Spreedly
You can use a third-party payment forwarding service like Spreedly to send customer credit card information to Shopify's PCI compliant card server.
Requirements
Anchor link to section titled "Requirements"- You've learned how to create a checkout with the Checkout API.
- You've signed up for a Spreedly account and obtained an environment key and secret access token.
Step 1: Add Shopify as a receiver
Anchor link to section titled "Step 1: Add Shopify as a receiver"Add Shopify as a receiver in Spreedly using the Spreedly API.
The response contains a token
parameter. This is your receiver token, which you'll use when vaulting credit cards with Spreedly.
Step 2: Send the credit card information to Spreedly
Anchor link to section titled "Step 2: Send the credit card information to Spreedly"When a customer checks out, send their credit card information to Spreedly.
There are multiple methods available for sending credit card information to Spreedly. You can use the iFrame Payment Form or Spreedly Express, which require a low level of PCI compliance.
You can also use the Spreedly JavaScript API to send the credit card directly to Spreedly from the client’s browser:
The response contains a payment_method.token
parameter, which you'll use to store the credit card.
Step 3: Send the payment_method.token
and the receiver token to the card storage
Anchor link to section titled "Step 3: Send the payment_method.token and the receiver token to the card storage"Send the payment_method.token
and the receiver token from Spreedly to Shopify's PCI-compliant card storage environment.
The header
and body
parameters provided are the header and body of the request that Spreedly will forward to Shopify. The credit card details are provided as Spreedly receiver variables through a templating syntax.
The response contains an id
parameter, which you'll send to Shopify when you create the payment.
Step 4: Create a new checkout object
Anchor link to section titled "Step 4: Create a new checkout object"Create a new checkout object in Shopify using the Shopify REST Admin API.
Step 5: Send id
using the Checkout
resource
Anchor link to section titled "Step 5: Send id using the Checkout resource"Send id
using the REST Admin API's Checkout
resource to process the transaction in Shopify.
For more information about vaulting with Spreedly, refer to the Spreedly documentation on Payment Method Distribution and the Spreedly API Reference.