API de Descuentos
Ver en POSTMAN
Recurso para obtener los descuentos dados de alta en Increase Pay.
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 un descuento
POST https://gateway.increase.app/pay/public/v1/discounts
Parámetro | Tipo | Descripción | Requerido | Permite update |
---|---|---|---|---|
cycle_unit | String | Unidad de la cantidad de ciclos ("monthly", "daily", "weekly", "yearly"). Default: monthly | si | no |
country | String | País en ISO 3166-1 alpha-3. Ej: ARG | si | no |
name | String | Nombre del Descuento | si | si |
type | String | Tipo de descuento ("flat" o "percentage") | si | no |
currency | String | Moneda en formato ISO 4217. Ej: ARS | si | no |
amount | String | Monto o porcentaje del descuento "1500.0" (\$1500) o "0.4" (40%) | si | si |
duration | String | Tiempo de vigencia del descuento ("periodic", "forever"). Default: periodic | si | no |
cycle_amount | Int | Cantidad de ciclos | no | no |
description | String | Descripcion del Descuento (ej: "Descuento campaña retencion 2020") | no | no |
external_id | String | Id para tu aplicación. | no | si |
Ejemplo
- Request body
- Response
{
"name": "30% Descuento Prueba",
"type": "percentage",
"amount": "0.3",
"currency": "ARG",
"country": "ARG",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 6,
"description": "",
"external_id": ""
}
{
"id": "b5d36020-25e2-4a35-baac-c0a27567fae7",
"external_id": null,
"name": "30% Descuento Prueba",
"type": "percentage",
"amount": "0.3",
"currency": "ARS",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 6,
"created_at": "2020-01-17T17:35:49-03:00",
}
Obtener todos los descuentos
GET
https://gateway.increase.app/pay/public/v1/discounts
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). |
Response
{
"data": [
{
"id": "00000000-0000-0000-0000-000000000001",
"external_id": null,
"name": "ea expedita",
"type": "flat",
"amount": "58065.72",
"currency": "ARS",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 1,
"created_at": "2020-01-17T17:35:49-03:00",
}
],
"current_page": 1,
"per_page": 20,
"total_pages": 1,
"total_elements": 1
}
Obtener un descuento específico
GET
https://gateway.increase.app/pay/public/v1/discounts/<id>
Response
{
"id": "bd9a61bd-c7f1-4920-a832-a43a5084b6f1",
"external_id": "e2dfa853-aba1-4512-846c-c10e42143134",
"name": "New discount",
"type": "flat",
"amount": "120.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"
}
Actualizar un descuento específico
PUT
https://gateway.increase.app/pay/public/v1/discounts/<id>
Ejemplo
- Request body
- Response
{
"name": "40% Descuento Prueba",
"amount": "0.4",
"external_id": null
}
{
"id": "b5d36020-25e2-4a35-baac-c0a27567fae7",
"external_id": null,
"name": "40% Descuento Prueba",
"type": "percentage",
"amount": "0.4",
"currency": "ARS",
"duration": "periodic",
"cycle_unit": "monthly",
"cycle_amount": 6,
"created_at": "2020-01-17T17:35:49-03:00",
"updated_at": "2020-01-17T17:40:49-03:00"
}