پرش به مطلب اصلی

Geolocations API

POST /geolocations

Description

This API endpoint retrieves a list of geolocations, including details such as the name, code, and geographic discount associated with each location.

Request Body

The request uses GraphQL to perform the geolocations query, which does not require any variables.

Query:

query geolocations {
geolocations {
id
name
code
threeCharCode
geoDiscount
}
}

GraphQL Variables:

{}

Example Request:

curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query geolocations {\n geolocations {\n id\n name\n code\n threeCharCode\n geoDiscount\n }\n}","variables":{}}'

Response:

  • Success (200 OK):

    • The response includes details about the geolocations.
    {
    "data": {
    "geolocations": [
    {
    "id": 1,
    "name": "New York",
    "code": "NY",
    "threeCharCode": "NYC",
    "geoDiscount": 5
    },
    {
    "id": 2,
    "name": "Los Angeles",
    "code": "LA",
    "threeCharCode": "LAX",
    "geoDiscount": 10
    }
    ]
    }
    }
    • id: Unique identifier for the geolocation.
    • name: Name of the location.
    • code: Two-letter code for the location.
    • threeCharCode: Three-letter code for the location.
    • geoDiscount: Discount percentage associated with the location.
  • Error (4XX/5XX):

    • If there is an issue with the request or server error, the response will include an error message and status code.

Note:

This endpoint provides useful information for managing and applying geographic discounts based on the location. The geoDiscount field indicates any discounts that might be available for the specific geolocation.