Storefront API
- Authentication
- Account
- Account / Address
- Account / Credit Cards
- Account / Orders
- Order Status
- Cart
- Cart / Line Items
- Cart / Other
- Cart / Coupons
- Checkout
- Checkout / State
- Checkout / Shipments
- Checkout / Payments
- Checkout / Store Credit
- Stripe
- Products
- Vendors
- Stores
- Taxons
- Countries
- CMS Pages
- Menus
- Wishlists
- Wishlists / Wished Items
- Digital Downloads
Platform API
- Authentication
- Addresses
- Adjustments
- Classifications
- CMS Pages
- CMS Sections
- Countries
- Data Feeds
- Digital Links
- Digital Assets
- Line Items
- Menu Items
- Menus
- Option Types
- Option Values
- Orders
- Payment Methods
- Payments
- Products
- Promotion Actions
- Promotion Categories
- Promotion Rules
- Promotions
- Roles
- Shipments
- Shipping Categories
- Shipping Methods
- States
- Stock Items
- Stock Locations
- Store Credit Categories
- Store Credit Types
- Store Credits
- Tax Categories
- Tax Rates
- Taxonomies
- Taxons
- Users
- Variants
- Vendors
- Webhook Events
- Webhook Subscribers
- Wished Items
- Wishlists
- Zones
Create a Stripe Payment Intent
Create a Stripe Payment Intent using provided payment method. It creates a Stripe customer if not exists.
curl --request PATCH \
--url https://demo.spreecommerce.org/api/v2/storefront/stripe/payment_intents \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Spree-Order-Token: <api-key>' \
--data '{
"payment_intent": {
"amount": 123,
"stripe_payment_method_id": "<string>",
"off_session": true
}
}'
{
"data": {
"id": "980a80d5-f51b-4065-b3a0-622fc5cb6bf6",
"type": "payment_intent",
"attributes": {
"stripe_id": "pi_3QhUuj2ESifGlJez0ADSS4tu",
"client_secret": "pi_3KQRG2DcAgmy0ota09WCW6nf_secret_8XTxRbOyg7oEkvvIOvnP75dRw",
"ephemeral_key_secret": "ek_test_YWNjdF8xTGtSb1lJaFIwZ0llZ0llyG1LbFhsVU9XWHY1SlNyMXRKVzNJb0hyQ2JZam1HY28_007lGgvGaA",
"customer_id": "cus_Q9uqUz6gVQFku2",
"amount": "44.0",
"stripe_payment_method_id": "pm_1Qedd42ESifGlJez0IOx5AZ3"
}
}
}
Authorizations
Order token to authorize Cart and Checkout requests.
Body
Response
"980a80d5-f51b-4065-b3a0-622fc5cb6bf6"
The Stripe internal ID of the Payment Intent
The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
Secret of the created ephemeral key.
Stripe's customer ID of the authenticated user (or new one if unauthenticated).
The payment amount
This is the same stripe_payment_method_id that was sent in the parameters. It can be used to confirm Stripe intent that was not confirmed before
Was this page helpful?
curl --request PATCH \
--url https://demo.spreecommerce.org/api/v2/storefront/stripe/payment_intents \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Spree-Order-Token: <api-key>' \
--data '{
"payment_intent": {
"amount": 123,
"stripe_payment_method_id": "<string>",
"off_session": true
}
}'
{
"data": {
"id": "980a80d5-f51b-4065-b3a0-622fc5cb6bf6",
"type": "payment_intent",
"attributes": {
"stripe_id": "pi_3QhUuj2ESifGlJez0ADSS4tu",
"client_secret": "pi_3KQRG2DcAgmy0ota09WCW6nf_secret_8XTxRbOyg7oEkvvIOvnP75dRw",
"ephemeral_key_secret": "ek_test_YWNjdF8xTGtSb1lJaFIwZ0llZ0llyG1LbFhsVU9XWHY1SlNyMXRKVzNJb0hyQ2JZam1HY28_007lGgvGaA",
"customer_id": "cus_Q9uqUz6gVQFku2",
"amount": "44.0",
"stripe_payment_method_id": "pm_1Qedd42ESifGlJez0IOx5AZ3"
}
}
}