Checkout / Payments
Create new Payment
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
Checkout / Payments
Create new Payment
Creates new Payment for the current checkout.
You can either create new payment source (eg. a Credit Card) or use an existing (for signed in users only).
Newly created payment source will be associated to the current signed in user.
System will automatically invalidate previous (non-finalized) payments (excluding store credit / gift card payments).
POST
/
api
/
v2
/
storefront
/
checkout
/
create_payment
curl --request POST \
--url https://demo.spreecommerce.org/api/v2/storefront/checkout/create_payment \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Spree-Order-Token: <api-key>' \
--data '{
"payment_method_id": "1",
"source_attributes": {
"gateway_payment_profile_id": "card_1JqvNB2eZvKYlo2C5OlqLV7S",
"cc_type": "visa",
"last_digits": "1111",
"month": 10,
"year": 2026,
"name": "John Snow"
}
}'
{
"data": {
"id": "17",
"type": "cart",
"attributes": {
"number": "R233871560",
"item_total": "0.0",
"total": "0.0",
"subtotal_cents": 0,
"store_credit_total_cents": 0,
"total_cents": 0,
"total_minus_store_credits": "0.0",
"total_minus_store_credits_cents": 0,
"ship_total": "0.0",
"ship_total_cents": 0,
"adjustment_total": "0.0",
"created_at": "2021-09-28T22:15:07.471Z",
"updated_at": "2021-09-28T22:15:07.471Z",
"completed_at": null,
"included_tax_total": "0.0",
"additional_tax_total": "0.0",
"display_additional_tax_total": "$0.00",
"display_included_tax_total": "$0.00",
"tax_total": "0.0",
"tax_total_cents": 0,
"currency": "USD",
"state": "cart",
"token": "zTEpsukRq_yEUcXVCSv0uw1632867307450",
"email": null,
"display_item_total": "$0.00",
"display_ship_total": "$0.00",
"display_adjustment_total": "$0.00",
"display_tax_total": "$0.00",
"promo_total": "0.0",
"display_promo_total": "$0.00",
"promo_total_cents": 0,
"item_count": 0,
"special_instructions": null,
"display_total": "$0.00",
"display_total_minus_store_credits": "$0.00",
"pre_tax_item_amount": "0.0",
"display_pre_tax_item_amount": "$0.00",
"pre_tax_total": "0.0",
"display_pre_tax_total": "$0.00",
"shipment_state": null,
"payment_state": null
},
"relationships": {
"line_items": {
"data": []
},
"variants": {
"data": []
},
"promotions": {
"data": []
},
"payments": {
"data": []
},
"shipments": {
"data": []
},
"user": {
"data": null
},
"billing_address": {
"data": null
},
"shipping_address": {
"data": null
}
}
}
}
Authorizations
Order token to authorize Cart and Checkout requests.
Query Parameters
Specify the related resources you would like to receive in the response body. More Information.
Specify the fields you would like returned in the response body. More information.
Body
application/vnd.api+json
The body is of type object
.
Response
200
application/vnd.api+json
200 Success - Returns the `cart` object.
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://demo.spreecommerce.org/api/v2/storefront/checkout/create_payment \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Spree-Order-Token: <api-key>' \
--data '{
"payment_method_id": "1",
"source_attributes": {
"gateway_payment_profile_id": "card_1JqvNB2eZvKYlo2C5OlqLV7S",
"cc_type": "visa",
"last_digits": "1111",
"month": 10,
"year": 2026,
"name": "John Snow"
}
}'
{
"data": {
"id": "17",
"type": "cart",
"attributes": {
"number": "R233871560",
"item_total": "0.0",
"total": "0.0",
"subtotal_cents": 0,
"store_credit_total_cents": 0,
"total_cents": 0,
"total_minus_store_credits": "0.0",
"total_minus_store_credits_cents": 0,
"ship_total": "0.0",
"ship_total_cents": 0,
"adjustment_total": "0.0",
"created_at": "2021-09-28T22:15:07.471Z",
"updated_at": "2021-09-28T22:15:07.471Z",
"completed_at": null,
"included_tax_total": "0.0",
"additional_tax_total": "0.0",
"display_additional_tax_total": "$0.00",
"display_included_tax_total": "$0.00",
"tax_total": "0.0",
"tax_total_cents": 0,
"currency": "USD",
"state": "cart",
"token": "zTEpsukRq_yEUcXVCSv0uw1632867307450",
"email": null,
"display_item_total": "$0.00",
"display_ship_total": "$0.00",
"display_adjustment_total": "$0.00",
"display_tax_total": "$0.00",
"promo_total": "0.0",
"display_promo_total": "$0.00",
"promo_total_cents": 0,
"item_count": 0,
"special_instructions": null,
"display_total": "$0.00",
"display_total_minus_store_credits": "$0.00",
"pre_tax_item_amount": "0.0",
"display_pre_tax_item_amount": "$0.00",
"pre_tax_total": "0.0",
"display_pre_tax_total": "$0.00",
"shipment_state": null,
"payment_state": null
},
"relationships": {
"line_items": {
"data": []
},
"variants": {
"data": []
},
"promotions": {
"data": []
},
"payments": {
"data": []
},
"shipments": {
"data": []
},
"user": {
"data": null
},
"billing_address": {
"data": null
},
"shipping_address": {
"data": null
}
}
}
}