Skip to content

Postman collection

The Postman collection has all requests of this guide. A script in the collection signs each request. Use it to try the requests with your test credentials.

Download the collection

Import the collection

  1. In Postman, select Import and select the file megogo-terminals.postman_collection.json.
  2. Make an environment, for example "MEGOGO test".
  3. Add the variables of the table below to the environment.
  4. Select the environment.
Variable Value
partner_id Your test partner ID
public_key Your public key
private_key Your private key. Type: secret
phone The phone number of your test SIM card: digits only, international format, without +
service_id The service ID of a test subscription

WARNING

Do not put the private key in the collection. Do not share or export an environment that contains it.

CAUTION

Write the phone number without +. Postman does not encode + in the URL, and the server reads it as a space: the request gets HTTP 401.

Send the requests

Send the requests from a computer with an IP address of your list. See Credentials.

  1. Send Your services. Expected result: a list that contains your service_id.
  2. Send Check the phone number. The Postman console shows if the number is registered.
  3. Send Subscribe. Expected result: "successful": true.
  4. Send User services. The list contains your service with the end date.
  5. Send Unsubscribe. Send User services again: the result is [].

Each request has a test that checks the result.

WARNING

Subscribe and User services create a MEGOGO user if the phone number is not registered. Use only the number of your test SIM card.

Suspend and Resume are also in the collection. Send Resume only after Suspend. See Renew, suspend and stop a subscription.

Variables

Variable Default Description
terminals_api https://billing.megogo.net Base URL of the API

How the script signs a request

Before each request, the script:

  1. Removes sign from the URL.
  2. Writes the private key, GET and the path, with the variables replaced by their values.
  3. Adds all enabled query parameters, sorted by name, as name=value.
  4. Calculates the SHA-256 hash, encodes the hexadecimal text with Base64, removes =, replaces / and + with -, and adds _ and the public key.
  5. Adds sign to the URL.

If you add a parameter to a request, the script includes it in the signature. See Sign a request.


Guide version 1.3.0, 2026-11-02 · Report a problem on this page