LogoLogo
Document ValidationsPayment Methods
Latest
Latest
  • D24 APIs
  • Getting Started with D24
  • API Documentation
    • Deposits API
      • Technical and Security Aspects
        • Calculating the Signature
      • Endpoints
        • Deposit Creation Endpoint
          • Notifications
        • PCI Deposit Creation Endpoint
        • Deposit Status Endpoint
        • Payment Methods Endpoint
        • Currency Exchange Endpoint
        • Crypto Exchange Endpoint
        • Country States Codes Endpoint
        • Refund Creation Endpoint
          • Notifications
        • Refund Status Endpoint
      • Payment Methods
        • 馃寧America
          • 馃嚘馃嚪Argentina
          • 馃嚙馃嚧Bolivia
          • 馃嚙馃嚪Brazil
          • 馃嚚馃嚤Chile
          • 馃嚚馃嚘Canada
          • 馃嚚馃嚧Colombia
          • 馃嚜馃嚚Ecuador
          • 馃嚞馃嚬Guatemala
          • 馃嚥馃嚱Mexico
          • 馃嚨馃嚲Paraguay
          • 馃嚨馃嚜Peru
        • 馃實Africa
          • 馃嚙馃嚰Botswana
          • 馃嚚馃嚥Cameroon
          • 馃嚚馃嚞Congo Brazzaville
          • 馃嚚馃嚛Congo DRC
          • 馃嚜馃嚞Egypt
          • 馃嚞馃嚘Gabon
          • 馃嚞馃嚟Ghana
          • 馃嚚馃嚠Ivory Coast
          • 馃嚢馃嚜Kenya
          • 馃嚦馃嚞Nigeria
          • 馃嚥馃嚰Malawi
          • 馃嚪馃嚰Rwanda
          • 馃嚳馃嚘South Africa
          • 馃嚭馃嚞Uganda
          • 馃嚳馃嚥Zambia
          • 馃嚬馃嚳Tanzania
        • 馃審Asia
          • 馃嚙馃嚛Bangladesh
          • 馃嚚馃嚦China
          • 馃嚟馃嚢Hong Kong
          • 馃嚠馃嚦India
          • 馃嚠馃嚛Indonesia
          • 馃嚡馃嚨Japan
          • 馃嚥馃嚲Malaysia
          • 馃嚨馃嚢Pakistan
          • 馃嚬馃嚟Thailand
          • 馃嚬馃嚪Turkey
          • 馃嚮馃嚦Vietnam
      • API Codes
    • Cashouts API
      • Technical and Security Aspects
        • Calculating the Payload-Signature
      • Endpoints
        • Cashout Creation Endpoint
          • Notifications
        • Cashout Status Endpoint
        • Cashout Update Status Endpoint
        • Cashout Cancellation Endpoint
        • Cashout Bank Codes
      • Countries Validations
        • American Countries
          • 馃嚙馃嚧Bolivia
          • 馃嚙馃嚪Brazil
          • 馃嚚馃嚘Canada
          • 馃嚚馃嚤Chile
          • 馃嚚馃嚧Colombia
          • 馃嚜馃嚚Ecuador
          • 馃嚥馃嚱Mexico
          • 馃嚨馃嚜Peru
          • 馃嚘馃嚪Argentina
          • 馃嚨馃嚲Paraguay
        • African Countries
          • 馃嚙馃嚰Botwsana
          • 馃嚚馃嚥Cameroon
          • 馃嚚馃嚞Congo Brazzaville
          • 馃嚚馃嚛Congo DRC
          • 馃嚜馃嚞Egypt
          • 馃嚞馃嚘Gabon
          • 馃嚞馃嚟Ghana
          • 馃嚢馃嚜Kenya
          • 馃嚥馃嚰Malawi
          • 馃嚦馃嚞Nigeria
          • 馃嚪馃嚰Rwanda
          • 馃嚳馃嚘SOUTH AFRICA
          • 馃嚳馃嚥Zambia
        • Asian Countries
          • 馃嚙馃嚛Bangladesh
          • 馃嚚馃嚦China
          • 馃嚠馃嚦India
          • 馃嚠馃嚛Indonesia
          • 馃嚡馃嚨Japan
          • 馃嚥馃嚲Malaysia
          • 馃嚬馃嚟Thailand
          • 馃嚬馃嚪Turkey
          • 馃嚨馃嚢Pakistan
          • 馃嚮馃嚦Vietnam
        • Oceania Countries
          • 馃嚘馃嚭Australia
      • API Codes
    • Subscriptions API
      • Technical and Security Aspects
        • Calculating the Signature
      • Subscription Creation Endpoints
        • OneShot Subscription Creation
        • PCI Subscription Creation Endpoint
        • Notifications
      • Subscription Cancellation Endpoint
      • Subscription Status Endpoint
    • Bank Accounts Validation API
      • Technical and Security Aspects
        • Calculating the Signature
      • Endpoints
        • Bank Account Validation Endpoint
        • Pix Key Validation Endpoint
      • API Codes
    • KYC API
      • Technical and Security Aspects
        • Calculating the Signature
      • KYC Endpoint
      • API Codes
    • Reconciliation API
      • Technical and Security Aspects
      • Endpoints
      • API Codes
    • Quickpay
      • Endpoints
        • Deposit creation endpoint
          • Notifications
        • Deposit Status Endpoint
    • Tools for Platforms
      • Technical and Security Aspects
        • Calculating the Signature
      • SubMerchant Creation
        • Notifications
      • SubMerchant Status Endpoint
      • Commission Update Endpoint
  • PLUGINS
    • Shopify
      • Installation
      • Onboarding
      • Customer flow
      • Admin Flow
      • Tutorials
      • FAQ
    • WooCommerce
      • Installation
      • Configuration
  • Deposits Tools
    • Cards SDK
      • With User Interface
        • 馃殌Color Customization
      • Without User Interface
    • Java SDK
    • PHP SDK
  • Knowledge Base
    • Countries Specifications
    • Deposits with Cards SDK
      • With User Interface
      • Without User Interface
    • Deposits with 3DS Authentication
    • Deposits with Installments
  • v1 Developers Guide
  • Status Page
