Tackle.io Currencies API

Microsoft marketplace currency and conversion helpers.

OpenAPI Specification

tackleio-currencies-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Tackle Public Contracts Authentication Currencies API
  description: "Customer-facing read API for cloud marketplace contracts that Tackle has\ningested for your Tackle account.\n\nThe response shape is a stable projection of the underlying\ncontract document. It is intended to be safe to consume long-term: fields\nwill be added over time, but documented fields will not be removed without\ndeprecation notice.\n\n## Authentication\n\nEvery request must include a valid Tackle JWT in the `Authorization`\nheader (`Authorization: Bearer <token>`). Machine-to-machine (MTM) tokens\nissued for your Tackle account are accepted. The token scopes every\nresponse to the account it represents.\n\n## Pagination\n\n`GET /api/contracts` is the only paginated endpoint. Pagination uses an\nopaque `cursor` query parameter:\n\n1. The first request omits `cursor`.\n2. If more pages exist, the response includes a `next` field. Pass that\n   value verbatim back as `cursor` on the next request.\n3. The last page omits `next`.\n\nCursors are opaque tokens. Do not parse, modify, or persist them across\nschema changes — request a fresh page from the start instead.\n"
  version: 1.0.0
servers:
- url: https://contracts.tackle.io
  description: Production
security:
- tackleJwt: []
tags:
- name: Currencies
  description: Microsoft marketplace currency and conversion helpers.
paths:
  /api/currencies:
    get:
      tags:
      - Currencies
      summary: Get Microsoft market currencies
      description: 'Returns accepted currencies and the Microsoft marketplace countries

        grouped by accepted currency.


        Required RBAC action: `offers:CreateDraftOffer`.

        '
      operationId: getMarketCurrencies
      security:
      - bearerAuth: []
      parameters:
      - $ref: '#/components/parameters/TackleOperationId'
      responses:
        '200':
          description: Market currencies found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketCurrenciesResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/currencies/convert:
    post:
      tags:
      - Currencies
      summary: Convert currencies
      description: 'Converts one or more amounts from a base currency to a target currency

        using cached Microsoft foreign exchange rates. Row-level conversion

        errors are returned in `results[].error` without failing the entire

        request.


        Required RBAC action: `offers:CreateDraftOffer`.

        '
      operationId: convertCurrencies
      security:
      - bearerAuth: []
      parameters:
      - $ref: '#/components/parameters/TackleOperationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CurrencyConversionRequest'
      responses:
        '200':
          description: Currency conversion results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrencyConversionResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CurrencyConversionError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    MarketCurrency:
      type: object
      properties:
        country_name:
          type: string
        iso2:
          type: string
          description: ISO 3166-1 alpha-2 country code.
          example: US
        currency:
          type: string
          description: ISO 4217 currency code.
          example: USD
        notes:
          type: string
        source:
          type: string
        source_revision:
          type: string
    CurrencyConversionResult:
      type: object
      properties:
        id:
          type: string
        base_currency:
          type: string
        target_currency:
          type: string
        original_amount:
          type: number
          format: double
        converted_amount:
          type: number
          format: double
        exchange_rate:
          type: number
          format: double
        rate_source_date:
          type: string
          format: date
        rate_as_of_date:
          type: string
          format: date
        error:
          oneOf:
          - $ref: '#/components/schemas/CurrencyConversionError'
          - type: 'null'
    CurrencyOption:
      type: object
      properties:
        value:
          type: string
          description: ISO 4217 currency code.
          example: USD
        display:
          type: string
          example: United States Dollar | USD ($)
    ErrorResponse:
      type: object
      required:
      - message
      properties:
        message:
          type: string
          description: Human-readable error message.
          example: missing id
    CurrencyConversionRequest:
      type: object
      required:
      - conversions
      properties:
        as_of_date:
          type: string
          format: date
          description: Requested FX rate date. Defaults to the current UTC date.
          example: '2026-04-30'
        conversions:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/CurrencyConversionPayload'
    MarketCurrenciesResponse:
      type: object
      properties:
        currency_options:
          type: array
          items:
            $ref: '#/components/schemas/CurrencyOption'
        currency_markets:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/MarketCurrency'
      example:
        currency_options:
        - value: USD
          display: United States Dollar | USD ($)
        currency_markets:
          USD:
          - country_name: United States
            iso2: US
            currency: USD
    CurrencyConversionPayload:
      type: object
      required:
      - id
      - base_currency
      - target_currency
      - amount
      properties:
        id:
          type: string
          description: Caller-provided row ID echoed in the response.
        base_currency:
          type: string
          example: USD
        target_currency:
          type: string
          example: EUR
        amount:
          type: number
          format: double
          example: 100
    CurrencyConversionResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/CurrencyConversionResult'
        success:
          type: boolean
          example: true
  responses:
    InternalServerError:
      description: Internal server error or upstream dependency failure.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ForbiddenError:
      description: Caller is not allowed to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: forbidden
    UnauthorizedError:
      description: Authentication failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: unauthorized
    BadRequestError:
      description: Invalid request or unsupported operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: missing id
  parameters:
    TackleOperationId:
      name: tackle-operation-id
      in: header
      required: false
      description: Optional caller-provided operation ID for request tracing.
      schema:
        type: string
      example: 018f01ec-3f2b-7a70-b81e-4fc3d6a69f42
  securitySchemes:
    tackleJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Tackle-issued JWT (interactive user or MTM token).