WooCommerce Store API
Headless WooCommerce payments for Store API storefronts.
Keep the WooCommerce Store API for the cart and take the payment with Flint. Your backend turns the Store API cart into a Flint order, Stripe Elements collects the card on your domain, and one pay call charges it. 3D Secure finishes on your page, and an order.paid webhook writes the paid order into WooCommerce admin. There is no gateway plugin to install and no payment_data to reverse-engineer.
3.79% + 35¢ on cards · no monthly fee · free sandbox · no credit card
01WooCommerce Store API
The cart
Products, coupons, and shipping rates, on the routes your storefront already calls.
GET /wp-json/wc/store/v1/cart02Flint
The order
Your backend sends the cart's lines. Flint computes the tax and holds the balance.
POST /v1/orders03Your checkout page
The payment
Stripe Elements, Apple Pay, Google Pay, and 3D Secure, all on your domain.
POST /v1/orders/{order_id}/pay04WooCommerce admin
The paid order
A webhook becomes a WooCommerce order, already marked paid, for your team to ship.
order.paidPOST /wp-json/wc/v3/ordersWooCommerce keeps the catalog, the cart, and fulfillment. Flint adds the order your payment settles against and the payment itself. Building the whole checkout, with delivery options and refunds? Headless WooCommerce checkout on your own domain
01The pay call
One pay call replaces payment_data.
On the Store API, the card credential rides in payment_data as a form field the gateway plugin reads from $_POST. On Flint it goes in a request body with a published schema, sent from the PHP or Node SDK or as plain HTTP.
On Flint
use Flint\{Client, ClientOptions, RequestOptions};
$flint = new Client(new ClientOptions(
baseUrl: 'https://api.withflintpay.com',
apiKey: getenv('FLINT_API_KEY'),
));
// The browser posted back a single-use credential from
// Stripe Elements. Charge what the buyer approved.
$result = $flint->orders->pay([
'order_id' => $orderId,
'body' => [
'action' => 'pay',
'client_action_type' => 'stripe',
'payment_source' => ['credential_type' => 'stripe_confirmation_token', 'stripe' => ['confirmation_token' => $confirmationTokenId]],
'expected_outstanding_money' => [
'amount' => '4526',
'currency' => 'USD',
],
'buyer_contact' => ['email' => $email],
],
], new RequestOptions(idempotencyKey: "pay-$cartKey-1"));
echo $result->order_payment_attempt->status; // succeededFrom the PHP server you already run. Every field is in Flint's published OpenAPI spec, and the SDK is generated from it.
Through the Store API
with the Stripe gateway plugin
POST /wp-json/wc/store/v1/checkout
Cart-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
{
"billing_address": { "first_name": "Ada", ... },
"shipping_address": { "first_name": "Ada", ... },
"payment_method": "stripe",
"payment_data": [
{ "key": "wc-stripe-confirmation-token",
"value": "ctoken_1Example" },
...
]
}The Store API types payment_data as key and value strings, and the installed gateway plugin decides which keys it needs. This one is a field WC_Stripe_UPE_Payment_Gateway reads from $_POST.
What the request body gives you
Every field is in the OpenAPI spec, and the PHP and Node SDKs are generated from it.
POST /v1/orders/{order_id}/payA field the action doesn't take fails by name, so a typo shows up on your first sandbox request.
400 INVALID_REQUEST · UNKNOWN_FIELDA retried request returns the first result. A timeout never turns into two charges.
Idempotency-KeyFlint refuses to charge when the balance moved after the buyer saw it.
expected_outstanding_moneyAn order edit that left the balance unchanged is caught too.
expected_versionA guest is identified by email; a signed-in buyer by the order's customer.
buyer_contact.email02Card collection
Stripe Elements on your domain, set up by the order.
Read the order right before you mount Elements. Its payment_collection block names the Stripe account, the publishable key, the amount, and the wallets to offer, so your page mounts Elements with nothing copied out of a plugin's settings. Card details go from the browser to Stripe and never reach your servers or Flint's.
{
"data": {
"order_id": "ord_1kmn0aExample",
"payment_collection": {
"stripe": {
"account_id": "acct_1kmn0aExample",
"publishable_key": "pk_test_1kmn0aExample",
"elements": {
"next_step": "create_confirmation_token",
"submit_to": "pay_order",
"mode": "payment",
"amount_money": { "amount": 4526, "currency": "USD" },
"payment_options": ["card", "apple_pay", "google_pay"],
"payment_method_creation": "manual"
}
}
}
}
}Recalculated on every read, and holding no secrets: the publishable key and account id exist for Stripe.js. Reading the order holds no funds.
The order tells the browser what to do
next_step names the Stripe.js call to make and the field your backend sends back, so one browser implementation serves a merchant key and a checkout session alike.
- payment_collection
- elements.next_step
Apple Pay and Google Pay on your hostname
Register each checkout hostname once. You need no Apple merchant ID, certificate signing request, or domain association file; Flint registers the hostname with Stripe for you.
- POST /v1/payment-method-domains
- elements.payment_options
A single-use credential, then your backend
The browser posts a payment method or a confirmation token to your backend, which pays with it. Flint has no publishable key and takes no browser requests, so your API key never leaves your server.
- payment_source.stripe.payment_method
- payment_source.stripe.confirmation_token
033D Secure
3D Secure finishes on your page.
When the issuer asks for authentication, Flint's pay call returns the action to run, with a Stripe client secret when you explicitly send client_action_type stripe. Your page runs it with Stripe.js, your backend resumes the same attempt, and the buyer stays on your domain from card to receipt.
{
"data": {
"order_payment_attempt": {
"order_payment_attempt_id": "opat_1kmn0aExample",
"status": "requires_action",
"is_resumable": true,
"pending_actions": [
{
"pending_action_id": "pendact_1kmn0aExample",
"action_type": "payment_authentication",
"client_action": {
"stripe": {
"account_id": "acct_1kmn0aExample",
"publishable_key": "pk_test_1kmn0aExample",
"payment_intent": {
"stripe_js_call": "handle_next_action",
"client_secret": "pi_1kmn0aExample_secret_Xyz"
}
}
}
}
]
}
}
}The attempt names what it is waiting for and the Stripe.js call that clears it. pending_action_id stays the same across reads, so your page never runs one action twice.
// This Stripe.js path requires client_action_type: "stripe" on pay.
// Omission returns a Flint URL instead. Use this secret only with handleNextAction;
// it can also confirm the underlying payment with another card.
// your checkout page: run the action the attempt names
const action = attempt.pending_actions[0].client_action.stripe;
const { error } = await stripe.handleNextAction({
clientSecret: action.payment_intent.client_secret,
});
if (error) return showMessage(error.message);
// your backend: resume the same attempt, with no new credential
await flint.orders.pay(
{
order_id: orderId,
body: { action: "resume", order_payment_attempt_id: attemptId },
},
{ idempotencyKey: `resume-${attemptId}` },
);The same moment through the Store API
The Stripe gateway plugin answers 200 with payment_status success while the order is still pending, and adds a verification_endpoint to payment_details. The URL is built from home_url(), so it points at the WordPress site and carries a WordPress nonce; finishing there sends the buyer to WordPress and back through redirect_to. A storefront can instead take payment_intent_secret from the same response and run Stripe.js itself, and the order then waits on the plugin’s own Stripe webhook to leave pending.
HTTP/1.1 200 OK
{
"order_id": 1042,
"status": "pending",
"payment_result": {
"payment_status": "success",
"payment_details": [
{ "key": "payment_intent_secret",
"value": "pi_1Example_secret_1Example" },
{ "key": "verification_endpoint",
"value": "https://wp.example.com/?wc-ajax=wc_stripe_verify_intent&order=1042&nonce=8f2c1b9e4d&intent_id=pi_1Example&redirect_to=..." }
]
}
}wp.example.com is the WordPress site. The storefront the buyer was on is shop.example.com.
// woocommerce-gateway-stripe, class-wc-stripe-blocks-support.php
$verification_endpoint = add_query_arg(
[
'order' => $context->order->get_id(),
'nonce' => wp_create_nonce( 'wc_stripe_confirm_pi' ),
'intent_id' => $payment_details['payment_intent_id'],
'redirect_to' => rawurlencode( $result->redirect_url ),
],
home_url() . \WC_AJAX::get_endpoint( 'wc_stripe_verify_intent' )
);
$payment_details['verification_endpoint'] = $verification_endpoint;
$result->set_payment_details( $payment_details );
$result->set_status( 'success' );Hooked at priority 9999 on the Store API's payment action, after the legacy payment path has run.
04Outcomes
Every outcome is a status your code can branch on.
The Store API reports a payment as a payment_status and a list of strings whose meaning belongs to the gateway plugin. Flint's pay call returns the order and the payment attempt: where the attempt stands, whether it can be resumed, and, for a decline, one of 24 codes.
{
"data": {
"order": {
"order_id": "ord_1kmn0aExample",
"status": "closed",
"payment_status": "paid",
"settlement_amounts": {
"paid_money": { "amount": 4526, "currency": "USD" },
"outstanding_money": { "amount": 0, "currency": "USD" }
}
},
"order_payment_attempt": {
"order_payment_attempt_id": "opat_1kmn0aExample",
"status": "succeeded",
"is_resumable": false
}
}
}The order and the attempt come back together, so the response that confirms the charge also shows the balance at zero.
What happened, and the field that says so
The card was charged and the order is paid.
status "succeeded"The issuer declined, and the code says why. Ask for another card.
last_payment_error.codeThe issuer wants 3D Secure. The attempt carries the action for your page.
status "requires_action" · pending_actionsThe outcome isn't known yet. Resume the same attempt; never start another.
status "processing" · is_resumableThe outcome is known and Flint is applying it to the order. A second payment is refused meanwhile.
status "processing" · ORDER_PAYMENT_ATTEMPT_ACTIVEThe balance changed after the buyer saw it. Flint refuses before charging.
409 ORDER_CHANGED_REFRESH_REQUIREDlast_payment_error.code · 24 values
- card_declined
- card_declined_do_not_retry
- card_details_outdated
- do_not_honor
- lost_card
- stolen_card
- fraudulent
- insufficient_funds
- expired_card
- incorrect_cvc
- payment_method_unavailable
- processing_error
- authentication_required
- payment_blocked
- payment_method_declined
- payment_method_temporarily_unavailable
- payment_not_completed
- payment_action_expired
- bank_account_closed
- bank_account_not_found
- bank_debit_not_authorized
- bank_account_restricted
- bank_debit_limit_exceeded
- payment_failed
Flint maps every processor reason onto one of these codes, so your checkout branches on the code and writes its own words for the buyer. Treat a code you don’t recognize as payment_failed. Declines and payment attempts →
05The cart
Your Store API cart becomes the order.
Your storefront keeps adding items, applying coupons, and choosing shipping rates through the Store API. At checkout, your backend reads the cart with the buyer's Cart-Token and sends its lines to Flint, so every price on the order comes from WooCommerce and none from the browser.
- /cart/add-item
- /cart/apply-coupon
- /cart/select-shipping-rate
- /cart/update-customer
GET /wp-json/wc/store/v1/cart
Cart-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
{
"items": [
{
"key": "a5771bce93e200c36f7cd9dfd0e5deaa",
"id": 482,
"quantity": 1,
"name": "Ceramic dripper",
"prices": {
"price": "2400",
"currency_code": "USD",
"currency_minor_unit": 2
}
},
{
"key": "b6d767d2f8ed5d21a44b0e5886680cb9",
"id": 517,
"quantity": 2,
"name": "Filter papers, 100 pack",
"prices": {
"price": "900",
"currency_code": "USD",
"currency_minor_unit": 2
}
}
],
"shipping_address": {
"address_1": "18 Technology Drive",
"city": "Irvine",
"state": "CA",
"postcode": "92618",
"country": "US"
}
}Store API prices are strings of integer minor units, so "2400" becomes a Flint amount with a cast and no arithmetic.
curl -X POST https://api.withflintpay.com/v1/orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: order-cart-a1b2c3" \
-d '{
"external_reference_id": "wc-cart-a1b2c3",
"line_items": [
{
"type": "custom",
"name": "Ceramic dripper",
"quantity": 1,
"unit_price_money": { "amount": 2400, "currency": "USD" },
"fulfillment": { "requirement": "none" },
"tax": {
"taxable": true,
"line_item_tax_category": "physical_goods"
}
},
{
"type": "custom",
"name": "Filter papers, 100 pack",
"quantity": 2,
"unit_price_money": { "amount": 900, "currency": "USD" },
"fulfillment": { "requirement": "none" },
"tax": {
"taxable": true,
"line_item_tax_category": "physical_goods"
}
}
],
"tax": {
"enabled": true,
"calculation": {
"mode": "automatic",
"price_mode": "additive"
},
"location": {
"address_source": "provided",
"address_type": "shipping_address",
"address": {
"line1": "18 Technology Drive",
"city": "Irvine",
"state": "CA",
"postal_code": "92618",
"country": "US"
}
}
}
}'| what Flint computed | ||
|---|---|---|
| Ceramic dripper, quantity 1line_items[0] | $24.00 | |
| Filter papers, quantity 2line_items[1] | $18.00 | |
| Subtotalpricing_amounts.subtotal_money | $42.00 | |
| Tax, Irvine CApricing_amounts.tax_money | $3.26 | |
| Totalpricing_amounts.total_money | $45.26 | |
| Still owedsettlement_amounts.outstanding_money | $45.26 | |
Store API cart to Flint order, field by field
| Store API cart | Flint order |
|---|---|
| Store API cart: items[].name, items[].quantityThe line, as the buyer built it | Flint order: line_items[].name, line_items[].quantityCopied as they are |
| Store API cart: items[].prices.priceA string of minor units, "2400" | Flint order: line_items[].unit_price_money.amountThe same minor units, 2400 |
| Store API cart: items[].prices.currency_codeUSD | Flint order: line_items[].unit_price_money.currencyUSD |
| Store API cart: shipping_addressaddress_1, city, state, postcode, country | Flint order: tax.location.addressline1, city, state, postal_code, country |
| Store API cart: coupons[].totals.total_discountWhat a coupon took off | Flint order: discounts[].manual.amount_moneyA manual discount, named for the coupon |
| Store API cart: shipping_rates[] with selected: trueThe rate the buyer picked | Flint order: POST /v1/orders/{order_id}/chargesA charge with type "shipping_fee" |
| Store API cart: totals.total_taxWooCommerce's own tax | Flint order: pricing_amounts.tax_moneyFlint's automatic tax, or your rates as external tax |
| Store API cart: Cart-TokenThe buyer's session, valid 48 hours by default | Flint order: external_reference_idAn id you pick for this cart, findable from both sides |
Coupons and shipping carry over as amounts WooCommerce already worked out. A coupon becomes a manual discount on the order, and the selected rate becomes a shipping charge with its own tax setting. Tips and charges
Tax comes from whichever side you choose. Flint’s automatic tax works from the shipping address, at 0.50% of payments where Flint collects tax. Or send the rates WooCommerce applied as external tax components, and Flint applies them as given. Sales tax
Delivery options, refunds by line item, saved cards, and moving the catalog are on headless WooCommerce checkout, end to end →
06The paid order
One webhook puts the paid order in WooCommerce admin.
Your team keeps fulfilling from the admin it knows. When the order is paid, Flint sends order.paid to your backend, and your handler creates the WooCommerce order through the REST API, already marked paid, with the Flint order id as its transaction id.
{
"webhook_event_id": "whev_1kmn0aExample",
"event_type": "order.paid",
"payload_version": 2,
"mode": "live",
"merchant_id": "mer_1kmn0aExample",
"created_at": "2026-10-23T14:00:21Z",
"data": {
"object": {
"order_id": "ord_1kmn0aExample",
"external_reference_id": "wc-cart-a1b2c3",
"status": "closed",
"payment_status": "paid",
"pricing_amounts": {
"total_money": { "amount": 4526, "currency": "USD" }
}
}
}
}The handler verifies the delivery as a Flint-signed JWT with the ID of your endpoint, locally and in production. Your cart id identifies which cart was paid.
// JWT receiver: Flint signs each delivery as a JWT with the endpoint's ID as the
// audience. flint listen prints that whep_ ID locally. Before deploying,
// POST /v1/webhook-endpoints with:
// {"url":"https://example.com/webhooks/flint","enabled_events":["order.paid"]}
// and set FLINT_WEBHOOK_ENDPOINT_ID to the returned id.
// POST /webhooks/flint
$verified = $flint->verifyWebhookDelivery($rawBody, $headers, [
'endpoint_ids' => [getenv('FLINT_WEBHOOK_ENDPOINT_ID')],
]);
$event = $verified['event'];
if ($event['event_type'] === 'order.paid'
&& markProcessed($event['webhook_event_id'])) {
// First delivery of this event: create the WooCommerce order.
writeWooCommerceOrder($event['data']['object']);
}
// Any 2xx within 10 seconds ends the retries for this event.POST /wp-json/wc/v3/orders
Authorization: Basic <consumer key : consumer secret>
{
"payment_method": "flint",
"payment_method_title": "Card via Flint",
"set_paid": true,
"transaction_id": "ord_1kmn0aExample",
"billing": { "first_name": "Ada", "email": "ada@example.com" },
"line_items": [
{ "product_id": 482, "quantity": 1 },
{ "product_id": 517, "quantity": 2 }
]
}The Flint order id goes in transaction_id, so support gets from a WooCommerce order to the payment that settled it in one step.
A failed delivery gets up to 9 attempts, the last 71 to 86 hours after the first, each signed fresh.
status "pending" · next_retry_atEvery retry and resend carries the same event id. Store it, and the WooCommerce order is created once.
webhook_event_idA delivery that runs out of attempts stays queryable, and you resend it once your handler is fixed.
POST /v1/webhook-deliveries/{webhook_delivery_id}/resendYour cart id travels on the Flint order, so either side finds the other.
GET /v1/orders?external_reference_id={id}Receive events on localhost
No tunnel and no public URL while you build. Flint signs forwarded events as JWTs and the CLI prints the endpoint ID to verify them against; set it as FLINT_WEBHOOK_ENDPOINT_ID. Production uses the ID of your registered endpoint. Webhooks guide · Retry schedule
07Compared
The payment step, side by side.
The Store API is a good headless cart. For the payment, its checkout endpoint hands off to whichever gateway plugin is installed. Flint takes that step through its own API, with Stripe processing the card underneath.
| What you need | Store API with the Stripe gateway plugin | Flint |
|---|---|---|
| The payment request | Store API with the Stripe gateway plugin: payment_method plus payment_data, a list of key and value strings | Flint: POST /v1/orders/{order_id}/pay, with a request body in the published OpenAPI spec |
| Which fields to send | Store API with the Stripe gateway plugin: The $_POST keys the installed gateway plugin reads. WooCommerce's docs say they can't list them for every gateway. | Flint: Listed in the spec and in both SDKs. A field the action doesn't take fails with UNKNOWN_FIELD, naming it. |
| 3D Secure | Store API with the Stripe gateway plugin: A verification_endpoint URL on the WordPress site, carrying a WordPress nonce | Flint: A pending action your page runs with Stripe.js, then a resume from your backend |
| The result | Store API with the Stripe gateway plugin: payment_status, plus payment_details as strings the plugin defines | Flint: An attempt status, is_resumable, and for a decline one of 24 codes |
| A total that changed | Store API with the Stripe gateway plugin: expected_total refuses the checkout when the server's total came out higher | Flint: expected_outstanding_money refuses any difference before the card is charged |
| Where the payment code runs | Store API with the Stripe gateway plugin: A gateway plugin installed on the WordPress site | Flint: Your backend, through the PHP or Node SDK or plain HTTP |
reviewed 2026-10-23 against WooCommerce trunk and woocommerce-gateway-stripe develop · corrections: Flint Help
08payment_data
What the Store API does with payment_data.
POST /wp-json/wc/store/v1/checkout takes a payment_method and a payment_data list. Core handles them in three steps, quoted from WooCommerce trunk on 2026-10-23.
Keys are sanitized, and every value becomes a string
StoreApi/Utilities/CheckoutTrait.phpsanitize_key lowercases each key and strips anything outside a to z, 0 to 9, underscore, and hyphen. wc_clean runs on each value. The result is a flat array of strings, the shape of a submitted HTML form.
CheckoutTrait.php// StoreApi/Utilities/CheckoutTrait.php foreach ( $request['payment_data'] as $data ) { $payment_data[ sanitize_key( $data['key'] ) ] = wc_clean( $data['value'] ); }The gateway comes from the classic registry
StoreApi/Routes/V1/Checkout.phpAny enabled WC_Payment_Gateway can be named as payment_method. Blocks support registers a gateway's scripts for WordPress's block checkout page and plays no part in this check.
Checkout.php// StoreApi/Routes/V1/Checkout.php $available_gateways = WC()->payment_gateways->get_available_payment_gateways(); if ( ! isset( $available_gateways[ $request_payment_method ] ) ) { throw new RouteException( 'woocommerce_rest_checkout_payment_method_disabled', /* ... */ 400 ); }The list becomes $_POST
StoreApi/Legacy.phpUnless a gateway took the payment earlier on the same action, core assigns the list to the $_POST superglobal and calls the gateway's process_payment, the method a WordPress checkout form reaches. WooCommerce's own comments are kept.
Legacy.php// StoreApi/Legacy.php, process_legacy_payment() // Add the payment data from the API to the POST global. $_POST = $context->payment_data; // ... $payment_method_object->validate_fields(); // Process Payment. $gateway_result = $payment_method_object->process_payment( $context->order->get_id() ); // Restore $_POST data. $_POST = $post_data;
The keys the Stripe gateway reads
From WC_Stripe_UPE_Payment_Gateway, the class that takes card payments in the current plugin. They are form field names, and no schema lists them.
- wc-stripe-payment-method
- wc-stripe-confirmation-token
- wc_payment_intent_id
- wc_stripe_selected_upe_payment_type
- wc_stripe_checkout_session_id
- wc-stripe-new-payment-method
- payment_method
- express_payment_type
- wc-stripe-blik-code
// WooCommerce docs, Checkout API, the Stripe example
{ "key": "stripe_source",
"value": "src_xxxxxxxxxxxxx" },
{ "key": "paymentMethod", "value": "stripe" },
{ "key": "wc-stripe-new-payment-method", "value": true }WC_Stripe_UPE_Payment_Gateway never reads stripe_source. The same docs page says: “We cannot comprehensively list all expected requests for all payment gateways.” Its own checkout examples pay with cheque and bacs.
Sources
The checkout endpoint takes payment_method and payment_data. The docs' Stripe example sends stripe_source, they say they cannot list the expected requests for every gateway, and their main examples pay with cheque and bacs. WooCommerce docs: Checkout API
github.comCart prices are strings in the currency's minor unit, and the cart routes cover adding items, coupons, shipping rates, and customer addresses. WooCommerce docs: Cart API
github.comThe legacy payment handler assigns payment_data to $_POST and calls the gateway's validate_fields and process_payment. Legacy.php
github.compayment_method is checked against the classic gateway registry, and expected_total returns 409 only when the server's total is higher. Routes/V1/Checkout.php
github.comEach payment_data key goes through sanitize_key and each value through wc_clean. Utilities/CheckoutTrait.php
github.comA Cart-Token expires 48 hours after it is issued by default, through the wc_session_expiration filter. Utilities/CartTokenUtils.php
github.comThe Stripe gateway's card class reads wc-stripe-payment-method, wc-stripe-confirmation-token, and the other listed keys from $_POST, and never reads stripe_source. class-wc-stripe-upe-payment-gateway.php
github.comWhen a card needs 3D Secure, the plugin builds verification_endpoint from home_url() with a WordPress nonce and sets the payment status to success. class-wc-stripe-blocks-support.php
github.com
last reviewed 2026-10-23 · corrections: Flint Help
Underneath
Stripe still processes every card.
Card details go straight from your checkout page to Stripe. Flint sets up and runs the processing account, so you sign up once, hold one set of keys, and pay one fee per payment: 3.79% + 35¢ on cards, with no monthly fee.
API counts come from the published OpenAPI spec · every Flint code sample is checked against it at build time
09Start
From a sandbox key to a paid test order.
PHP
Node
CLI
Test keys start with flint_test_ and run against a sandbox with its own data, so nothing there moves real money. Create an order from a test cart and pay it with 4242 4242 4242 4242, then with 4000 0025 0000 3155 to run a 3D Secure challenge on your own page. flint listen forwards the sandbox’s webhooks to localhost, so your WooCommerce write-back runs against real events.
Then read these, in order
- 01Headless WooCommerce checkoutOn your own domain, with delivery options, refunds, and saved cards
- 02
- 03
- 04
- 05
- 06
Or run npm install -g @flintpay/cli && flint signup to create your account and a sandbox key from the terminal. CLI guide
FAQ
Questions about Store API payments.
How do I take payments with the WooCommerce Store API?
The Store API’s checkout endpoint, POST /wp-json/wc/store/v1/checkout, takes a payment_method and a payment_data list, and passes the list to the installed gateway plugin as form fields, so each gateway defines what you send. With Flint, the Store API keeps the cart: your backend creates a Flint order from it, Stripe Elements collects the card on your own page, and POST /v1/orders/{order_id}/pay charges it, with 3D Secure on your page. An order.paid webhook then writes the paid order into WooCommerce admin. If you would rather not build the payment form, send the buyer to Flint’s hosted checkout instead.
What is payment_data in the WooCommerce Store API checkout?
A list of key and value string pairs sent to POST /wp-json/wc/store/v1/checkout. WooCommerce sanitizes each key with sanitize_key and cleans each value with wc_clean. In the legacy payment path it then assigns the result to the $_POST superglobal and calls the chosen gateway's process_payment method, the same method a WordPress checkout form submission reaches. Which keys a gateway expects is defined by that plugin's code, and WooCommerce's docs say they cannot list them for every gateway. On Flint, the pay request body is defined in a published OpenAPI spec, and a field the action does not take returns 400 INVALID_REQUEST with UNKNOWN_FIELD, naming it.
Which payment_data keys does the WooCommerce Stripe gateway read?
WC_Stripe_UPE_Payment_Gateway, the class in the current Stripe gateway plugin that takes card payments, reads wc-stripe-payment-method or wc-stripe-confirmation-token for the credential, plus wc_payment_intent_id, wc_stripe_selected_upe_payment_type, wc_stripe_checkout_session_id, payment_method, express_payment_type, a save flag named wc-stripe-new-payment-method for cards, and wc-stripe-blik-code. It never reads stripe_source, the key in the Stripe example of WooCommerce's Checkout API docs. On Flint, the credential goes in payment_source.stripe.payment_method or payment_source.stripe.confirmation_token, selected by credential_type in the published API reference.
What happens with 3D Secure in a headless WooCommerce checkout?
With the Stripe gateway plugin, the Store API returns HTTP 200 with payment_status success while the order is still pending, and puts a verification_endpoint into payment_details. That URL is built from home_url() plus a WooCommerce AJAX endpoint and carries a WordPress nonce, so finishing authentication there means sending the buyer to the WordPress site and back. On Flint, the pay call returns a pending action with a Stripe client secret when you explicitly send client_action_type stripe. Your page passes it to Stripe.js handleNextAction, the buyer authenticates on your domain, and your backend resumes the same payment attempt.
Does a payment gateway need Blocks support to work with the Store API?
No. The checkout route checks payment_method against WC()->payment_gateways->get_available_payment_gateways(), the classic registry, so any enabled WC_Payment_Gateway can be named. If no handler on the woocommerce_rest_checkout_process_payment_with_context action takes the payment first, core's legacy handler calls process_payment directly. Blocks support registers a gateway's scripts for WordPress's block checkout page, so a headless frontend gets the server half of a gateway and builds the browser half itself. On Flint, the browser half is Stripe Elements, configured by the order's payment_collection block.
Can I offer Apple Pay and Google Pay on a headless WooCommerce store?
Yes. Register each checkout hostname once with POST /v1/payment-method-domains, and Stripe Elements shows the Apple Pay and Google Pay buttons there over HTTPS. You need no Apple merchant ID, certificate signing request, or domain association file: Flint registers the hostname with Stripe on your payment account. The wallets to offer come back on every order read, in payment_collection. Apple Pay and Google Pay setup
Can I keep WooCommerce and take payments through Flint?
Yes. WooCommerce stays the catalog, the cart, and the admin your team fulfills from. Your backend creates a Flint order from the Store API cart, the buyer pays on your domain, and your order.paid webhook handler creates the WooCommerce order through its REST API with set_paid true and the Flint order id as transaction_id. There is no WordPress plugin to install or keep updated. Headless WooCommerce checkout, end to end
How long does a WooCommerce Store API Cart-Token last?
48 hours by default. CartTokenUtils sets the expiry to the current time plus DAY_IN_SECONDS times two, filterable through wc_session_expiration, and signs the token with an at sign prepended to wp_salt(). Its payload carries user_id, exp, and an iss of store-api. With Flint the storefront keeps using it: your backend reads the cart with the same Cart-Token to build the Flint order, so the prices come from WooCommerce rather than from the browser.
Is there a PHP SDK?
Yes. flintpay/flint is Flint’s official PHP SDK, for PHP 8.2 and later with the cURL and JSON extensions and no framework dependency. It is generated from the same API contract as the Node SDK, @flintpay/node, so every public operation is a method in both, and both verify webhook signatures for you. The API is plain HTTP and JSON, so neither is required.
Who processes the cards?
Stripe processes every card. Card details go from your checkout page straight to Stripe and never reach your servers or Flint's. Flint sets up and runs the processing account, so there is one signup, one set of keys, and one processing fee per payment, with no separate Stripe bill.
What does it cost?
Cards cost 3.79% + 35¢, with no monthly fee. When Flint calculates sales tax for you, automatic tax adds 0.50% of payments where Flint collects tax. The sandbox is free and needs no credit card. One processing fee covers Flint and the Stripe processing underneath. Pricing
How do I get started?
Sign up on the web, or create an account from your terminal with flint signup. The sandbox is free, with no credit card and no sales call. Flint onboards US businesses today; buyers can pay from anywhere. Install the PHP or Node SDK, create an order from a test cart, and pay it with the 4242 4242 4242 4242 test card. Then pay with 4000 0025 0000 3155 to run a 3D Secure challenge on your own page. Test cards
Charge your next Store API cart through Flint.
Free sandbox, no credit card, no sales call. WooCommerce keeps the cart and the admin, and Flint takes the payment on your domain.
Or run npm install -g @flintpay/cli && flint signup to create your account and a sandbox key from the terminal. CLI guide

