Create enrollment

Create Enrollment

post

This endpoint will allow you to start an enrollment.

Header parameters
Content-TypestringRequired

Content type of the request.

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

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

Example: 2025-11-13T14:30:00Z
X-LoginstringRequired

Merchant X-Login API Key.

AuthorizationstringRequired

Authorization control hash.

X-Idempotency-KeystringOptional

Unique idempotency key.

Body

Payload to create a new enrollment.

invoice_idstringRequired

Unique deposit ID on your side.

Example: invoiceid10000
countrystringRequired

Country of the deposit (e.g., BR).

Example: BR
currencystringRequired

Currency of the deposit (e.g., BRL).

Example: BRL
start_datestring · dateRequired

Date the enrollment starts. Format YYYY-MM-DD.

Example: 2025-10-22
frequencystring · enumRequired

Frequency of the enrollment.

Example: MONTHLYPossible values:
amountnumber · floatRequired

Amount of the deposit.

Example: 1
amount_typestring · enumRequired

Type of amount.

Example: FIXEDPossible values:
include_first_paymentbooleanRequired

Indicates if a payment will be made as soon as the enrollment is created.

Example: true
success_urlstring · uriRequired

HTTPS URL to redirect customer on success.

Example: https://merchant.com/payment/success
notification_urlstring · uriRequired

HTTPS URL for deposit status change notifications.

Example: https://merchant.com/payment/notification
Responses
200

Enrollment created successfully.

application/json
post
/enrollments
POST /v1/enrollments HTTP/1.1
Host: api-stg.onekeypayments.com
Content-Type: application/json
X-Date: 2025-11-13T14:30:00Z
X-Login: text
Authorization: text
Accept: */*
Content-Length: 452

{
  "invoice_id": "invoiceid10000",
  "country": "BR",
  "currency": "BRL",
  "payer": {
    "first_name": "Ricardo",
    "last_name": "Carlos",
    "document": "01234567890",
    "document_type": "CPF",
    "email": "[email protected]",
    "phone": "+5511999999999"
  },
  "start_date": "2025-10-22",
  "frequency": "MONTHLY",
  "amount": 1,
  "amount_type": "FIXED",
  "include_first_payment": true,
  "success_url": "https://merchant.com/payment/success",
  "notification_url": "https://merchant.com/payment/notification"
}
{
  "enrollment_id": 36,
  "invoice_id": "invoiceid10000",
  "currency": "BRL",
  "country": "BR",
  "amount": 1,
  "status": "PENDING",
  "redirect_url": "https://link.depositcheckout.com/enrollment/checkout/eyJhbGciOiJIUzM4NCJ9.eyJqdGkiOiIzNiIsImlhdCI6MTc2MTMyNDk4NCwiZXhwIjoxNzYyNjIwOTg0LCJsYW5ndWFnZSI6InB0In0.odWD9R6Mh9br53fynu3n2vVBIXCvkOTk74-V4gAaNhurk217WaWUHOrK4CWobz1a",
  "metadata": {
    "qr_code": "data:image/png;base64,iVBORw0KGgo...",
    "digitable_line": "00020101021226990014br.gov.bcb.pix2577pix..."
  }
}

Last updated

Was this helpful?