premiumpay API for data (1.0.0)
Download OpenAPI specification:Download
API to obtain data about sales and channel performance All POST endpoints require a valid JWT token to be included in the Authorization header and a header X-client-id with the client_id provided by premiumpay.
status of api server
Return the status of the server and the rate limit of the user
Authorizations:
header Parameters
| X-client-id required | string <= 50 characters |
Responses
Response samples
- 200
- 401
- 403
- 415
- 429
{- "status": "ko",
- "ratelimit": {
- "rateLimit": 100,
- "rateLimitPeriod": 3600,
- "rateLimitRemaining": 0,
- "rateLimitReset": 1616425200
}
}sales data
Retrieve sales data for a period. The request must include the start_date_time and end_date_time parameters and the pasarela_id parameter (gateway id). The service_id parameter is optional. If the service_id parameter is included, the request will return the sales of the service. If the service_id parameter is not included, the request will return the sales of all the services belonging the gateway.
Authorizations:
header Parameters
| X-client-id required | string <= 50 characters |
Request Body schema: application/json
| start_date_time required | string <date-time> |
| end_date_time required | string <date-time> |
| pasarela_id | integer |
| service_id | integer |
Responses
Request samples
- Payload
{- "start_date_time": "2019-08-24T14:15:22Z",
- "end_date_time": "2019-08-24T14:15:22Z",
- "pasarela_id": 0,
- "service_id": 0
}Response samples
- 200
- 401
- 403
- 415
- 429
[- { }
]gateways list
Retrieve list of gateways. The request must include the include_services parameter. If the include_services parameter is 'yes', the request will return the services of the gateway. If the include_services parameter is not included or have another value, the request will return the gateways without services list.
Authorizations:
header Parameters
| X-client-id required | string <= 50 characters |
Request Body schema: application/json
| include_services | string Enum: "yes" "no" |
Responses
Request samples
- Payload
{- "include_services": "yes"
}Response samples
- 200
- 401
- 403
- 415
- 429
[- {
- "id": 1,
- "idpasarela": "6112",
- "nombre": "angel gateway",
- "activo": true,
- "emailremitente": "user@example.com",
- "emailrecibir": "user@example.com",
- "logo": "pasarela_574_dc09d6295abb0408.png",
- "nombreTipster": "Tipsterguay",
- "servicios": [
- {
- "idproducto": 0,
- "idpasarela": 0,
- "descripcion": "string",
- "precio": "string",
- "precioCop": 0,
- "moneda": "string",
- "enlace": "string",
- "tipster": "string",
- "emailtipster": "string",
- "emailcomprador": "string",
- "activo": true,
- "devoluciones": true,
- "imagen_filename": "string",
- "essubscripcion": true,
- "periodoDias": 0,
- "periodo_intervalo": "string",
- "periodo_intervalo_cantidad": 0,
- "telegram_token": "string",
- "telegram_idcanal": "string",
- "telegram_namecanal": "string",
- "stripe_productid": "string",
- "stripe_priceid": "string",
- "canal_gestionado": true,
- "apikey": "string",
- "telegram_bot_idtelegram_bot": 0,
- "contenido": "string",
- "telegram_bot_name": "string"
}
]
}
]aggregated sales for a period
Retrieve aggregated sales data for a period. The request must include the start_date_time and end_date_time parameters and the aggregate_field parameter. The aggregate_field parameter can be 'country', 'payment_method' or 'service'.
Authorizations:
header Parameters
| X-client-id required | string <= 50 characters |
Request Body schema: application/json
| start_date_time required | string <date-time> |
| end_date_time required | string <date-time> |
| aggregate_field | string Enum: "country" "payment_method" "service" |
Responses
Request samples
- Payload
{- "start_date_time": "2019-08-24T14:15:22Z",
- "end_date_time": "2019-08-24T14:15:22Z",
- "aggregate_field": "country"
}Response samples
- 200
- 401
- 403
- 415
- 429
[- {
- "n_transacciones": 0,
- "pais": "string",
- "pais_nice": "string",
- "payment": "string",
- "quantity": 0
}
]channel list
Retrieve list of channels. The request can include the include_links parameter to return channel links. Additionally, you can filter channels by specific link names or exclude channels that have the specified link names. If include_links is 'yes', the response will include channel links. If exclude_link_names is 'yes' and link_names is provided, it will return channels that do NOT have the specified link names. You can also specify which fields to include in the response for both channels and links using channel_fields and link_fields. The consolidate_links parameter allows you to consolidate link data in the response.
Authorizations:
header Parameters
| X-client-id required | string <= 50 characters |
Request Body schema: application/jsonoptional
| include_links | string Default: "no" Enum: "yes" "no" Whether to include links in the response. Defaults to "no". |
| link_names | Array of strings Optional array of link names to filter channels by. |
| exclude_link_names | string Default: "no" Enum: "yes" "no" Optional parameter. When set to "yes" and link_names is provided, returns channels that do NOT have the specified link names. Only used if link_names has values. |
| channel_fields | Array of strings Optional array of channel field names to include in the response. If not specified, all channel fields are returned. |
| link_fields | Array of strings Optional array of link field names to include in the response when include_links is "yes". If not specified, all link fields are returned. |
| consolidate_links | string Default: "no" Enum: "yes" "no" Optional parameter. When set to "yes", consolidates link data in the response. Defaults to "no". |
Responses
Request samples
- Payload
{- "include_links": "yes",
- "link_names": [
- "string"
], - "exclude_link_names": "yes",
- "channel_fields": [
- "nombre",
- "is_default_bot",
- "num_enlaces"
], - "link_fields": [
- "telegram_namecanal",
- "nombre",
- "entradas_unicas",
- "entradas_total",
- "pagos_importe",
- "safecode",
- "pagos_num",
- "aprobacion_automatica"
], - "consolidate_links": "yes"
}Response samples
- 200
- 401
- 403
- 415
- 429
[- {
- "id": 40,
- "nombre": "test bienvenida",
- "activo": true,
- "telegramToken": "1710246670_cbef",
- "telegramIdcanal": "-1002087167666",
- "telegramNamecanal": "bienvenida",
- "tsRegistered": 1710246670,
- "tsInit": null,
- "lastfijadoBoton": null,
- "lastfijadoUrl": null,
- "lastfijadoMensaje": null,
- "welcomeBoton": null,
- "welcomeUrl": null,
- "welcomeMensaje": null,
- "telegramBotIdtelegramBot": "Banner Bot",
- "links": [
- {
- "idtelegram_publicidad_acceso": 136,
- "nombre": "test manual",
- "duracion_horas": 0,
- "numero_usuarios": 0,
- "requiere_aprobacion": true,
- "aprobacion_automatica": false,
- "fecha_creacion": {
- "date": "2024-03-12 13:32:14.000000",
- "timezone_type": 3,
- "timezone": "UTC"
}, - "telegram_token": null,
- "telegram_idcanal": "-1002087167666",
- "telegram_namecanal": "bienvenida",
- "telegram_bot_idtelegram_bot": "Banner Bot",
- "login_business_id": 6112,
- "activo": true,
- "fecha_inicio": null,
- "telegram_channel_idtelegram_channel": 40
}
]
}
]List of channel results
Retrieve list of channel results. The request must include the start_date_time and end_date_time parameters and the channel_id parameter. The invitation_link parameter is optional. If the invitation_link parameter is included, the request will return the results of the invitation link. If the invitation_link parameter is not included, the request will return the results of the channel.
Authorizations:
header Parameters
| X-client-id required | string <= 50 characters |
Request Body schema: application/json
| start_date_time required | string <date-time> |
| end_date_time required | string <date-time> |
| channel_id | integer |
| invitation_link | string |
Responses
Request samples
- Payload
{- "start_date_time": "2019-08-24T14:15:22Z",
- "end_date_time": "2019-08-24T14:15:22Z",
- "channel_id": 0,
- "invitation_link": "string"
}Response samples
- 200
- 401
- 403
- 415
- 429
[- {
- "idtelegram_publicidad_acceso": 0,
- "nombre": "string",
- "duracion_horas": 0,
- "numero_usuarios": 0,
- "requiere_aprobacion": true,
- "aprobacion_automatica": true,
- "fecha_creacion": {
- "date": "2019-08-24T14:15:22Z",
- "timezone_type": 0,
- "timezone": "string"
}, - "safecode": "string",
- "telegram_token": "string",
- "telegram_idcanal": "string",
- "telegram_namecanal": "string",
- "telegram_bot_idtelegram_bot": "string",
- "login_business_id": 0,
- "activo": true,
- "fecha_inicio": "2019-08-24T14:15:22Z",
- "telegram_channel_idtelegram_channel": 0,
- "solicitudes": 0,
- "entradas_unicas": 0,
- "entradas_total": 0,
- "salidas_unicas": 0,
- "salidas_total": 0,
- "pagos_num": 0,
- "pagos_importe": "string",
- "welcome_boton": "string",
- "welcome_url": "string",
- "welcome_mensaje": "string",
- "solicitudesPendientes": "string",
- "entradasUnicas": "string",
- "entradasSinSalida": "string",
- "numPagos": 0,
- "importePagos": 0
}
]sales of a channel
Retrieve sales data of a channel. The request must include the start_date_time and end_date_time parameters and the channel_id parameter. The invitation_link parameter is optional. If the invitation_link parameter is included, the request will return the sales of the invitation link. If the invitation_link parameter is not included, the request will return the sales of all the invitation links of the channel.
Authorizations:
header Parameters
| X-client-id required | string <= 50 characters |
Request Body schema: application/json
| start_date_time required | string <date-time> |
| end_date_time required | string <date-time> |
| channel_id | integer |
| invitation_link | string |
Responses
Request samples
- Payload
{- "start_date_time": "2019-08-24T14:15:22Z",
- "end_date_time": "2019-08-24T14:15:22Z",
- "channel_id": 0,
- "invitation_link": "string"
}Response samples
- 200
- 401
- 403
- 415
- 429
[- {
- "idtelegram_publicidad_acceso": 0,
- "nombre": "string",
- "duracion_horas": 0,
- "numero_usuarios": 0,
- "requiere_aprobacion": true,
- "aprobacion_automatica": true,
- "fecha_creacion": {
- "date": "2019-08-24T14:15:22Z",
- "timezone_type": 0,
- "timezone": "string"
}, - "safecode": "string",
- "telegram_token": "string",
- "telegram_idcanal": "string",
- "telegram_namecanal": "string",
- "telegram_bot_idtelegram_bot": "string",
- "login_business_id": 0,
- "activo": true,
- "fecha_inicio": "2019-08-24T14:15:22Z",
- "telegram_channel_idtelegram_channel": 0,
- "solicitudes": 0,
- "entradas_unicas": 0,
- "entradas_total": 0,
- "salidas_unicas": 0,
- "salidas_total": 0,
- "pagos_num": 0,
- "pagos_importe": "string",
- "welcome_boton": "string",
- "welcome_url": "string",
- "welcome_mensaje": "string",
- "ventas": [
- {
- "telegram_userid": "string",
- "telegram_username": "string",
- "fecha_solicitud": "2019-08-24T14:15:22Z",
- "fecha_entrada": "2019-08-24T14:15:22Z",
- "fecha_salida": "2019-08-24T14:15:22Z",
- "num_pagos": "string",
- "importe_pagos": "string"
}
]
}
]create public link for a channel
Create a public link for a channel. The request must include the channel_id parameter and optionally the duration_hours, requires_approval and auto_approval parameters. The request will return the public link created.
Authorizations:
header Parameters
| X-client-id required | string <= 50 characters |
Request Body schema: application/json
| channel_id required | integer Internal premiumpay channel ID |
| name required | string Name of the link |
| duration_hours | integer Duration in hours (0 unlimited) |
| requires_approval | string Enum: "yes" "no" Indicates if approval is required |
| auto_approval | string Enum: "yes" "no" Indicates if approval is automatic |
Responses
Request samples
- Payload
{- "channel_id": 0,
- "name": "string",
- "duration_hours": 0,
- "requires_approval": "yes",
- "auto_approval": "yes"
}Response samples
- 200
- 401
- 403
- 415
- 429
[- {
- "idtelegram_publicidad_acceso": 136,
- "nombre": "test manual",
- "duracion_horas": 0,
- "numero_usuarios": 0,
- "requiere_aprobacion": true,
- "aprobacion_automatica": false,
- "fecha_creacion": {
- "date": "2024-03-12 13:32:14.000000",
- "timezone_type": 3,
- "timezone": "UTC"
}, - "telegram_token": null,
- "telegram_idcanal": "-1002087167666",
- "telegram_namecanal": "bienvenida",
- "telegram_bot_idtelegram_bot": "Banner Bot",
- "login_business_id": 6112,
- "activo": true,
- "fecha_inicio": null,
- "telegram_channel_idtelegram_channel": 40
}
]personal welcome message
Create a personal welcome message for a channel. The request must include the channel_id and message parameters and optionally the invite_link, button, welcome_url and button_callback parameters.
Authorizations:
header Parameters
| X-client-id required | string <= 50 characters |
Request Body schema: application/json
| channel_id required | integer Internal premiumpay channel ID |
| message required | string Welcome message |
| invite_link | string Invitation link (optional) |
| button | string Text of the button (optional) |
| button_callback | string url of the button (optional) |
Responses
Request samples
- Payload
{- "channel_id": 0,
- "message": "string",
- "invite_link": "string",
- "button": "string",
- "button_callback": "string"
}Response samples
- 200
- 401
- 403
- 415
- 429
{- "status": "ko",
- "error": "No data"
}