curl https://api.onepay.la/v1/subscriptions \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: subscription-001" \
-d '{
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"name": "Plan Premium Mensual",
"description": "<p>Acceso completo a todas las funcionalidades</p>",
"currency": "COP",
"amount_in_cents": 44900000,
"reference_price_in_cents": "44900000",
"cicle_frequency": "monthly",
"cicles": null,
"start_date": "2025-03-01T00:00:00Z",
"payment_mode": "request",
"suggest_auto_debit": true,
"remember_to_pay_before": 3,
"cancel_after_no_payment_before": 2,
"trial": {
"has_trial": true,
"trial_days": 14,
"start_trial_date": "2025-02-15T00:00:00Z"
},
"metadata": {
"salesforce_id": "OP-554",
"plan_type": "premium"
}
}'
{
"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 https://api.onepay.la/v1/subscriptions \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: subscription-001" \
-d '{
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"name": "Plan Premium Mensual",
"description": "<p>Acceso completo a todas las funcionalidades</p>",
"currency": "COP",
"amount_in_cents": 44900000,
"reference_price_in_cents": "44900000",
"cicle_frequency": "monthly",
"cicles": null,
"start_date": "2025-03-01T00:00:00Z",
"payment_mode": "request",
"suggest_auto_debit": true,
"remember_to_pay_before": 3,
"cancel_after_no_payment_before": 2,
"trial": {
"has_trial": true,
"trial_days": 14,
"start_trial_date": "2025-02-15T00:00:00Z"
},
"metadata": {
"salesforce_id": "OP-554",
"plan_type": "premium"
}
}'
{
"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
curl https://api.onepay.la/v1/subscriptions \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: subscription-001" \
-d '{
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"name": "Plan Premium Mensual",
"description": "<p>Acceso completo a todas las funcionalidades</p>",
"currency": "COP",
"amount_in_cents": 44900000,
"reference_price_in_cents": "44900000",
"cicle_frequency": "monthly",
"cicles": null,
"start_date": "2025-03-01T00:00:00Z",
"payment_mode": "request",
"suggest_auto_debit": true,
"remember_to_pay_before": 3,
"cancel_after_no_payment_before": 2,
"trial": {
"has_trial": true,
"trial_days": 14,
"start_trial_date": "2025-02-15T00:00:00Z"
},
"metadata": {
"salesforce_id": "OP-554",
"plan_type": "premium"
}
}'
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?