API de facturas

Para consultas contactate a pay@increase.app

Recurso para obtener las facturas generadas en Increase Pay o generar facturas nuevas para pagos unicos

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 factura#

POST https://gateway.increase.app/pay/public/v1/invoices

Headers#

Content-Type: application/json
Authorization: Bearer <access_token>
ParámetroTipoDescripción
customer_id*Stringid del cliente asociado
payment_method_idStringMetodo de pago del cliente
currency*StringMoneda
amount*StringMonto total de la factura
success_urlStringURl de exito (https://www.tuempresa.com/gracias)
items*StringConceptos a facturar
external_idStringIdentificador de la factura en tu sistema
collect_methods*ObjectObjeto de configuración de medios de pago que seran ofrecidos al cliente

‚ö†ÔłŹ DEPRECATION WARNING (31-03-2021): el parametro external_reference pasa a llamarse external_id. Si bien sigue siendo posible utilizar external_reference por el momento, este nombre no ser√° valido a partir del 01-07-2021.

Dentro de Items podr√°s enviar los siguientes campos

ParámetroTipoDescripción
currency*StringMoneda
quantity*NumberCantidad
description*StringProducto o Servicio a Facturar
unit_price*StringMonto unitario
amount*StringMonto total del item (quantity x unit price)

Los par√°metros con * son obligatorios. En caso de enviar el payment_method_id vacio la factura otorgar√° luego de crearse un "checkout_link" desde donde el usuario final podr√° cargar el medio de pago.

Si la invoice fue creada con success_url al momento del cliente realizar el pago será redirigido al sitio cargado. Enviaremos también los parametros customer_id, invoice_id y payment_method_id

Collect methods#

El objeto collect_methods admite un solo collect_method por payment_category, excepto para los de tipo mercadopago, en cuyo caso admite todos los que hubieran.

{
"card": [{"id": "..."}],
"cbu": [{"id": "..."}],
"ticket": []
}

Body#

{
"customer_id":"e9af012e-23a6-4b96-9918-2307ffb3aaa6",
"amount": "600.0",
"external_id": "ID de mi sitio",
"currency": "ARS",
"success_url": "https://increase.app/gracias",
"items": [
{
"currency": "ARS",
"quantity": 3,
"description": "Linea 1",
"unit_price": "50.0",
"amount": "150.0"
},
{
"currency": "ARS",
"description": "test",
"quantity": 1,
"unit_price": "450.0",
"amount": "450.0"
}
],
"collect_methods": {
"card": [{
"id": "7936a685-9eaa-4b33-be44-df4240c17412",
"name": "collect method 3",
"type": "mercadopago_connect",
"status": "enabled",
"country": "ARG",
"max_payment_retries": 0,
"retry_period_time": 0,
"retry_period_unit": "days",
"payment_categories": ["card"],
"currencies": [
"ARS"
],
"public_key": "AAAAAAAAAA",
}],
"cbu": [{
"id": "2ae4e61c-0382-4c67-86d0-85fd205823b3",
"name": "collect method 3",
"type": "supervielle",
"status": "enabled",
"country": "ARG",
"max_payment_retries": 0,
"retry_period_time": 0,
"retry_period_unit": "days",
"payment_categories": ["cbu"],
"currencies": [
"ARS"
],
"metadata": {
"company_code": "12345",
"cuit": "20109753395",
"id_size": 11
}
}],
"ticket": []
}
}

Response#

{
"id": "2b4f5310-4be1-4e39-b596-de5676c41705",
"status": "open",
"amount": "100.0",
"external_id": "ID de mi sitio",
"customer": {
"id": "00000000-0000-0000-0000-000000000001",
"external_id": null,
"email": "7brenton_keeling@farrell.name",
"language": "ES",
"timezone": "Buenos Aires",
"first_name": null,
"last_name": null,
"billing_info": {},
"created_at": "2020-03-27T17:23:10-03:00"
},
"payments": [
{
"id": "da23e4a3-90b1-4edb-83ed-fa7053bdb74f",
"status": "open",
"amount": "100.0",
"currency": "ARS",
"payment_method": {
"id": "00000000-0000-0000-0000-000000000001",
"external_id": null,
"data": {
"type": "cbu",
"country": "ARG",
"number": "19101134**4200"
},
"created_at": "2020-03-27T17:23:10-03:00"
},
"events": [],
"created_at": "2020-03-27T17:23:10-03:00",
"rejection_code": null,
"rejection_type": null,
"rejection_description": null,
"paid_at": null
}
],
"currency": "ARS",
"created_at": "2020-03-27T17:23:10-03:00",
"paid_at": null,
"checkout_link": "http://localhost:3000/checkout/bac25f0c-db78-4e38-a951-a255e6a2976a?customer_id=00000000-0000-0000-0000-000000000001&invoice_id=2b4f5310-4be1-4e39-b596-de5676c41705&hash_value=MG4wRVBML3dBeHlHdXBZOHlkTzErbWxKQkdJeWF5RUdvNkx5UWJlNEsvRHdJU0QvTjJzOU9sY1ZiSFN2L25jVWJKM200MGcrVUJqSWRxMUM4N0ZMbTBwdzFrQ3ZLWmdCeSsvUCs4ZFYzaVA4K2JUSDgwZ3o5dGU3NSs4eWJiSnJ1bXl6eEkvK3NNbmdSQT09LS15cXdqNUd5TWxYUWhRT3ZXLS1OZjFXeXRjYW5Rcm1USUJjbnpsdElRPT0=",
"success_url": "https://increase.app/gracias",
"items": [
{
"id": "438be5ee-33ee-44e1-ac39-f3c3874c108f",
"description": "test",
"quantity": 1,
"unit_price": "50.0",
"amount": "50.0",
"currency": "ARS",
"item_number": 0,
"invoiceable_id": null,
"invoiceable_type": null,
"product_name": null
},
{
"id": "35af8dbe-a5b5-42dd-a9f4-49161851a036",
"description": "maiores voluptas",
"quantity": 50,
"unit_price": "50.0",
"amount": "50.0",
"currency": "ARS",
"item_number": 0,
"invoiceable_id": null,
"invoiceable_type": null,
"product_name": null
}
]
}

Obtener todas las facturas#

GET https://gateway.increase.app/pay/public/v1/invoices

Headers#

Content-Type: application/json
Authorization: Bearer <access_token>

Success response

{
"data": [
{
"id": "62a0ef32-91cf-400b-ba85-05fdae8ac0a1",
"status": "open",
"amount": "15.0",
"customer": {
"id": "e9af012e-23a6-4b96-9918-2307ffb3aaa6",
"email": "mailcliente@gmail.com",
"first_name": "Juan",
"last_name": "Perez"
},
"payments": [],
"subscriptions": [
{
"id": "a739c9c9-b0ff-4102-a6da-eded25cde828",
"plan": {
"id": "57b7a2bb-ce27-47fb-88c8-e856f27e30d7",
"name": "Test_Automatico_Plan"
},
"customer": {
"id": "e9af012e-23a6-4b96-9918-2307ffb3aaa6",
"email": "mailcliente@gmail.com",
"first_name": "Juan",
"last_name": "Perez"
},
"quantity": 1,
"amount": "15.0",
"net_amount": "15.0",
"currency": "ARS",
"status": "pending",
"canceled_at": null,
"paused_at": null,
"trial_period_end": "2020-03-03T16:18:39-03:00",
"next_billing_date": "2020-06-03T16:18:39-03:00",
"created_at": "2020-03-03T16:18:39-03:00",
"product": {
"id": "9c1e30d8-04c4-4fae-b486-0ddeda8dea30",
"name": "Test_Automatico"
},
"activate_at": null,
"cancel_at": null
}
],
"currency": "ARS",
"created_at": "2020-03-03T16:18:39-03:00",
"paid_at": null,
"checkout_link": "https://pay.increase.app/invoice/8898b790-b8f4-44d0-b2db-10c4a881da63?invoice_id=62a0ef32-91cf-400b-ba85-05fdae8ac0a1",
"success_url": "https://increase.app/gracias"
}
],
"current_page": 1,
"per_page": 20,
"total_pages": 7,
"total_elements": 124
}

Obtener una factura específica#

GET https://gateway.increase.app/pay/public/v1/invoices/<id>

Headers#

Content-Type: application/json
Authorization: Bearer <access_token>

Success response

{
"id": "62a0ef32-91cf-400b-ba85-05fdae8ac0a1",
"status": "open",
"amount": "15.0",
"customer": {
"id": "e9af012e-23a6-4b96-9918-2307ffb3aaa6",
"external_id": null,
"email": "clienteprueba@ejemplo.com",
"language": "ES",
"timezone": "Buenos Aires",
"first_name": "Juan",
"last_name": "Perez",
"billing_info": {
"id": "9e8aea0b-87d2-453e-9eb6-b74960d5f35d",
"address_line_1": "Hidalgo 142",
"address_line_2": "",
"country": "ARG",
"city": "caba",
"state": "caba",
"zip_code": "1405",
"phone": "1551125155",
"tax_id": "203720423123"
},
"created_at": "2020-03-03T16:18:09-03:00"
},
"payments": [],
"subscriptions": [
{
"id": "a739c9c9-b0ff-4102-a6da-eded25cde828",
"plan": {
"id": "57b7a2bb-ce27-47fb-88c8-e856f27e30d7",
"name": "Test_Automatico_Plan"
},
"customer": {
"id": "e9af012e-23a6-4b96-9918-2307ffb3aaa6",
"email": "clienteprueba@ejemplo.com",
"first_name": "Juan",
"last_name": "Perez"
},
"quantity": 1,
"amount": "15.0",
"net_amount": "15.0",
"currency": "ARS",
"status": "pending",
"canceled_at": null,
"paused_at": null,
"trial_period_end": "2020-03-03T16:18:39-03:00",
"next_billing_date": "2020-06-03T16:18:39-03:00",
"created_at": "2020-03-03T16:18:39-03:00",
"payment_method": null,
"product": {
"id": "9c1e30d8-04c4-4fae-b486-0ddeda8dea30",
"name": "Test_Automatico"
},
"external_id": null,
"activate_at": null,
"cancel_at": null,
"checkout_link": "https://pay.increase.app/checkout/8898b790-b8f4-44d0-b2db-10c4a881da63?subscription_id=a739c9c9-b0ff-4102-a6da-eded25cde828&hash_value=RnhNZHIzTlhaa0dJRGlmNkNRc3Vrd2FTdUFRTVRxSTVjRG9Ic1dTcmkrVnE2SXd5eDZza3lSVlgyTEtuRXZmcGExL0VzR01aUmdDVHE4eWhvVEU9LS03cDRBQUxaUXg4SlRXQnBtLS1NQmhRVXY3MkFkMlBqTHFad29GRDNBPT0="
}
],
"currency": "ARS",
"created_at": "2020-03-03T16:18:39-03:00",
"paid_at": null,
"checkout_link": "https://pay.increase.app/invoice/8898b790-b8f4-44d0-b2db-10c4a881da63?invoice_id=62a0ef32-91cf-400b-ba85-05fdae8ac0a1&hash_value=b0RtMzczNklaYkhUcmlzeTNjOXZ0N0RmUnFabzVVc0s4WVdadDRIbjF4eEhPeWduaVRRQnIyc1BrZkZEZTdsZyt3NlVRTHE0Z0ZuSi0tZEFTUmsyaURCeWJkaWdINS0tWFNTU2RITTF2TFBNMDBoVGQ4N1Vvdz09",
"items": [
{
"id": "37b200de-3f71-41d7-abcf-5846a7e674ca",
"description": "Test_Automatico_Plan",
"quantity": 1,
"unit_price": "15.0",
"amount": "15.0",
"currency": "ARS",
"item_number": 0,
"invoiceable_id": "a739c9c9-b0ff-4102-a6da-eded25cde828",
"invoiceable_type": "Subscription",
"product_name": "Test_Automatico"
}
]
}

Obtener todas las facturas de un cliente específico#

GET https://gateway.increase.app/pay/public/v1/invoices?page=1&per_page=12?customer_id=<customer_id>

Headers#

Content-Type: application/json
Authorization: Bearer <access_token>