Prepare a checkout setup intent
const url = 'https://apisandbox.puurk.com/checkout/prepare-setup';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"oid":"example","client_id":"example","uid":"example","customer_name":"example","customer_email":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://apisandbox.puurk.com/checkout/prepare-setup \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "oid": "example", "client_id": "example", "uid": "example", "customer_name": "example", "customer_email": "example" }'Creates a Stripe SetupIntent so a card can be stored on file without an immediate charge (used for $0-down plans). Returns the client secret and publishable key needed to collect the card with Stripe Elements.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Setup intent to prepare
object
Organization ID the setup intent belongs to
Your own identifier for the customer. See CheckoutPrepareRequest — the same shared-customer caveat applies.
Puurk user ID of the customer. Rejected for service-token callers, which must use client_id.
Customer name, used when creating a new payment customer
Customer email. Required when neither client_id nor uid is supplied.
Examplegenerated
{ "oid": "example", "client_id": "example", "uid": "example", "customer_name": "example", "customer_email": "example"}Responses
Section titled “Responses”Successful operation
object
SetupIntent client secret, for Stripe Elements
Puurk’s Stripe publishable key, for initializing Stripe.js
Stripe SetupIntent ID
Stripe customer ID
Examplegenerated
{ "client_secret": "example", "publishable_key": "example", "setup_intent_id": "example", "customer_id": "example"}Invalid parameter
Unauthorized
Unable to process request