OneShot Subscription Creation
The OneShot flow is designed for merchants who are not PCI compliant and cannot handle payment card data directly.
Endpoint
POST https://api-stg.onekeypayments.com/v3/subscriptions
Process
Merchant submits subscription request with customer and billing information
API returns a redirect URL to our secure payment page
Customer completes payment on our PCI-compliant page
System creates subscription and notifies merchant via webhook
Customer is redirected to merchant's success/error URL
This endpoint allows the creation of a new subscription with payment details.
Media type of the body sent to the API.
application/jsonISO8601 Datetime with Timezone (yyyy-MM-dd'T'HH:mm:ssZ)
Merchant X-Login API Key.
Authorization control hash.
Unique idempotency key for ensuring that the same request is not processed more than once.
Unique identifier for the invoice
INV123456Amount to be charged for the subscription
70Three-letter currency code (ISO 4217)
BRLTwo-letter country code (ISO 3166-1 alpha-2)
BRDescription of the subscription
Premium SubscriptionIP address of the client
192.168.1.1URL to redirect after payment process
https://example.com/backURL to redirect after successful payment
https://example.com/successURL to redirect after failed payment
https://example.com/errorURL to send payment status notifications
https://example.com/notifySubscription created successfully
Unique identifier of the created subscription
1234URL to redirect the user to complete the subscription process
https://checkout.cc-stg.checkoutogate.net/validate/6mIsesbbmvYn2hzAOwuYQSMAYIyISUgl?subscriptionId=513Expiration date and time for the subscription checkout process
2025-03-06 15:58:02Amount to be charged for the subscription
70Indicates if the user should be redirected to complete the process
trueBad Request - Invalid input data
Unprocessable Entity - Validation error
Service Unavailable - Error creating subscription
POST /v3/subscriptions HTTP/1.1
Host: api-stg.onekeypayments.com
X-Date: 2026-01-01T00:00:00.000Z
X-Login: text
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 547
{
"invoice_id": "INV123456",
"amount": 70,
"currency": "BRL",
"country": "BR",
"payer": {
"id": "PAYER123",
"document": 123456789,
"document_type": "CPF",
"email": "robertocarlos@example.com",
"first_name": "Roberto",
"last_name": "Carlos"
},
"description": "Premium Subscription",
"subscription": {
"start_date": "2025-01-01",
"plan": "MONTHLY",
"plan_unit": 3,
"auto_renewal": false
},
"client_ip": "192.168.1.1",
"back_url": "https://example.com/back",
"success_url": "https://example.com/success",
"error_url": "https://example.com/error",
"notification_url": "https://example.com/notify"
}{
"subscription_id": 1234,
"redirect_url": "https://checkout.cc-stg.checkoutogate.net/validate/6mIsesbbmvYn2hzAOwuYQSMAYIyISUgl?subscriptionId=513",
"expiration_date": "2025-03-06 15:58:02",
"payment_amount": 70,
"redirect": true
}Successful Response fields
subscription_id
Integer
Unique identifier of the created subscription
1234
redirect_url
String (URI)
URL to redirect the user to complete the subscription process
"https://checkout.cc-dev.onekeypayments.net/validate/<CHECKOUT_TOKEN>?subscriptionId=513"
expiration_date
String (Date-time)
Expiration date and time for the subscription checkout process
"2025-03-06 15:58:02"
payment_amount
Number (Double)
Amount to be charged for the subscription
70.00
redirect
Boolean
Indicates if the user should be redirected to complete the process
true
Response Example
Error Response Structure
code
Integer
Error code indicating the type of error
400
description
String
Human-readable description of the error
"Invalid input data"
type
String
Machine-readable error type identifier
"VALIDATION_ERROR"
Bad Request - Invalid input data
Unprocessable Entity - Validation error
Service Unavailable - Error creating subscription
Subscription Plans
The following subscription frequencies are supported:
DAILY
Recurring billing every day
WEEKLY
Recurring billing every week
MONTHLY
Recurring billing every month
ANNUALLY
Recurring billing every year
Last updated
Was this helpful?

