How to create a signature (md-5)

Let's review an example of creating a signature for a request to the Aviasales Flight Search API. For example, we have a set of parameters that we want to pass to the API to get data on airline tickets:

{
    "signature": "YourSignature",
    "currency_code": "USD",
    "marker": "YourMarker",
    "market_code": "US",
    "locale": "US",
    "search_params": {
        "directions": [
            {
                "origin": "LAX",
                "destination": "NYC",
                "date": "2026-09-09"
            },
            {
                "origin": "NYC",
                "destination": "LAX",
                "date": "2026-09-25"
            }
        ],
        "trip_class": "Y",
        "passengers": {
            "adults": 1,
            "children": 0,
            "infants": 0
        }
    }
}
  1. First, you need to rearrange the parameters (and their values) so that they are in alphabetical order.

    Note that the nesting of data is taken into account during sorting. This means that if an element contains an array (for example, segments) or a list of parameters (for example, passengers), the contents of this element are sorted separately and put in its place in the general list. The contents are not sorted with the top-level parameters. Parameters within an array are sorted in the order of curly braces { }.
  2. As a result, you will get:
{
    "currency_code": "USD",
    "locale": "US",
    "marker": "YourMarker",
    "market_code": "US",
    "search_params": {
        "directions": [
            {
                "date": "2026-09-09",
                "destination": "NYC",
                "origin": "LAX"
            },
            {
                "date": "2026-09-25",
                "destination": "LAX",
                "origin": "NYC"
            }
        ],
        "passengers": {
            "adults": 1,
            "children": 0,
            "infants": 0
        },
        "trip_class": "Y"
    }
}
  1. Assemble a string containing only the values ​​of the parameters separated by a colon (ranking is the same as in step 1). For example:
USD:US:YourMarker:US:2026-09-09:NYC:LAX:2026-09-25:LAX:NYC:1:0:0:Y

You can find your marker (partner ID) at the bottom left corner of your Travelpayouts account:

  1. Add your API token to the beginning of this string. You can find the API token in your Profile in the API token section.
YourToken:USD:US:YourMarker:US:2026-09-09:NYC:LAX:2026-09-25:LAX:NYC:1:0:0:Y
  1. Use the resulting string to calculate the md-5 signature. The result is the signature of our request.
    Important! Signature is case-sensitive.