Saltar al contenido principal

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.

version

Version of the API

api version

Return the current version of the API

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "version": "1.0.0"
}

server

Server status

status of api server

Return the status of the server and the rate limit of the user

Authorizations:
jwt
header Parameters
X-client-id
required
string <= 50 characters

Responses

Response samples

Content type
application/json
{
  • "status": "ko",
  • "ratelimit": {
    }
}

data

Data endpoints

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:
jwt
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

Content type
application/json
{
  • "start_date_time": "2019-08-24T14:15:22Z",
  • "end_date_time": "2019-08-24T14:15:22Z",
  • "pasarela_id": 0,
  • "service_id": 0
}

Response samples

Content type
application/json
[
  • { }
]

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:
jwt
header Parameters
X-client-id
required
string <= 50 characters
Request Body schema: application/json
include_services
string
Enum: "yes" "no"

Responses

Request samples

Content type
application/json
{
  • "include_services": "yes"
}

Response samples

Content type
application/json
[
  • {
    }
]

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:
jwt
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

Content type
application/json
{
  • "start_date_time": "2019-08-24T14:15:22Z",
  • "end_date_time": "2019-08-24T14:15:22Z",
  • "aggregate_field": "country"
}

Response samples

Content type
application/json
[
  • {
    }
]

bots

Bots endpoints

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:
jwt
header Parameters
X-client-id
required
string <= 50 characters
Request Body schema: application/json
optional
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

Content type
application/json
{
  • "include_links": "yes",
  • "link_names": [
    ],
  • "exclude_link_names": "yes",
  • "channel_fields": [
    ],
  • "link_fields": [
    ],
  • "consolidate_links": "yes"
}

Response samples

Content type
application/json
[
  • {
    }
]

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:
jwt
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

Content type
application/json
{
  • "start_date_time": "2019-08-24T14:15:22Z",
  • "end_date_time": "2019-08-24T14:15:22Z",
  • "channel_id": 0,
  • "invitation_link": "string"
}

Response samples

Content type
application/json
[
  • {
    }
]

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:
jwt
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

Content type
application/json
{
  • "start_date_time": "2019-08-24T14:15:22Z",
  • "end_date_time": "2019-08-24T14:15:22Z",
  • "channel_id": 0,
  • "invitation_link": "string"
}

Response samples

Content type
application/json
[
  • {
    }
]

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:
jwt
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

Content type
application/json
{
  • "channel_id": 0,
  • "name": "string",
  • "duration_hours": 0,
  • "requires_approval": "yes",
  • "auto_approval": "yes"
}

Response samples

Content type
application/json
[
  • {
    }
]

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:
jwt
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

Content type
application/json
{
  • "channel_id": 0,
  • "message": "string",
  • "invite_link": "string",
  • "button": "string",
  • "button_callback": "string"
}

Response samples

Content type
application/json
{
  • "status": "ko",
  • "error": "No data"
}