Greenly purchaseCategories API

The purchaseCategories API from Greenly — 2 operation(s) for purchasecategories.

OpenAPI Specification

greenly-earth-purchasecategories-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Greenly Carbon Analytics alternatives purchaseCategories API
  version: '1.5'
  description: "# Introduction\nThe Greenly Carbon Analytics API is a set of RESTful services which enable the enrichment of bank transactions with carbon footprint analytics.\n\n All request and response payloads, including errors, use the JSON naming convention.\n\n2 API environments are available: a sandbox environment used to test the API capacities and your integration with these services and the production environment.\n\nTo have access to these environments, you will need to obtain API keys by contacting us at contact@greenly.earth.\n\nThe 2 environments are available at the following URL:\n - Sandbox environment: <https://apisandbox.greenly.earth/v1.5>\n - Production environment: <https://api.greenly.earth/v1.5>\n# Getting Started\nYou can download our sample Postman requests at the following URL: <http://offspend.github.io/PostmanRequests.zip>\n\nYou then need to add your API key in the Greenly Sandbox API environment. After that, you should be able to create a user. Executing this Postman request will automatically set the latest created userId as a global env in your Postman environment. So after creating this user, you can directly try all the other requests including the Calculate Carbon Footprints one which will show you the carbon footprint analysis for a lot of different transactions.\n# Input Transaction Labels\nThe algorithm classifies transactions to providers and purchase categories so as to measure their carbon footprint based on their labels. In the best case, this label would consist only of the name of the recipient of the payment. Yet, in general, raw label contain overhead information, related in particular to the type of payment and the date of the transaction.\n\nIn the case where a cleaning of the overhead is done on the bank side, only the cleaned label should be transmitted to the API. If no cleaning is done or the cleaning is deemed to be too noisy or unreliable, raw labels can be also transmitted to the API. \n\nIndeed, when a label is received, the classification algorithm looks for all common overhead patterns, such as  “CB XXXXX”, “paiement par carte”, or “01/06/2020”, among many other overhead patterns.The classification algorithm removes all such patterns used by all banks that it was possible to enumerate during the R&D process. Yet, it is always possible that some patterns could not be found, or that the format evolves at some time. In that case, the cleaning of the pattern should either be done at the user side, or the user should contact the Greenly support team to ensure proper cleaning of the raw label and hence proper classification and estimation of the carbon footprint.\n\nAs a toy example, let us consider the following raw label to illustrate the allowed format: “paiement par carte super u 35 st jacques de 05/07”. Providing the “cleaned label” would be “super u 35 st jacques de“ or variations thereof, and as it can be observed the cleaned label does not need to be perfectly informative nor cleaned. As mentioned above, it is also possible to simply provide the raw label and the API will take care of removing the date and the overhead linked to card payment. Yet, it is not desired to provide both cleaned and raw labels using a separator (e.g. a new line ‘\n’ separator or other variations) as this would lead to degraded performances.\n\n# Authentication\n\n<!-- ReDoc-Inject: <security-definitions> -->"
  contact:
    email: contact@greenly.earth
servers:
- url: https://api.greenly.earth/v1.5
tags:
- name: purchaseCategories
paths:
  /purchaseCategories:
    get:
      operationId: GetPurchaseCategories
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PurchaseCategoryOutput'
                type: array
        '401':
          description: Authentication Failed
        '500':
          description: An unexpected error occurred while processing the request
      description: Retrieve the details of all purchase categories.
      summary: Get all purchase categories
      tags:
      - purchaseCategories
      security: []
      parameters:
      - in: query
        name: countryId
        required: false
        schema:
          type: string
  /purchaseCategories/{purchaseCategoryId}:
    get:
      operationId: GetPurchaseCategory
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/PurchaseCategoryOutput'
                - {}
        '401':
          description: Authentication Failed
        '404':
          description: Resource not found
        '500':
          description: An unexpected error occurred while processing the request
      description: Retrieve the details of one purchase category.
      summary: Get purchase category
      tags:
      - purchaseCategories
      security: []
      parameters:
      - in: path
        name: purchaseCategoryId
        required: true
        schema:
          type: string
      - in: query
        name: countryId
        required: false
        schema:
          type: string
components:
  schemas:
    Translations:
      $ref: '#/components/schemas/Record_Language.string_'
    EnumValueTranslated:
      properties:
        translations:
          $ref: '#/components/schemas/Translations'
          description: Translations of the enum value
        id:
          type: string
          description: Id of the enum value
      required:
      - translations
      - id
      type: object
    PurchaseCategoryNameTranslations:
      $ref: '#/components/schemas/Translations'
      description: Name of the purchase category in multilingual format
    TagType:
      enum:
      - boolean
      - number
      - enum
      type: string
    PurchaseCategoryOutput:
      properties:
        possibleTags:
          items:
            $ref: '#/components/schemas/Tag'
          type: array
          description: 'Possible tags that can be applied to transactions in this purchase category.

            In case of enum, the list of potential values is available.'
        translations:
          $ref: '#/components/schemas/PurchaseCategoryNameTranslations'
        parentPurchaseCategory:
          $ref: '#/components/schemas/ParentPurchaseCategoryId'
          description: Parent purchase category which defines the larger type of the purchase (food, housing, transport, etc)
        methodology:
          $ref: '#/components/schemas/PurchaseCategoryMethodologyTranslations'
        id:
          type: string
          description: Unique identifier of the purchase category
      required:
      - possibleTags
      - translations
      - parentPurchaseCategory
      - methodology
      - id
      type: object
    Tag:
      properties:
        translations:
          $ref: '#/components/schemas/Translations'
          description: Translations of the tag description
        enumValues:
          items:
            $ref: '#/components/schemas/EnumValueTranslated'
          type: array
          description: Possible values for the tag in case of enum
        type:
          $ref: '#/components/schemas/TagType'
          description: Type of the tag
        id:
          type: string
          description: Id of the tag
      required:
      - translations
      - type
      - id
      type: object
    PurchaseCategoryMethodologyTranslations:
      $ref: '#/components/schemas/Translations'
      description: 'Methodology used to calculate the carbon footprint of transactions belonging to this purchase category.

        In case of tags applied to the transaction, a methodology is also available within the tag definition.'
    Record_Language.string_:
      properties:
        en:
          type: string
        fr:
          type: string
        es:
          type: string
        it:
          type: string
        sv:
          type: string
        de:
          type: string
      type: object
      description: Construct a type with a set of properties K of type T
    ParentPurchaseCategoryId:
      enum:
      - Transport
      - Food
      - Shopping
      - Services
      - Housing
      - Uncategorized
      type: string
  securitySchemes:
    api_key:
      type: apiKey
      name: api-key
      in: header