Recurring Payment Endpoint

Deposit Creation

POST https://api-stg.onekeypayments.com/v3/deposits

In order to create recurring payments, we utilize the same endpoint as for regular deposits, with additional mandatory fields, in order to identify the enrollment and the date. All detailed information for the deposits API can be found here.

Headers

Name
Type
Description

Content-Type

string

application/json

X-Date

string

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

X-Login

string

Merchant X-Login API Key

Authorization

string

Authorization control hash

X-Idempotency-Key

string

Unique idempotency key

Recurring Payment Fields

Name
Type
Description

enrollment

object

Contains the ID and Date

enrollment.id

number

ID of the previously created enrollment. Can be obtained with this endpoint.

enrollment.scheduled_date

date

Scheduled date of the payment, format YYYY-MM-DD

This additional object needs to be included, together with the deposits API fields, in order to create an instance for the customer to pay an automatic PIX. Fields can be found here.

Example Request

{
"invoice_id": "invoiceid10000",
"country": "BR",
"currency": "BRL",
"payment_method": "IXA",
"payer": 
{
    "first_name": "Ricardo",
    "last_name": "Carlos",
    "document": "01234567890",
    "document_type": "CPF",
    "email": "[email protected]",
    "phone": "+5511999999999"
},
"amount": 1,
"success_url": "https://merchant.com/payment/success",
"notification_url": "https://merchant.com/payment/notification",
"back_url": "https://merchant.com/payment/back",
"error_url": "https://merchant.com/payment/error",
"enrollment": 
{
    "id": 30,
    "scheduled_date": "2025-11-22"
}
}

The ID from the enrollment must be acquired from a previously created enrollment; the scheduled date is the date by which the payment needs to be completed by the customer.

Status & Flow

As this works exactly the same as our deposits API, both for the payment flow and the usage of our APIs, the status for each transaction can be handled with our deposit status endpoint, and notification info is also handled in the same manner.

Last updated