Storrik LogoStorrik Docs
APIReference

Create a new payment intent

Creates a payment intent for a product or fixed amount.

Default behavior:

  • If type is not provided, it defaults to hosted and returns a hosted checkout url.
  • If type is embed, it returns a client secret for embedded flows.
POST
/v1/payments/intents
Authorization<token>

Use Authorization: Bearer sk_...

In: header

method?string

Payment method. Defaults to card.

Default"card"
Value in"card"
type?string

Checkout mode. Defaults to hosted.

Default"hosted"
Value in"embed" | "hosted"
amountinteger

Amount in the smallest currency unit (cents).

Range50 <= value
currencystring

Currency used on the payment.

Value in"USD" | "EUR" | "GBP" | "AUD" | "CYN" | "CAD"
country?string

Optional ISO country code. Auto determined if missing.

Length2 <= length <= 2
email?string
Formatemail
receipt_email?string
Formatemail
productId?string
variantId?string
customerId?string
quantity?integer
Default1
Range1 <= value
description?string
coupon?string
collect_billing?boolean
Defaultfalse
collect_shipping?boolean
Defaultfalse
metadata?object

Empty Object

success_url?string
Formaturi
cancel_url?string
Formaturi

Response Body

curl -X POST "https://api.storrik.com/v1/payments/intents" \  -H "Content-Type: application/json" \  -d '{    "amount": 50,    "currency": "USD"  }'
{
  "ok": true,
  "clientSecret": "string",
  "pk": "string"
}
Empty
Empty
Empty