getAStore method

Future<Map> getAStore(
  1. String storeID
)

Retrieve a store

Retrieves the store with the given ID.

Implementation

Future<Map> getAStore(String storeID) async {
  if (apiKey.isEmpty) {
    return {'error': 'API key is empty'};
  }
  Options dioOptions = Options(headers: {
    "Authorization ": "Bearer $apiKey",
    "Accept": "application/vnd.api+json",
    "Content-Type": "application/vnd.api+json"
  });

  try {
    Response response = await dio.get(
      "https://api.lemonsqueezy.com/v1/stores/$storeID",
      options: dioOptions,
    );

    return response.data;
  } catch (e) {
    return {'error': e.toString()};
  }
}