Powered by GitBook
On this page

Was this helpful?

  1. API Documentation
  2. Subscriptions API
  3. Subscription Creation Endpoints

PCI Subscription Creation Endpoint

PreviousOneShot Subscription CreationNextNotifications

Last updated 1 month ago

Was this helpful?

The PCI flow is available only to merchants who have achieved PCI compliance and can securely handle credit card information.

Endpoint

POST https://cc-api-stg.directa24.com/v3/subscriptions

Process

  1. Merchant collects payment details directly from customer

  2. Merchant submits complete subscription request including credit card data

  3. System processes payment and creates subscription immediately

  4. API returns subscription confirmation directly in the response

Request Example
{
  "invoice_id": "INV123456",
  "amount": 70.00,
  "currency": "BRL",
  "country": "BR",
  "payer": {
    "id": "PAYER123",
    "document": "123456789",
    "document_type": "CPF",
    "email": "[email protected]",
    "first_name": "John",
    "last_name": "Doe"
  },
  "description": "Premium Subscription",
  "subscription": {
    "start_date": "2025-01-01",
    "plan": "MONTHLY",
    "plan_unit": 1,
    "auto_renewal": false
  },
  "credit_card": {
    "cvv": "123",
    "card_number": "4111111111111111",
    "expiration_month": "12",
    "expiration_year": "25",
    "holder_name": "John Doe"
  },
  "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"
}

Successful Response Structure

Field
Type
Description
Example

subscription_id

Integer

Unique identifier of the created subscription

1234

Example response

{
  "subscription_id": 358
}

Error Response Structure

Field
Type
Description
Example

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

{
  "code": 400,
  "description": "Invalid input data",
  "type": "VALIDATION_ERROR"
}

Unprocessable Entity - Validation error

{
  "code": 422,
  "description": "Validation error",
  "type": "VALIDATION_ERROR"
}

Service Unavailable - Error creating subscription

{
  "code": 503,
  "description": "Error creating subscription",
  "type": "SERVICE_ERROR"
}

Subscription Plans

The following subscription frequencies are supported:

Plan
Description

DAILY

Recurring billing every day

WEEKLY

Recurring billing every week

MONTHLY

Recurring billing every month

ANNUALLY

Recurring billing every year

Tests in STG Environment.

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.

  • POSTCreate a new subscription with credit card details
  • Successful Response Structure
  • Error Response Structure
  • Subscription Plans

Create a new subscription with credit card details

post

This endpoint allows PCI merchants to create a new subscription with direct credit card details.

Header parameters
Content-TypestringRequired

Media type of the body sent to the API.

Default: application/json
X-Datestring 路 date-timeRequired

ISO8601 Datetime with Timezone (yyyy-MM-dd'T'HH:mm:ssZ)

X-LoginstringRequired

Merchant X-Login API Key.

AuthorizationstringRequired

Authorization control hash.

X-Idempotency-KeystringOptional

Unique idempotency key for ensuring that the same request is not processed more than once.

Body
invoice_idstringRequired

Unique identifier for the invoice

Example: INV123456
amountnumber 路 doubleRequired

Amount to be charged for the subscription

Example: 70
currencystringRequired

Three-letter currency code (ISO 4217)

Example: BRL
countrystringRequired

Two-letter country code (ISO 3166-1 alpha-2)

Example: BR
descriptionstringOptional

Description of the subscription

Example: Premium Subscription
client_ipstringOptional

IP address of the client

Example: 192.168.1.1
back_urlstring 路 uriOptional

URL to redirect after payment process

Example: https://example.com/back
success_urlstring 路 uriOptional

URL to redirect after successful payment

Example: https://example.com/success
error_urlstring 路 uriOptional

URL to redirect after failed payment

Example: https://example.com/error
notification_urlstring 路 uriOptional

URL to send payment status notifications

Example: https://example.com/notify
Responses
200
Subscription created successfully
application/json
400
Bad Request - Invalid input data
application/json
422
Unprocessable Entity - Validation error
application/json
503
Service Unavailable - Error creating subscription
application/json
post
POST /v3/subscriptions HTTP/1.1
Host: cc-api-stg.directa24.com
Content-Type: application/json
X-Date: 2025-05-11T14:57:19.453Z
X-Login: text
Authorization: text
Accept: */*
Content-Length: 680

{
  "invoice_id": "INV123456",
  "amount": 70,
  "currency": "BRL",
  "country": "BR",
  "payer": {
    "id": "PAYER123",
    "document": 123456789,
    "document_type": "CPF",
    "email": "[email protected]",
    "first_name": "Roberto",
    "last_name": "Carlos"
  },
  "description": "Premium Subscription",
  "subscription": {
    "start_date": "2025-01-01",
    "plan": "MONTHLY",
    "plan_unit": 1,
    "auto_renewal": false
  },
  "credit_card": {
    "cvv": "123",
    "card_number": "4111111111111111",
    "expiration_month": "12",
    "expiration_year": "25",
    "holder_name": "John Doe"
  },
  "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": 358
}