Stripe Create Payment API
Create payments through Stripe with support for subscriptions, one-time purchases, and additional logins
Stripe Create Payment API
Process secure payments through Stripe with full support for subscriptions, one-time purchases, renewals, and additional login purchases. Integrates seamlessly with Stripe's Payment Intents API.
PCI Compliant
Stripe handles all sensitive card data, ensuring PCI DSS compliance.
Global Payments
Accept payments in 135+ currencies from customers worldwide.
Instant Processing
Real-time payment processing with immediate confirmation.
Endpoint Overview
/graphqlCreate a payment through Stripe by providing payment category, group ID, additional login count, renewal option, and Stripe payment method ID.
Request Parameters
categoryPaymentCategory!RequiredThe category of the payment. Values: SUBSCRIPTION, ONE_TIME, ADDON.
groupIdIntRequiredThe ID of the subscription group/plan associated with the payment.
moreLoginCountIntRequiredNumber of additional logins to purchase (set to 0 if not purchasing extra logins).
renewBooleanRequiredSet to true if this payment is for renewing an existing subscription.
stripeMethodIdStringThe Stripe Payment Method ID obtained from Stripe.js or Elements.
Payment Categories
SUBSCRIPTION
Recurring subscription payments with automatic renewal.
ONE_TIME
Single purchase payments for one-time access.
ADDON
Additional features or logins added to existing subscription.
GraphQL Mutation
mutation stripeCreatePayment(
$category: PaymentCategory!
$groupId: Int
$moreLoginCount: Int
$renew: Boolean
$stripeMethodId: String
) {
stripeCreatePayment(
category: $category
groupId: $groupId
moreLoginCount: $moreLoginCount
renew: $renew
stripeMethodId: $stripeMethodId
) {
clientSecret
paymentIntentId
requiresAction
error
}
}Variables:
{
"category": "SUBSCRIPTION",
"groupId": 1,
"moreLoginCount": 0,
"renew": false,
"stripeMethodId": "pm_1234567890"
}HTTP Request:
curl -X POST https://api.orbnet.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"query": "mutation stripeCreatePayment($category: PaymentCategory!, $groupId: Int, $moreLoginCount: Int, $renew: Boolean, $stripeMethodId: String) { stripeCreatePayment(category: $category, groupId: $groupId, moreLoginCount: $moreLoginCount, renew: $renew, stripeMethodId: $stripeMethodId) { clientSecret paymentIntentId requiresAction error } }",
"variables": {
"category": "SUBSCRIPTION",
"groupId": 1,
"moreLoginCount": 0,
"renew": false,
"stripeMethodId": "pm_1234567890"
}
}'Response
clientSecret
The client secret for confirming the payment on the frontend using Stripe.js.
paymentIntentId
Unique identifier for the Stripe Payment Intent. Store this for tracking.
requiresAction
Boolean indicating if 3D Secure or other authentication is required.
error
Error message if payment creation failed. Null on success.
{
"data": {
"stripeCreatePayment": {
"clientSecret": "pi_3abc123_secret_xyz789",
"paymentIntentId": "pi_3abc123",
"requiresAction": false,
"error": null
}
}
}{
"data": {
"stripeCreatePayment": {
"clientSecret": "pi_3abc123_secret_xyz789",
"paymentIntentId": "pi_3abc123",
"requiresAction": true,
"error": null
}
}
}{
"errors": [
{
"message": "Your card was declined",
"path": ["stripeCreatePayment"],
"extensions": {
"code": "PAYMENT_FAILED",
"stripeError": "card_declined"
}
}
],
"data": null
}Implementation Flow
Collect Payment Method
Use Stripe.js or Stripe Elements to securely collect card details and create a Payment Method ID.
Create Payment Intent
Call this API with the Payment Method ID and purchase details to create a Payment Intent.
Handle Authentication
If requiresAction is true, use Stripe.js confirmCardPayment() with the clientSecret for 3D Secure.
Confirm Success
Once payment succeeds, the subscription or purchase is automatically activated.
Best Practices
Use Stripe Elements
Always use Stripe.js and Elements for card collection. Never handle raw card numbers.
Handle 3D Secure
Always check requiresAction and implement 3D Secure flow for compliant payments.
Store Payment Intent ID
Save the paymentIntentId for tracking, refunds, and customer support inquiries.
Webhook Verification
Set up Stripe webhooks to receive payment confirmations and handle async events.
Error Handling
card_declined
Card was declined by the issuing bank. Ask user to try a different card.
insufficient_funds
Card has insufficient funds. User should add funds or use different card.
expired_card
Card has expired. User needs to update card details or use a new card.
authentication_required
3D Secure authentication needed. Handle with confirmCardPayment().
Related Endpoints
Stripe Dashboard
Monitor all payments, refunds, and disputes through your Stripe Dashboard. Configure webhooks to receive real-time payment notifications.
Accept Card Payments
Integrate Stripe payments into your application with our secure, PCI-compliant API. Support cards, Apple Pay, and Google Pay.