PCI Subscription Creation Endpoint
Last updated
Last updated
The PCI flow is available only to merchants who have achieved PCI compliance and can securely handle credit card information.
POST https://cc-api-stg.onekeypayments.com/v3/subscriptions
Merchant collects payment details directly from customer
Merchant submits complete subscription request including credit card data
System processes payment and creates subscription immediately
API returns subscription confirmation directly in the response
subscription_id
Integer
Unique identifier of the created subscription
1234
Example response
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 PCI merchants to create a new subscription with direct credit card 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