curl --request POST \
--url https://demo.spreecommerce.org/api/v2/storefront/stripe/payment_intents \
--header 'Content-Type: application/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"
}
}
}Create a Stripe Payment Intent using provided payment method. It creates a Stripe customer if not exists.
curl --request POST \
--url https://demo.spreecommerce.org/api/v2/storefront/stripe/payment_intents \
--header 'Content-Type: application/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"
}
}
}Order token to authorize Cart and Checkout requests.
Show child attributes
200 Success - Returns the Stripe Payment Intent with the Stripe ID, client key, ephemeral_key, customer_id, amount and Stripe Payment Method ID.
Show child attributes
Was this page helpful?