OneShot Subscription Creation
The OneShot flow is designed for merchants who are not PCI compliant and cannot handle payment card data directly.
Last updated
The OneShot flow is designed for merchants who are not PCI compliant and cannot handle payment card data directly.
Last updated
POST https://api-stg.onekeypayments.com/v3/subscriptions
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
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/6mIsesbbmvYn2hzAOwuYQSMAYIyISUgl?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
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"
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
To test the Subscriptions API in the staging environment, use the parameter plan
with the value TEST
inside the subscription[]
object when calling either the OneShot or PCI endpoints.
This triggers simulated deposits every minute, along with the corresponding webhook events, so you can quickly verify the full subscription lifecycle.
The number of deposits generated depends on the value of the plan_unit
parameter, making it easy to observe the expected behavior in just a few minutes.
This endpoint allows the creation of a new subscription with payment details.
Media type of the body sent to the API.
application/json
ISO8601 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
INV123456
Amount to be charged for the subscription
70
Three-letter currency code (ISO 4217)
BRL
Two-letter country code (ISO 3166-1 alpha-2)
BR
Description of the subscription
Premium Subscription
IP address of the client
192.168.1.1
URL to redirect after payment process
https://example.com/back
URL to redirect after successful payment
https://example.com/success
URL to redirect after failed payment
https://example.com/error
URL to send payment status notifications
https://example.com/notify