Skip to main content
The Checkout Optimize API returns a decision package that ranks available payment methods for a given checkout session.

Endpoint

POST /api/shopify/checkout-optimize

Request

Headers

Content-Type: application/json

Body

{
  "shop_domain": "example.myshopify.com",
  "cart_value": 85,
  "currency_code": "EUR",
  "country_code": "DE",
  "device_type": "mobile",
  "checkoutToken": "abc123",
  "default_fops": ["card", "paypal", "klarna"],
  "presented_payment_methods": ["card", "paypal", "klarna"]
}

Request Fields

FieldTypeDescription
shop_domainstringYour shop identifier
cart_valuenumberTotal transaction amount
currency_codestringISO 4217 currency code
country_codestringISO 3166-1 country code
device_typestringmobile or desktop
checkoutTokenstringUnique checkout session identifier
default_fopsarrayPayment methods available to the shopper
presented_payment_methodsarrayPayment methods currently displayed at checkout

Response

{
  "status": "ok",
  "ab_variant": "optimize",
  "was_optimized": true,
  "shadow_engine": {
    "scored": [
      { "code": "paypal", "score": 0.82 },
      { "code": "card", "score": 0.74 }
    ]
  },
  "gating_passed": true
}

Response Fields

FieldTypeDescription
statusstringRequest status: ok or error
ab_variantstringTest group assignment: control or optimize
was_optimizedbooleanWhether the API applied optimization to this session
shadow_engine.scoredarrayPayment methods ranked by conversion likelihood, highest score first
gating_passedbooleanWhether to display the optimization advisory to the shopper

Security & Privacy

  • This API does not process or store payment data
  • No cardholder information is required or transmitted
  • Optimization occurs before payment execution

Next Steps

  • See Webhooks to track checkout outcomes
  • See How It Works to understand the ranking algorithm