API de Suscripciones
Ver en POSTMAN
Recurso para obtener las suscripciones dadas de alta en Increase Pay o dar de Alta nuevas suscripciones
Cómo probar
Recuerda usar la Base URL de Sandbox para hacer pruebas:
https://gateway.increase.app/pay-sandbox/public/v1/
URL Producción: https://gateway.increase.app/pay/public/v1/
Recordar siempre enviar en los headers Content-Type: application/json
Crear una suscripción
POST
https://gateway.increase.app/pay/public/v1/subscriptions
Parámetro | Tipo | Descripción | Requerido |
---|---|---|---|
customer_id | String | Id del cliente asociado. | si |
plan_id | String | Id del plan de la suscripción | si |
external_id | String | Identificador del cliente en tu sistema. | no |
tags | String[] | Array de strings para agrupar suscripciones | no |
payment_method_id | String | Id del método de pago del cliente | no |
amount | String | Monto de la suscripción (solo necesaria en variable) | no |
quantity | Number | Solo aplica para planes Escalonados, Escalonados base y por Volumen | no |
trial_period_days | String | Días de prueba gratuitos | no |
discounts | Array | Descuentos asociados | no |
one_time_costs | Array | Pagos únicos asociados. | no |
taxes | Array | Impuestos asociados | no |
additional_costs | Array | Costos adicionales asociados | no |
start_date | String | Fecha de inicio de la suscripción | no |
end_date | String | Fecha de fin de la suscripción | no |
process_sync | Boolean | Opción de pagar en el momento | no |
En caso de enviar el payment_method_id en vacio la suscripción otorgará luego de crearse un "checkout_link" desde donde el usuario final podrá cargar el medio de pago.
Ejemplo
- Request body
- Response
{
"customer_id": "00000000-0000-0000-0000-000000000001",
"plan_id": "00000000-0000-0000-0000-000000000002",
"payment_method_id": "00000000-0000-0000-0000-000000000002",
"start_date": "2020-04-17",
"end_date": "2020-04-30",
"quantity": 1,
"trial_period_days": 7,
"discounts": [
{
"id": "00000000-0000-0000-0000-000000000001"
}
],
"one_time_costs": [
{
"id": "00000000-0000-0000-0000-000000000001"
}
],
"taxes": [
{
"id": "00000000-0000-0000-0000-000000000001"
}
],
"additional_costs": [
{
"id": "00000000-0000-0000-0000-000000000001"
}
]
}
{
"id": "16d419da-ef8f-4238-9daf-708f15c0064b",
"plan": {
"id": "00000000-0000-0000-0000-000000000002",
"name": "officia quia",
"amount": "90.68",
"start_date": "2020-04-17",
"end_date": "2020-04-30",
"currency": "ARS",
"cycle_unit": "monthly",
"cycle_amount": 1,
"type": "usage",
"country": "ARG",
"external_id": null,
"trial_period_days": 7,
"tiers": [],
"charge_after_period": false,
"product_id": "00000000-0000-0000-0000-000000000001",
"automatic_subscription_request_approval": false,
"payment_method": {
"id": "78c37806-6aab-486e-b068-da958c72c8af",
"external_id": null,
"data": {
"type": "cbu",
"country": "ARG",
"number": "07200359**9854"
},
"created_at": "2020-03-03T16:20:03-03:00"
}
},
"customer": {
"id": "00000000-0000-0000-0000-000000000001",
"external_id": null,
"email": "13edwardo.klocko@gutmanngusikowski.net",
"language": "ES",
"timezone": "Buenos Aires",
"first_name": null,
"last_name": null,
"billing_info": {},
"created_at": "2020-03-27T17:23:11-03:00"
},
"quantity": 1,
"amount": "90.68",
"currency": "ARS",
"status": "active",
"canceled_at": null,
"paused_at": null,
"external_id": "00000000-0000-0000-0000-000000000045",
"trial_period_end": "2020-04-03T17:23:11-03:00",
"next_billing_date": "2020-04-03T17:23:11-03:00",
"created_at": "2020-03-27T17:23:11-03:00",
"product": {
"id": "00000000-0000-0000-0000-000000000001",
"name": "ratione earum",
"external_id": null,
"created_at": "2020-03-27T17:23:11-03:00",
"checkout_link": "http://localhost:3000/checkout/00000000-0000-0000-0000-000000000001?product_id=00000000-0000-0000-0000-000000000001&hash_value=R21LdnZzaGw0Q1FicUpLUnplRk5kcndKUFRNUUJZelEwcCt0YkZUZ0JNU3UzUnBKbEE3bFRsREg1RnNIbDdqN0V3Skl5ZDVRQnBZOS0tRkpjVUtBM0lMTXNhY0xjLy0tclRvVHhIdjVTRVZYUUpONTNNSHRyZz09"
},
"discounts": [
{
"id": "00000000-0000-0000-0000-000000000001",
"external_id": null,
"name": "laboriosam fuga",
"type": "flat",
"amount": "97494.46",
"currency": "ARS",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 1,
"created_at": "2020-03-27T17:23:11-03:00",
"description": null
}
],
"invoices": [],
"one_time_costs": [
{
"id": "00000000-0000-0000-0000-000000000001",
"external_id": null,
"name": "consequatur cumque",
"amount": "18.61",
"currency": "ARS"
}
],
"taxes": [
{
"id": "00000000-0000-0000-0000-000000000001",
"type": "flat",
"name": "blanditiis fugit",
"amount": "15090.15",
"region": null,
"created_at": "2020-03-27T17:23:11-03:00",
"country": null,
"description": null,
"external_id": null
}
],
"additional_costs": [
{
"id": "9d59430f-d37e-4c0d-a1c6-60a771b9324f",
"external_id": "85c8ed60-20b1-4f31-a513-1a1edd086e0e",
"name": "30% Paquete premium Prueba",
"type": "percentage",
"amount": "0.3",
"currency": "ARG",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 6,
"created_at": "2023-07-06T18:20:59Z",
"description": ""
}
],
}
Cobrar en el momento.
Reglas de facturacion en el momento de la creacion:
El plan de la susbripcion debe tener el parametro
automatic_subscription_request_approval = true
La suscripción debe ser creada con un payment_method vinculado.
El payment_method debe ser una tarjeta de crédito / débito
La suscripción no debe tener periodo de prueba.
La suscripción no debe programarse para cobrar un día mayor a hoy.
La suscripción debe empezar el mismo dia que es creada ("cobro al inicio del período").
Reglas de activación de una suscripción creadas desde esta nueva funcionalidad:
- Si el payment_method especificado es del tipo CBU la suscripción se creara en estado
active
. - Si la suscripción tiene periodo de prueba se creara en estado
active
y se cobrará cuando corresponda al finalizar el período de prueba. - Si el payment_method es una tarjeta de credito, y se intenta facturar la suscripcion entonces el estado dependera del resultado del
payment
.- Si el payment falla entonces la suscripcion quedará en estado
pending
. - Si el payment es exitoso entonces la suscripcion quedará en estado
active
.
- Si el payment falla entonces la suscripcion quedará en estado
Cómo probar
POST
https://gateway.increase.app/pay/public/v1/subscriptions
⚠️ El parametro
process_sync
es opcional y si se lo setea entrue
se utilizara el flujo de pago en el momento y se aplicaran las reglas antes descritas.
Ejemplo
- Request body
- Response On Error (Procesando el pago)
- Response On success
{
"process_sync": true,
"quantity": 1,
"trial_period_days": 0,
"amount": 100,
"end_date": null,
"external_id": "AA11110000",
"plan_id": "b1eda8d4-e0ce-4411-bf33-8e4ad55c16b6",
"customer_id": "f58fabcd-7635-4cc0-adf1-19f1f3ea5abd",
"payment_method_id": "855784a6-bd1b-4f4f-9fbe-f78fdc30a56b"
}
{
"id": "e7888616-2c31-4ddf-8d72-bff2ba32bb00",
"plan": {
"id": "b1eda8d4-e0ce-4411-bf33-8e4ad55c16b6",
"name": "Test"
},
"customer": {
"id": "f58fabcd-7635-4cc0-adf1-19f1f3ea5abd",
"email": "a@a.com",
"first_name": "a",
"last_name": "test"
},
"quantity": 1,
"amount": "100.0",
"net_amount": "100.0",
"currency": "ARS",
"status": "pending",
"canceled_at": null,
"paused_at": null,
"trial_period_end": "2021-04-14T00:00:00-03:00",
"next_billing_date": "2021-05-14T00:00:00-03:00",
"created_at": "2021-04-14T17:26:36-03:00",
"payment_method": {
"id": "74374b60-2077-4635-a40f-531cc744b2e7",
"external_id": "1618430639737",
"data": {
"country": "ARG",
"number": "450995**3704",
"type": "card",
"cardholder_identification_type": "DNI",
"cardholder_identification_number": "39244184",
"expiration_month": 11,
"expiration_year": 2025,
"first_six_digits": "450995",
"last_four_digits": "3704",
"issuer_name": "Banco Santander",
"cardholder_name": "FUND",
"card_brand_name": "visa",
"card_brand_payment_type_id": "credit_card"
},
"created_at": "2021-04-14T17:03:59-03:00"
},
"product": {
"id": "b80d67e2-f5a4-4ee2-a4f9-992058d77e2d",
"name": "TestPublic API"
},
"external_id": "AA11110000",
"activate_at": null,
"cancel_at": null,
"checkout_link": "https://gateway.increase.app/pay/checkout/v1/short_urls/N4fCIl",
"invoice": {
"id": "92d72cc6-90fa-4d67-b73c-0899ec20b229",
"status": "open",
"amount": "100.0",
"external_id": null,
"customer": {
"id": "f58fabcd-7635-4cc0-adf1-19f1f3ea5abd",
"email": "a@a.com",
"first_name": "a",
"last_name": "test"
},
"subscriptions": [
{
"id": "e7888616-2c31-4ddf-8d72-bff2ba32bb00",
"plan": {
"id": "b1eda8d4-e0ce-4411-bf33-8e4ad55c16b6",
"name": "Test"
},
"customer": {
"id": "f58fabcd-7635-4cc0-adf1-19f1f3ea5abd",
"email": "a@a.com",
"first_name": "a",
"last_name": "test"
},
"quantity": 1,
"amount": "100.0",
"net_amount": "100.0",
"currency": "ARS",
"status": "pending",
"canceled_at": null,
"paused_at": null,
"trial_period_end": "2021-04-14T00:00:00-03:00",
"next_billing_date": "2021-05-14T00:00:00-03:00",
"created_at": "2021-04-14T17:26:36-03:00",
"product": {
"id": "b80d67e2-f5a4-4ee2-a4f9-992058d77e2d",
"name": "TestPublic API"
},
"activate_at": null,
"cancel_at": null
}
],
"currency": "ARS",
"created_at": "2021-04-14T17:26:36-03:00",
"paid_at": null,
"checkout_link": "https://gateway.increase.app/pay/checkout/v1/short_urls/asXf13",
"success_url": "?invoice_id=92d72cc6-90fa-4d67-b73c-0899ec20b229&customer_id=f58fabcd-7635-4cc0-adf1-19f1f3ea5abd&subscription_id=e7888616-2c31-4ddf-8d72-bff2ba32bb00&payment_method_id=74374b60-2077-4635-a40f-531cc744b2e7",
"invoice_items": [
{
"id": "2034b115-d349-4157-8bbd-bad319a2a4d6",
"invoice_id": "92d72cc6-90fa-4d67-b73c-0899ec20b229",
"description": "Test",
"quantity": 1,
"unit_price": "100.0",
"amount": "100.0",
"currency": "ARS",
"item_number": 0,
"invoiceable_id": "e7888616-2c31-4ddf-8d72-bff2ba32bb00",
"invoiceable_type": "Subscription",
"created_at": "2021-04-14T17:26:36.222-03:00",
"updated_at": "2021-04-14T17:26:36.222-03:00",
"product_id": "b80d67e2-f5a4-4ee2-a4f9-992058d77e2d",
"denormalized_product_name": "TestPublic API",
"applicable_type": null,
"applicable_id": null
}
],
"payments": [
{
"id": "32614e5a-0c00-4d57-9c6d-09206d75665a",
"invoice_id": "92d72cc6-90fa-4d67-b73c-0899ec20b229",
"payment_method_id": "74374b60-2077-4635-a40f-531cc744b2e7",
"status": "failed",
"amount": "100.0",
"currency": "ARS",
"id_for_collect_provider": 6895,
"created_at": "2021-04-14T17:26:36.257-03:00",
"updated_at": "2021-04-14T17:26:38.185-03:00",
"denormalized_customer_email": "a@a.com",
"retry_count": 0,
"metadata": {
"mercadopago_id": null,
"authorization_code": "229549003"
},
"rejection_code": "cc_rejected_insufficient_amount",
"rejection_type": "retryable",
"account_id": "4eaf67ba-10ef-4ecb-9288-f8adcb48815f",
"rejection_description": "Monto insuficiente",
"paid_at": null,
"processor_reference_id": null,
"denormalized_customer_first_name": "a",
"denormalized_customer_last_name": "test",
"refund_status": "unrequested"
}
]
},
"errors": {
"status_key": "process_payment_failed",
"status_detail": "Unable to process payment",
"internal_reference": "R31",
"error_message": null
}
}
{
"id": "e7888616-2c31-4ddf-8d72-bff2ba32bb00",
"plan": {
"id": "b1eda8d4-e0ce-4411-bf33-8e4ad55c16b6",
"name": "Test"
},
"customer": {
"id": "f58fabcd-7635-4cc0-adf1-19f1f3ea5abd",
"email": "a@a.com",
"first_name": "a",
"last_name": "test"
},
"quantity": 1,
"amount": "100.0",
"net_amount": "100.0",
"currency": "ARS",
"status": "active",
"canceled_at": null,
"paused_at": null,
"trial_period_end": "2021-04-14T00:00:00-03:00",
"next_billing_date": "2021-05-14T00:00:00-03:00",
"created_at": "2021-04-14T17:26:36-03:00",
"payment_method": {
"id": "74374b60-2077-4635-a40f-531cc744b2e7",
"external_id": "1618430639737",
"data": {
"country": "ARG",
"number": "450995**3704",
"type": "card",
"cardholder_identification_type": "DNI",
"cardholder_identification_number": "39244184",
"expiration_month": 11,
"expiration_year": 2025,
"first_six_digits": "450995",
"last_four_digits": "3704",
"issuer_name": "Banco Santander",
"cardholder_name": "FUND",
"card_brand_name": "visa",
"card_brand_payment_type_id": "credit_card"
},
"created_at": "2021-04-14T17:03:59-03:00"
},
"product": {
"id": "b80d67e2-f5a4-4ee2-a4f9-992058d77e2d",
"name": "TestPublic API"
},
"external_id": "AA11110000",
"activate_at": null,
"cancel_at": null,
"checkout_link": "https://gateway.increase.app/pay/checkout/v1/short_urls/N4fCIl",
"invoice": {
"id": "92d72cc6-90fa-4d67-b73c-0899ec20b229",
"status": "open",
"amount": "100.0",
"external_id": null,
"customer": {
"id": "f58fabcd-7635-4cc0-adf1-19f1f3ea5abd",
"email": "a@a.com",
"first_name": "a",
"last_name": "test"
},
"subscriptions": [
{
"id": "e7888616-2c31-4ddf-8d72-bff2ba32bb00",
"plan": {
"id": "b1eda8d4-e0ce-4411-bf33-8e4ad55c16b6",
"name": "Test"
},
"customer": {
"id": "f58fabcd-7635-4cc0-adf1-19f1f3ea5abd",
"email": "a@a.com",
"first_name": "a",
"last_name": "test"
},
"quantity": 1,
"amount": "100.0",
"net_amount": "100.0",
"currency": "ARS",
"status": "active",
"canceled_at": null,
"paused_at": null,
"trial_period_end": "2021-04-14T00:00:00-03:00",
"next_billing_date": "2021-05-14T00:00:00-03:00",
"created_at": "2021-04-14T17:26:36-03:00",
"product": {
"id": "b80d67e2-f5a4-4ee2-a4f9-992058d77e2d",
"name": "TestPublic API"
},
"activate_at": null,
"cancel_at": null
}
],
"currency": "ARS",
"created_at": "2021-04-14T17:26:36-03:00",
"paid_at": null,
"checkout_link": "https://gateway.increase.app/pay/checkout/v1/short_urls/asXf13",
"success_url": "?invoice_id=92d72cc6-90fa-4d67-b73c-0899ec20b229&customer_id=f58fabcd-7635-4cc0-adf1-19f1f3ea5abd&subscription_id=e7888616-2c31-4ddf-8d72-bff2ba32bb00&payment_method_id=74374b60-2077-4635-a40f-531cc744b2e7",
"invoice_items": [
{
"id": "2034b115-d349-4157-8bbd-bad319a2a4d6",
"invoice_id": "92d72cc6-90fa-4d67-b73c-0899ec20b229",
"description": "Test",
"quantity": 1,
"unit_price": "100.0",
"amount": "100.0",
"currency": "ARS",
"item_number": 0,
"invoiceable_id": "e7888616-2c31-4ddf-8d72-bff2ba32bb00",
"invoiceable_type": "Subscription",
"created_at": "2021-04-14T17:26:36.222-03:00",
"updated_at": "2021-04-14T17:26:36.222-03:00",
"product_id": "b80d67e2-f5a4-4ee2-a4f9-992058d77e2d",
"denormalized_product_name": "TestPublic API",
"applicable_type": null,
"applicable_id": null
}
],
"payments": [
{
"id": "1f834766-1c45-424a-bb9b-0bd3dc4b7a2c",
"invoice_id": "92d72cc6-90fa-4d67-b73c-0899ec20b229",
"payment_method_id": "855784a6-bd1b-4f4f-9fbe-f78fdc30a56b",
"status": "approved",
"amount": "100.0",
"currency": "ARS",
"id_for_collect_provider": 6896,
"created_at": "2021-04-14T17:29:05.694-03:00",
"updated_at": "2021-04-14T17:29:07.568-03:00",
"denormalized_customer_email": "a@a.com",
"retry_count": 1,
"metadata": {
"mercadopago_id": null,
"authorization_code": "229549003"
},
"rejection_code": null,
"rejection_type": null,
"account_id": "4eaf67ba-10ef-4ecb-9288-f8adcb48815f",
"rejection_description": null,
"paid_at": "2021-04-14T17:29:07.552-03:00",
"processor_reference_id": "1235785751",
"denormalized_customer_first_name": "a",
"denormalized_customer_last_name": "test",
"refund_status": "unrequested"
},
{
"id": "32614e5a-0c00-4d57-9c6d-09206d75665a",
"invoice_id": "92d72cc6-90fa-4d67-b73c-0899ec20b229",
"payment_method_id": "74374b60-2077-4635-a40f-531cc744b2e7",
"status": "failed",
"amount": "100.0",
"currency": "ARS",
"id_for_collect_provider": 6895,
"created_at": "2021-04-14T17:26:36.257-03:00",
"updated_at": "2021-04-14T17:26:38.185-03:00",
"denormalized_customer_email": "a@a.com",
"retry_count": 0,
"metadata": {
"mercadopago_id": null,
"authorization_code": "229549003"
},
"rejection_code": "cc_rejected_insufficient_amount",
"rejection_type": "retryable",
"account_id": "4eaf67ba-10ef-4ecb-9288-f8adcb48815f",
"rejection_description": "Monto insuficiente",
"paid_at": null,
"processor_reference_id": null,
"denormalized_customer_first_name": "a",
"denormalized_customer_last_name": "test",
"refund_status": "unrequested"
}
]
},
"errors": null
}
Obtener todas las suscripciones
GET
https://gateway.increase.app/pay/public/v1/subscriptions
Parámetros optativos
Parámetro | Tipo | Descripción |
---|---|---|
page | Integer | Indica la página a obtener resultados. |
per_page | Integer | Cantidad de resultados por página (Máximo 40). |
customer_id | String | Id del cliente asociado. |
plan_id | String | Id del plan de la suscripción |
product_id | String | Id del producto. |
external_id | String | Identificador del cliente en tu sistema. |
tags | String[] | Array de strings que deben cumplir los tags de las suscripciones. |
created_at_from | String | Fecha + Hora en formato ISO 8601. Ej: 2020-10-10T00:00:00 |
created_at_to | String | Fecha + Hora en formato ISO 8601. Ej: 2020-10-10T00:00:00 |
paused_at_from | String | Fecha + Hora en formato ISO 8601. Ej: 2020-10-10T00:00:00 |
paused_at_to | String | Fecha + Hora en formato ISO 8601. Ej: 2020-10-10T00:00:00 |
canceled_at_from | String | Fecha + Hora en formato ISO 8601. Ej: 2020-10-10T00:00:00 |
canceled_at_to | String | Fecha + Hora en formato ISO 8601. Ej: 2020-10-10T00:00:00 |
status | String | Valores posibles: active pending scheduled paused canceled finished trial grace_period pending_approval request_rejected pending_payment pending_canceled pending_finished |
Ejemplo
- Request
- Response
`https://gateway.increase.app/pay/public/v1/subscriptions?page=1&per_page=20&status=active&customer_id=00000000-0000-0000-0000-000000000001&poduct_id=00000000-0000-0000-0000-000000000001`
{
"data": [
{
"id": "00000000-0000-0000-0000-000000000002",
"plan": {
"id": "5e7ed1f9-2740-4404-ab54-27e6930a7858",
"name": "odit quam"
},
"customer": {
"id": "00000000-0000-0000-0000-000000000001",
"email": "12sheryl_douglas@macgyver.info",
"first_name": null,
"last_name": null
},
"quantity": null,
"amount": "0.0",
"currency": "ARS",
"status": "active",
"canceled_at": null,
"paused_at": null,
"trial_period_end": null,
"next_billing_date": null,
"created_at": "2020-03-27T17:23:11-03:00",
"payment_method": null,
"product": {
"id": "00000000-0000-0000-0000-000000000001",
"name": "ipsam quibusdam"
}
},
{
"id": "00000000-0000-0000-0000-000000000001",
"plan": {
"id": "70f1b245-75f8-4ca7-a5b9-0a9733e15d9e",
"name": "quasi odio"
},
"customer": {
"id": "00000000-0000-0000-0000-000000000001",
"email": "12sheryl_douglas@macgyver.info",
"first_name": null,
"last_name": null
},
"quantity": null,
"amount": "27.51",
"currency": "ARS",
"status": "active",
"canceled_at": null,
"paused_at": null,
"trial_period_end": null,
"next_billing_date": null,
"created_at": "2020-03-27T17:23:11-03:00",
"payment_method": null,
"product": {
"id": "00000000-0000-0000-0000-000000000001",
"name": "ipsam quibusdam"
}
}
],
"current_page": 1,
"per_page": 20,
"total_pages": 1,
"total_elements": 2
}
Obtener una suscripción
GET
https://gateway.increase.app/pay/public/v1/subscriptions/<id>
Response
{
"id": "b6fe4476-bff5-4fc9-8e93-164ad89c241e",
"plan": {
"id": "23b8b75f-0679-46ca-9ffb-5377f530b01a",
"name": "New plan cbu",
"amount": "2500.0",
"currency": "ARS",
"cycle_unit": "monthly",
"cycle_amount": 1,
"type": "flat",
"country": "ARG",
"external_id": "41b24ea0-8cf5-48fa-a206-05db619a5231",
"trial_period_days": 10,
"tiers": [],
"charge_after_period": false,
"product_id": "8e0bda25-c446-48a9-aab0-a9a7adc396fd",
"start_day": null,
"charge_proportional": null,
"automatic_subscription_request_approval": true,
"checkout_link": "https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/oP23wN",
"success_url": "",
"collect_methods": {
"cbu": [
{
"id": "a2bb722a-9d6d-4bdc-92ec-a8e329ec7358",
"name": "comafi",
"type": "comafi",
"status": "enabled",
"country": "ARG",
"max_payment_retries": 1,
"retry_period_time": 1,
"retry_period_unit": "hours",
"currencies": [
"ARS"
],
"payment_categories": [
"cbu"
],
"metadata": {
"company_code": "merch",
"cuit": "30710123388",
"account_number": "221312344565671",
"beneficiary": "merchantex",
"id_size": 1
}
}
],
"card": [],
"ticket": []
},
"locked": false,
"taxes": [
{
"id": "9cacf4ba-080f-4120-a84e-6b824e92fe39",
"type": "flat",
"name": "New tax",
"amount": "130.0",
"region": null,
"created_at": "2021-09-30T15:04:36-03:00",
"country": "ARG",
"description": "Tax description updated",
"external_id": "9e8bc664-dd8f-4477-8336-0d2663536c86"
}
],
"discounts": [
{
"id": "bd9a61bd-c7f1-4920-a832-a43a5084b6f1",
"external_id": "e2dfa853-aba1-4512-846c-c10e42143135",
"name": "New discount",
"type": "flat",
"amount": "130.0",
"currency": "ARS",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 10,
"created_at": "2021-09-30T14:54:56-03:00",
"description": "A description of the discount"
}
],
"one_time_costs": [
{
"id": "716d64f8-1b2f-4bf7-b2ba-3da72382244a",
"external_id": "994702d6-63b1-43ad-acd0-53686675bf65",
"type": "flat",
"name": "New one time cost",
"description": "A description of the one time cost",
"amount": "1300.0",
"country": "ARG",
"currency": "ARS"
}
]
"additional_costs": [
{
"id": "9d59430f-d37e-4c0d-a1c6-60a771b9324f",
"external_id": "85c8ed60-20b1-4f31-a513-1a1edd086e0e",
"name": "30% Paquete premium Prueba",
"type": "percentage",
"amount": "0.3",
"currency": "ARG",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 6,
"created_at": "2023-07-06T18:20:59Z",
"description": ""
}
],
},
"customer": {
"id": "4b214574-8870-49a0-a91e-3e9ac73fd333",
"external_id": "",
"email": "test@test.com",
"language": "ES",
"timezone": "Buenos Aires",
"first_name": "Customer",
"last_name": "Test",
"billing_info": {
"id": "55fcce19-0b77-4c96-ac1c-fff100d86ac2",
"address_line_1": "Broadway 123",
"address_line_2": "",
"country": "ARG",
"currency": "ARS",
"city": "City",
"state": "Buenos Aires",
"zip_code": "1112",
"phone": "111212123"
},
"tax_id": "20123123458",
"checkout_link": "https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/n0EGp2",
"created_at": "2021-09-29T17:41:12-03:00"
},
"quantity": 1,
"amount": "2500.0",
"net_amount": "5300.0",
"currency": "ARS",
"status": "active",
"canceled_at": null,
"paused_at": null,
"trial_period_end": "2021-10-05T00:00:00-03:00",
"next_billing_date": "2021-10-05T00:00:00-03:00",
"created_at": "2021-09-30T16:43:51-03:00",
"payment_method": {
"id": "ec266d72-9af8-4fff-b95b-783a7751f0db",
"external_id": "a2bb722a-9d6d",
"data": {
"type": "cbu",
"country": "ARG",
"number": "94256727**4643"
},
"created_at": "2021-09-30T09:52:24-03:00",
"collect_method_id": "a2bb722a-9d6d-4bdc-92ec-a8e329ec7358"
},
"product": {
"id": "8e0bda25-c446-48a9-aab0-a9a7adc396fd",
"name": "New product",
"external_id": null,
"created_at": "2021-09-29T15:58:51-03:00",
"checkout_link": "https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/qSR6_P"
},
"external_id": "edff0eed-67b7-409d-abf2-517ebd0f80a0",
"activate_at": "2021-09-30",
"cancel_at": null,
"checkout_link": "https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/WUGFi3",
"discounts": [
{
"id": "bd9a61bd-c7f1-4920-a832-a43a5084b6f1",
"external_id": "e2dfa853-aba1-4512-846c-c10e42143135",
"name": "New discount",
"type": "flat",
"amount": "130.0",
"currency": "ARS",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 10,
"cycle_amounts_left": 7,
"created_at": "2021-09-30T14:54:56-03:00",
"description": "A description of the discount"
},
{
"id": "bb913fef-135c-4901-a637-c2efb4b37b07",
"external_id": "e2dfa853-aba1-4512-846c-c10e42143134",
"name": "New discount for subscription",
"type": "flat",
"amount": "120.0",
"currency": "ARS",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 10,
"cycle_amounts_left": 6,
"created_at": "2021-09-30T16:42:47-03:00",
"description": "A description of the discount"
}
],
"invoices": [],
"one_time_costs": [
{
"id": "716d64f8-1b2f-4bf7-b2ba-3da72382244a",
"external_id": "994702d6-63b1-43ad-acd0-53686675bf65",
"type": "flat",
"name": "New one time cost",
"description": "A description of the one time cost",
"amount": "1300.0",
"country": "ARG",
"currency": "ARS",
"cycle_amounts_left": 1,
},
{
"id": "af2fa75f-2bfc-489d-8501-286ae421c7a5",
"external_id": "asad123-123asd",
"type": "flat",
"name": "New one time cost for subscription",
"description": "A description of the one time cost",
"amount": "1500.0",
"country": "ARG",
"currency": "ARS",
"cycle_amounts_left": 0,
}
],
"taxes": [
{
"id": "9cacf4ba-080f-4120-a84e-6b824e92fe39",
"type": "flat",
"name": "New tax",
"amount": "130.0",
"region": null,
"created_at": "2021-09-30T15:04:36-03:00",
"country": "ARG",
"description": "Tax description updated",
"external_id": "9e8bc664-dd8f-4477-8336-0d2663536c86"
},
{
"id": "e9cc9167-7796-4e10-8ee5-ad6ae4a0beb4",
"type": "flat",
"name": "New tax for subscription",
"amount": "120.0",
"region": null,
"created_at": "2021-09-30T16:43:29-03:00",
"country": "ARG",
"description": "Tax description",
"external_id": "9e8bc664-dd8f-4477-8336-0d2663536c85"
}
]
}
Pausar una suscripción
POST
https://gateway.increase.app/pay/public/v1/subscriptions/<id>/pause
Parámetros optativos
Parámetro | Tipo | Descripción |
---|---|---|
periods | Integer | Cantidad de periodos a pausar la suscripción. Si no se envía, se pausa indefinidamente |
Cancelar una suscripción
PATCH
https://gateway.increase.app/pay/public/v1/subscriptions/<id>/cancel
Reactivar una suscripción
POST
https://gateway.increase.app/pay/public/v1/subscriptions/<id>/activate
Parámetro | Tipo | Descripción |
---|---|---|
start_date | String | Fecha de inicio de la suscripción |
Actualizar una suscripción específica
PUT
https://gateway.increase.app/pay/public/v1/subscriptions/<id>
Parámetro | Tipo | Descripción | Requerido |
---|---|---|---|
next_billing_date | Date | Fecha del siguiente cobro. Fecha en formato ISO 8601. Ej: 2020-10-10 | no |
trial_period_end | Date | Fecha de finalización del período de prueba. Fecha en formato ISO 8601. Ej: 2020-10-10 | no |
one_time_costs | Array | Pagos únicos asociados. | no |
discounts | Array | Descuentos asociados | no |
taxes | Array | Impuestos asociados | no |
additional_costs | Array | Costos adicionales asociados | no |
tags | string[] | Array de strings para agrupar suscripciones | no |
Validaciones del next_billing_date
El next_billing_date se puede cambiar si la suscripción se encuentra en alguno de los siguientes estados:
- active
- scheduled
- trial
- grace_period
Ejemplo
- Request body
- Response
{
"amount": "200",
"quantity": 2,
"trial_period_end": "2021-10-13",
"next_billing_date": "2021-10-15",
"payment_method_id": "16fe4476-bff5-4fc9-8e93-164ad89c241a",
"external_id": "2bfe4476-bff5-4fc9-8e93-164ad89c241e",
"one_time_costs": [
{
"id": "3bae4476-bff5-4fc9-8e93-164ad89c241e"
}
],
"discounts": [
{
"id": "14fe4476-bff5-4fc9-8e93-164ad89c241e",
"cycle_amounts_left": 1
}
],
"taxes": [
{
"id": "01fe4476-bff5-4fc9-8e93-164ad89c241e"
}
]
"additional_costs": [
{
"id": "00000000-0000-0000-0000-000000000001"
}
]
}
{
"id": "0bcf8a6f-6cae-4ab4-961d-9a8e676eb646",
"plan": {
"id": "23b8b75f-0679-46ca-9ffb-5377f530b01a",
"name": "New plan cbu"
},
"customer": {
"id": "93009d86-698a-4224-a2e0-cb9cf1b257e3",
"email": "test3@test.com",
"first_name": "Customer",
"last_name": "Test3"
},
"quantity": 1,
"amount": "2500.0",
"net_amount": "3800.0",
"currency": "ARS",
"status": "pending",
"canceled_at": null,
"paused_at": null,
"trial_period_end": "2021-10-13T00:00:00-03:00",
"next_billing_date": "2021-10-15T00:00:00-03:00",
"created_at": "2021-10-01T10:07:28-03:00",
"payment_method": null,
"product": {
"id": "8e0bda25-c446-48a9-aab0-a9a7adc396fd",
"name": "New product"
},
"external_id": "edff0eed-67b7-409d-abf2-517ebd0f80a12",
"activate_at": "2021-10-01",
"cancel_at": null,
"checkout_link": "https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/qmwMbf"
}