API

Get an official currency

GET /currencies/{currency_id} — Get an official currency

Operation

GET /currencies/{currency_id}

Behavior

Returns one official currency by its numeric id.

A 404 means no official currency has this id: the id does not exist, was deleted, or is not an official currency.

Usage

{
  "authentication": "public",
  "credit_cost": 0,
  "premium": false,
  "recommended_interval_seconds": 300,
  "rate_limit": null,
  "unit_pricing": null
}

Request

{
  "parameters": [
    {
      "name": "currency_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "integer",
        "description": "Numeric id of the currency (the `id` field).",
        "title": "Currency Id"
      },
      "description": "Numeric id of the currency (the `id` field)."
    }
  ]
}

Responses

{
  "200": {
    "description": "Successful Response",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Envelope_CurrencyOut_"
        }
      }
    }
  },
  "404": {
    "description": "The requested resource does not exist",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  },
  "422": {
    "description": "A parameter or the request body is invalid",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  },
  "503": {
    "description": "The service is temporarily unavailable; retry later",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  }
}

Models

{
  "CreditMeta": {
    "properties": {
      "cost": {
        "type": "integer",
        "title": "Cost",
        "description": "Credits this request costs."
      },
      "remaining": {
        "type": "integer",
        "title": "Remaining",
        "description": "Estimated credit balance left after this request. A hint rather than a ledger: concurrent requests can make it slightly off."
      }
    },
    "type": "object",
    "required": [
      "cost",
      "remaining"
    ],
    "title": "CreditMeta",
    "description": "Credit accounting for a billable request."
  },
  "CurrencyOut": {
    "properties": {
      "id": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ],
        "title": "Id",
        "description": "Unique ID of the currency."
      },
      "code": {
        "type": "string",
        "title": "Code",
        "description": "Currency code, e.g. `USD`."
      },
      "name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Name",
        "description": "Display name."
      },
      "kind": {
        "type": "string",
        "title": "Kind",
        "description": "Currency kind, e.g. `fiat`."
      },
      "usd_rate": {
        "type": "string",
        "title": "Usd Rate",
        "description": "Value of one unit of this currency in US dollars, as a decimal string. Used by `auto` conversions."
      },
      "owner_user_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Owner User Id",
        "description": "ID of the owning user; `null` for platform currencies, which include every official currency."
      },
      "is_official": {
        "type": "boolean",
        "title": "Is Official",
        "description": "Whether the currency belongs to the official catalog maintained by the platform."
      },
      "ref_count": {
        "type": "integer",
        "title": "Ref Count",
        "description": "Number of convert operators that use this currency."
      },
      "is_deleted": {
        "type": "boolean",
        "title": "Is Deleted",
        "description": "Whether the currency is deleted. Deleted currencies are never listed, so this is `true` only in a delete response."
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "id",
      "code",
      "name",
      "kind",
      "usd_rate",
      "owner_user_id",
      "is_official",
      "ref_count",
      "is_deleted"
    ],
    "title": "CurrencyOut",
    "description": "A currency and its US dollar value."
  },
  "Envelope_CurrencyOut_": {
    "properties": {
      "data": {
        "$ref": "#/components/schemas/CurrencyOut",
        "description": "The endpoint payload."
      },
      "meta": {
        "$ref": "#/components/schemas/Meta",
        "description": "Request metadata."
      }
    },
    "type": "object",
    "required": [
      "data",
      "meta"
    ],
    "title": "Envelope[CurrencyOut]"
  },
  "ErrorBody": {
    "properties": {
      "code": {
        "type": "string",
        "title": "Code",
        "description": "Stable machine-readable error code. Branch on this value, not on `message`."
      },
      "message": {
        "type": "string",
        "title": "Message",
        "description": "Human-readable explanation. The wording may change."
      },
      "details": {
        "anyOf": [
          {
            "additionalProperties": true,
            "type": "object"
          },
          {
            "type": "null"
          }
        ],
        "title": "Details",
        "description": "Optional structured context, such as the list of validation errors or, for `credit_insufficient`, the required and remaining credits."
      }
    },
    "type": "object",
    "required": [
      "code",
      "message"
    ],
    "title": "ErrorBody",
    "description": "Details of a failed request."
  },
  "ErrorEnvelope": {
    "properties": {
      "error": {
        "$ref": "#/components/schemas/ErrorBody",
        "description": "What went wrong."
      },
      "meta": {
        "$ref": "#/components/schemas/Meta",
        "description": "Request metadata."
      }
    },
    "type": "object",
    "required": [
      "error",
      "meta"
    ],
    "title": "ErrorEnvelope",
    "description": "Error response: the error in `error` plus request metadata in `meta`."
  },
  "Meta": {
    "properties": {
      "request_id": {
        "type": "string",
        "title": "Request Id",
        "description": "Unique identifier of this request, identical to the `X-Request-ID` response header. Quote it when contacting support."
      },
      "billable": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "null"
          }
        ],
        "title": "Billable",
        "description": "Whether the request is billed in credits. Present only on metered endpoints; `false` means the request is free, for example because it costs nothing or your subscription covers it."
      },
      "credit": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/CreditMeta"
          },
          {
            "type": "null"
          }
        ],
        "description": "Cost of the request and your estimated remaining balance. Present only when `billable` is `true`."
      }
    },
    "type": "object",
    "required": [
      "request_id"
    ],
    "title": "Meta",
    "description": "Request metadata included in every enveloped response."
  }
}

Download the public OpenAPI schema