Events
Create a payment sheet PaymentIntent
POST
/events/:eventId/tickets/:ticketId/payment-intentCreate a PaymentIntent so a mobile app can charge through the Stripe payment sheet. Like prepaid checkout, survey answers and profile fields are stored first and inventory is held for a limited time. Entries are created by the payment-completed webhook.
| Auth | Login required |
|---|
Path parameters
eventIdstringrequiredEvent ID or slug.
ticketIdstringrequiredTicket type ID.
Request body
quantitynumberoptionalNumber of tickets (default 1). Survey answers and profile fields are not required when buying more than one.
Array of survey answers; each element has questionId (required) and answer (array of strings).
Profile fields collected at registration.
invitationCodestringoptionalReferral code; exactly 8 characters. Any discount is applied to the amount.
joinCommunityIdsstring[]optionalIDs of organizer communities to join along with the purchase.
Response
| Field | Type | Description |
|---|---|---|
publishableKey | string | Stripe publishable key for initializing the payment sheet. |
paymentIntentClientSecret | string | The PaymentIntent client secret. |
customerId | string | Stripe customer ID. |
ephemeralKeySecret | string | Ephemeral key for the customer, used by the payment sheet to save payment methods. |
stripeAccountId | string | Connected account ID; present only for Connect payments. |
amount | number | The amount charged, in JPY (tax inclusive). |
amountSubtotal | number | List price total before discounts, in JPY. |
Request
curl https://api.4s.link/events/EVENT_ID/tickets/TICKET_ID/payment-intent \-X POST \-H "Authorization: Bearer 4s_at_..." \-H "Content-Type: application/json" \-d '{"quantity": 1,"questionAnswers": [{ "questionId": "q1a2b3c4-...", "answer": ["情報収集のため"] }]}'
Example response
{"publishableKey": "pk_test_...","paymentIntentClientSecret": "pi_..._secret_...","customerId": "cus_...","ephemeralKeySecret": "ek_test_...","amount": 5000,"amountSubtotal": 5000}