curl --request POST \
--url https://api.onepay.la/v1/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"customer_id": "<string>",
"name": "<string>",
"description": "<string>",
"currency": "<string>",
"amount_in_cents": 123,
"reference_price_in_cents": "<string>",
"cicle_frequency": "<string>",
"cicles": 123,
"start_date": "<string>",
"internal_id": "<string>",
"plan_id": "<string>",
"payment_mode": "<string>",
"suggest_auto_debit": true,
"remember_to_pay_before": 123,
"cancel_after_no_payment_before": 123,
"metadata": {},
"trial": {
"trial.has_trial": true,
"trial.trial_days": 123,
"trial.start_trial_date": "<string>"
},
"complex_payments": [
{
"complex_payments[].amount_in_cents": 123,
"complex_payments[].apply_on_cicle": 123,
"complex_payments[].for_cicles": 123,
"complex_payments[].label": "<string>",
"complex_payments[].target_price": "<string>"
}
],
"allows": {
"cards": true,
"accounts": true,
"wallets": true,
"card_extra": true,
"realtime": true,
"pse": true,
"full_extra": true,
"pse_debit": true,
"breb": true
}
}
'{
"id": "9f01f541-7d9c-4f62-88c1-0b0f2c2d4c31",
"name": "OnePay Pro",
"status": "created",
"description": "<p>Plan mensual con onboarding asistido</p>",
"internal_id": "SaaSSpectre",
"plan_id": null,
"coupon_id": null,
"reference_price_in_cents": "44900000",
"currency": "COP",
"amount_in_cents": 44900000,
"cicle_frequency": "monthly",
"cicles": null,
"current_cicle": 0,
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"suggest_auto_debit": true,
"start_date": "2025-01-05T00:00:00.000000Z",
"end_date": null,
"payment_mode": "request",
"trial": {
"has_trial": false,
"start_trial_date": null,
"trial_days": 0
},
"remember_to_pay_before": 3,
"cancel_after_no_payment_before": 2,
"complex_payments": [],
"features": [],
"metadata": {
"salesforce_id": "OP-554"
},
"created_at": "2025-01-02T19:24:48.000000Z",
"updated_at": "2025-01-02T19:24:48.000000Z",
"customer": {
"id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"first_name": "Empresa",
"last_name": "SAS",
"email": "empresa@empresa.com",
"phone": "+573221234567",
"document": "1234567890",
"document_type": "RUT"
}
}
Crea una suscripción recurrente asociada a un cliente.
curl --request POST \
--url https://api.onepay.la/v1/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"customer_id": "<string>",
"name": "<string>",
"description": "<string>",
"currency": "<string>",
"amount_in_cents": 123,
"reference_price_in_cents": "<string>",
"cicle_frequency": "<string>",
"cicles": 123,
"start_date": "<string>",
"internal_id": "<string>",
"plan_id": "<string>",
"payment_mode": "<string>",
"suggest_auto_debit": true,
"remember_to_pay_before": 123,
"cancel_after_no_payment_before": 123,
"metadata": {},
"trial": {
"trial.has_trial": true,
"trial.trial_days": 123,
"trial.start_trial_date": "<string>"
},
"complex_payments": [
{
"complex_payments[].amount_in_cents": 123,
"complex_payments[].apply_on_cicle": 123,
"complex_payments[].for_cicles": 123,
"complex_payments[].label": "<string>",
"complex_payments[].target_price": "<string>"
}
],
"allows": {
"cards": true,
"accounts": true,
"wallets": true,
"card_extra": true,
"realtime": true,
"pse": true,
"full_extra": true,
"pse_debit": true,
"breb": true
}
}
'{
"id": "9f01f541-7d9c-4f62-88c1-0b0f2c2d4c31",
"name": "OnePay Pro",
"status": "created",
"description": "<p>Plan mensual con onboarding asistido</p>",
"internal_id": "SaaSSpectre",
"plan_id": null,
"coupon_id": null,
"reference_price_in_cents": "44900000",
"currency": "COP",
"amount_in_cents": 44900000,
"cicle_frequency": "monthly",
"cicles": null,
"current_cicle": 0,
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"suggest_auto_debit": true,
"start_date": "2025-01-05T00:00:00.000000Z",
"end_date": null,
"payment_mode": "request",
"trial": {
"has_trial": false,
"start_trial_date": null,
"trial_days": 0
},
"remember_to_pay_before": 3,
"cancel_after_no_payment_before": 2,
"complex_payments": [],
"features": [],
"metadata": {
"salesforce_id": "OP-554"
},
"created_at": "2025-01-02T19:24:48.000000Z",
"updated_at": "2025-01-02T19:24:48.000000Z",
"customer": {
"id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"first_name": "Empresa",
"last_name": "SAS",
"email": "empresa@empresa.com",
"phone": "+573221234567",
"document": "1234567890",
"document_type": "RUT"
}
}
COP.amount_in_cents cuando usas pagos complejos.daily, weekly, monthly, annual.null para renovaciones indefinidas.auto_debit) o vía solicitudes (request).true, el checkout sugerirá activar débito automático.Show items
Show properties
active, unpaid, pass_due, canceled, finished, frozen).COP).weekly, monthly, annual, etc.null para indefinido.has_trial, trial_days, start_trial_date).request, auto_debit, etc.).{
"id": "9f01f541-7d9c-4f62-88c1-0b0f2c2d4c31",
"name": "OnePay Pro",
"status": "created",
"description": "<p>Plan mensual con onboarding asistido</p>",
"internal_id": "SaaSSpectre",
"plan_id": null,
"coupon_id": null,
"reference_price_in_cents": "44900000",
"currency": "COP",
"amount_in_cents": 44900000,
"cicle_frequency": "monthly",
"cicles": null,
"current_cicle": 0,
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"suggest_auto_debit": true,
"start_date": "2025-01-05T00:00:00.000000Z",
"end_date": null,
"payment_mode": "request",
"trial": {
"has_trial": false,
"start_trial_date": null,
"trial_days": 0
},
"remember_to_pay_before": 3,
"cancel_after_no_payment_before": 2,
"complex_payments": [],
"features": [],
"metadata": {
"salesforce_id": "OP-554"
},
"created_at": "2025-01-02T19:24:48.000000Z",
"updated_at": "2025-01-02T19:24:48.000000Z",
"customer": {
"id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"first_name": "Empresa",
"last_name": "SAS",
"email": "empresa@empresa.com",
"phone": "+573221234567",
"document": "1234567890",
"document_type": "RUT"
}
}
Was this page helpful?