Lune Accounts API

Get, create, update accounts.

Operations 7

GET /accounts/me Get an account #
POST /accounts Create an account pair #
GET /accounts List accounts #
PUT /accounts/{id} Update an account #
PATCH /accounts/{id} Partially update an account #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lune:lune-accounts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

lune-accounts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lune Accounts API
  version: '1.0'
  contact:
    name: Lune Support
    email: support@lune.co
  termsOfService: https://lune.co/terms
  description: 'Operations tagged Accounts across 2 of this provider''s published API definitions: openapi.yml, lune-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.lune.co/v1
  description: Lune's REST API
tags:
- name: Accounts
  description: Get, create, update accounts.
  x-lune-component: Account
paths:
  /accounts/me:
    get:
      summary: Get an account
      operationId: getAccount
      security:
      - BearerAuth: []
      tags:
      - Accounts
      responses:
        '200':
          description: OK
          x-lune-response-component: Account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '400':
          $ref: '#/components/responses/BadRequest'
    servers:
    - url: https://api.lune.co/v1
      description: Lune's REST API
  /accounts:
    post:
      summary: Create an account pair
      description: Create a pair of live and test accounts. The accounts are linked via the `sibling_id` property.
      operationId: createAccountPair
      security:
      - BearerAuth: []
      tags:
      - Accounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAccountRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountPair'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    get:
      summary: List accounts
      operationId: listAccounts
      security:
      - BearerAuth: []
      tags:
      - Accounts
      parameters:
      - $ref: '#/components/parameters/LimitPagination'
      - $ref: '#/components/parameters/AfterPagination'
      - name: name
        in: query
        description: 'Filter accounts based on name (case insensitive).

          The value can appear at the beggining, middle or end on the actual account name.'
        schema:
          type: string
          pattern: ^[a-zA-Z0-9_]{3,}$
          example: Merchant_X
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAccounts'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    servers:
    - url: https://api.lune.co/v1
      description: Lune's REST API
  /accounts/{id}:
    put:
      summary: Update an account
      description: Update an account. Live accounts will replicate a name change to its sibling account. Test accounts name updates are disallowed (name property must match the current account name).
      operationId: updateAccount
      security:
      - BearerAuth: []
      tags:
      - Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: The account's unique identifier
        schema:
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAccountRequest'
      responses:
        '200':
          description: OK
          x-lune-response-component: Account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    patch:
      summary: Partially update an account
      description: Partially update an account. Live accounts will replicate a name change to its sibling account. Test accounts name updates are disallowed (name property must match the current account name).
      operationId: partialUpdateAccount
      security:
      - BearerAuth: []
      tags:
      - Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: The account's unique identifier
        schema:
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartialUpdateAccountRequest'
      responses:
        '200':
          description: OK
          x-lune-response-component: Account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    servers:
    - url: https://api.lune.co/v1
      description: Lune's REST API
  /accounts/{id}/logo:
    post:
      summary: Update an account logo
      operationId: updateAccountLogo
      security:
      - BearerAuth: []
      tags:
      - Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: The account's unique identifier
        schema:
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadLogoRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadLogoResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    delete:
      summary: Delete an account logo
      operationId: deleteAccountLogo
      security:
      - BearerAuth: []
      tags:
      - Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: The account's unique identifier
        schema:
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadLogoResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    servers:
    - url: https://api.lune.co/v1
      description: Lune's REST API
components:
  schemas:
    CreateAccountRequest:
      type: object
      required:
      - name
      - currency
      properties:
        name:
          description: The account name.
          type: string
        currency:
          description: The account currency.
          $ref: '#/components/schemas/AccountCurrencyCode'
          example: GBP
        beneficiary:
          description: The account beneficiary. Leading and trailing spaces are removed.
          type: string
          minLength: 1
        handle:
          type: string
          pattern: ^[a-z0-9-_]+$
          description: '`handle` is a client defined URL-friendly string that identifies the account.


            The `handle` is unique per organisation and account type.

            '
        external_pages_visibility:
          $ref: '#/components/schemas/AccountExternalPagesVisibility'
      example:
        name: ACME
        currency: USD
    AccountCurrencyCode:
      type: string
      description: 'The account''s currency.


        ISO 4217 3 character currency code.


        Note: Lune does not support all currency codes.

        '
      enum:
      - GBP
      - EUR
      - USD
      - SEK
      - CHF
      - PLN
      - DKK
      - NOK
      - BGN
      - INR
      - SGD
      - AED
      - AUD
      - HUF
      - ISK
      - CZK
      - CAD
      example: GBP
    UpdateAccountRequest:
      description: 'It''s only possible to edit the name and beneficiary of an account.


        Not providing the `beneficiary` property will result in clearing the existing value (if present).

        '
      type: object
      required:
      - name
      properties:
        name:
          description: The account name.
          type: string
        beneficiary:
          description: The account beneficiary. Leading and trailing spaces are removed.
          type: string
          minLength: 1
        bundle_portfolio_id:
          description: The bundle portfolio unique identifier.
          type: string
          example: jvqkOq7vX2K18HHydar0W23ZGJdc91Pa
        handle:
          type: string
          pattern: ^[a-z0-9-_]+$
          description: '`handle` is a client defined URL-friendly string that identifies the account.


            The `handle` is unique per organisation and account type.

            '
        external_pages_visibility:
          $ref: '#/components/schemas/AccountExternalPagesVisibility'
      example:
        name: ACME
        beneficiary: ACME Inc
    AccountPair:
      type: object
      required:
      - live
      - test
      properties:
        live:
          $ref: '#/components/schemas/Account'
        test:
          $ref: '#/components/schemas/Account'
    Error:
      type: object
      description: Individual error information
      required:
      - error_code
      - message
      properties:
        error_code:
          type: string
          description: Immutable string representing a specific error.
          example: account_suspended
          enum:
          - api_version_invalid
          - account_suspended
          - bundle_selection_ratios_invalid
          - bundle_selection_bundle_invalid
          - order_idempotency_already_exists
          - order_quantity_invalid
          - order_value_invalid
          - bundle_id_invalid
          - id_invalid
          - distance_invalid
          - test_account_name_update_disallowed
          - validation_error
          - bundle_selection_ratios_invalid_format
          - address_not_found
          - port_not_found
          - locode_not_found
          - airport_invalid
          - webhook_limit_reached
          - time_range_invalid
          - exchange_rate_not_found
          - live_account_required
          - unauthorised
          - estimate_not_found
          - estimate_order_already_placed
          - sustainability_page_slug_not_unique
          - sustainability_page_exists
          - pagination_limit_invalid
          - unsupported_image_format
          - source_location_code_invalid
          - destination_location_code_invalid
          - emission_factor_id_invalid
          - emission_factor_unit_mismatch
          - emission_factor_gated
          - account_scope_incorrect
          - service_unavailable
          - handle_not_unique
          - estimate_idempotency_already_exists
          - airport_route_required
          - future_departure_invalid
          - transaction_document_inference_failure
          - transaction_document_creation_failure
          - invalid_selected_account_id
          - account_idempotency_already_exists
          - account_handle_idempotency_key_inconsistency
          - shipment_batch_idempotency_already_exists
          - route_not_found
          - insufficient_credits
          - client_account_mismatch
        message:
          type: string
          description: 'Human readable error message.


            This value can contain some extra information about the error in

            human-readable form. Not suitable for programmatic consumption, the format

            is not guaranteed to be stable.

            '
    AccountOrganisationType:
      type: string
      description: 'Indicates whether the account''s organisation acts as a shipper or supplier.


        Legacy accounts without a stored value are returned as `shipper`.

        '
      enum:
      - shipper
      - supplier
      example: shipper
    AccountIdempotencyKey:
      type: string
      maxLength: 100
      example: 550e8400-e29b-41d4-a716-446655440000
      description: 'A unique identifier provided by the client.


        `idempotency_key` is unique per account type.


        If an account with the same `idempotency_key` already exists, the API returns

        HTTP 409 Conflict with error code `account_idempotency_already_exists`.

        '
    AccountExternalPagesVisibility:
      description: 'Controls the visibility of external pages such as sustainability and analytics pages.


        `public` pages are visible to everyone.

        `private` pages are only visible through a verified JWT.

        `hidden` pages not visible.


        Defaults to `hidden`.

        '
      type: string
      enum:
      - public
      - hidden
      - private
    ErrorResponse:
      x-lune-name: Error response
      description: 'An error response containing the error details.


        The `error` property provides information about the type of error that occurred.

        Use this property for error handling.


        The `errors` array is present for backwards compatibility purposes. It always

        contains a single error element which is the same seen in the `error` property.

        '
      type: object
      required:
      - errors
      - error
      properties:
        errors:
          type: array
          description: An array containing errors
          items:
            $ref: '#/components/schemas/Error'
        error:
          $ref: '#/components/schemas/Error'
    PaginatedBase:
      type: object
      required:
      - has_more
      - next_cursor
      properties:
        has_more:
          type: boolean
          description: 'Whether or not there are more elements available after this set.


            If false, this set comprises the end of the array.


            Part of a paginated response.

            '
        next_cursor:
          description: 'The cursor value to be used as the after parameter for fetching the next page of results.


            `null` if `has_more` is `false`.

            '
          type:
          - string
          - 'null'
    Account:
      description: 'An Account represents the entity which performs API operations.


        Each API operation like creating an order or creating an emission estimate is ring-fenced within an Account.

        '
      allOf:
      - $ref: '#/components/schemas/AccountBase'
      type: object
      required:
      - scope
      - sibling_id
      properties:
        scope:
          type: string
          enum:
          - account
        sibling_id:
          type:
          - string
          - 'null'
          description: 'Account id of the paired account.


            A live account points to its sibling test account and vice versa.

            '
          example: gGdqQ0AyQJ72NauCCndfaQLNhc6Jfxc1
      example:
        id: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
        name: ACME
        beneficiary: ACME Inc
        currency: USD
        type: live
        organisation_id: VndoQ0PZjGMzvYOZGwqy6kbgN1eOJx9B
        logo: null
        bundle_portfolio_id: null
    PartialUpdateAccountRequest:
      description: 'Providing null on a property will result in clearing the existing value (if present).

        '
      type: object
      properties:
        name:
          description: The account name.
          type: string
        beneficiary:
          description: The account beneficiary. Leading and trailing spaces are removed.
          type:
          - string
          - 'null'
          minLength: 1
        bundle_portfolio_id:
          description: The bundle portfolio unique identifier.
          type:
          - string
          - 'null'
          example: jvqkOq7vX2K18HHydar0W23ZGJdc91Pa
        handle:
          type: string
          pattern: ^[a-z0-9-_]+$
          description: '`handle` is a client defined URL-friendly string that identifies the account.


            The `handle` is unique per organisation and account type.

            '
        external_pages_visibility:
          $ref: '#/components/schemas/AccountExternalPagesVisibility'
        idempotency_key:
          $ref: '#/components/schemas/AccountIdempotencyKey'
      example:
        name: ACME
        beneficiary: ACME Inc
    UploadLogoResponse:
      type: object
      properties:
        url:
          description: Uploaded account logo URL
          $ref: '#/components/schemas/Url'
    PaginatedAccounts:
      allOf:
      - $ref: '#/components/schemas/PaginatedBase'
      - type: object
        required:
        - data
        properties:
          data:
            type: array
            description: 'An array of Account objects


              Part of a paginated response.

              '
            items:
              $ref: '#/components/schemas/Account'
    AccountType:
      type: string
      description: 'The account''s type.

        '
      enum:
      - live
      - test
      example: live
    UploadLogoRequest:
      type: object
      required:
      - logo
      properties:
        logo:
          type: string
          format: binary
    AccountBase:
      type: object
      required:
      - id
      - name
      - organisation_id
      - organisation_type
      - handle
      - currency
      - type
      - logo
      - beneficiary
      - bundle_portfolio_id
      - external_pages_visibility
      properties:
        id:
          type: string
          example: ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz
          description: The Account's unique identifier
        name:
          type: string
          description: The Account's name
          example: Acme Corporation
        organisation_id:
          type: string
          description: The unique identifier of the organisation this account belongs to
          example: VndoQ0PZjGMzvYOZGwqy6kbgN1eOJx9B
        organisation_type:
          $ref: '#/components/schemas/AccountOrganisationType'
        handle:
          type:
          - string
          - 'null'
          pattern: ^[a-z0-9-_]+$
          description: '`handle` is a client defined URL-friendly string that identifies the account.


            The `handle` is unique per organisation and account type.

            '
        currency:
          $ref: '#/components/schemas/AccountCurrencyCode'
        type:
          $ref: '#/components/schemas/AccountType'
        logo:
          type:
          - string
          - 'null'
          description: The account logo
        beneficiary:
          type:
          - string
          - 'null'
          description: 'Retirement beneficiary


            This is the name that appears on future retirements that are made in this account.

            If none is present, the organisation beneficiary will be used instead.

            '
          minLength: 1
        bundle_portfolio_id:
          type:
          - string
          - 'null'
          description: Bundle portfolio id tied to the account.
          example: Jvhh30a6272NauKv92J7FG1c6Jfxd2E1
        external_pages_visibility:
          $ref: '#/components/schemas/AccountExternalPagesVisibility'
    Url:
      type: string
      format: https-url
      description: 'An HTTPS URL.


        The URL must match the following regular expression: `^https:\/\/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)$`

        '
      example: https://lune.co
  responses:
    NotFound:
      description: The specified resource was not found
    TooManyRequests:
      description: Too many requests have been made in a short period of time
    Forbidden:
      description: The API Key is not authorized to perform the operation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnsupportedMediaType:
      description: The payload format is in an unsupported format.
    Unauthorized:
      description: The API Key is missing or is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    BadRequest:
      description: The request is invalid. Parameters may be missing or are invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PayloadTooLarge:
      description: The request is larger than 100kB.
  parameters:
    LimitPagination:
      name: limit
      in: query
      required: false
      description: 'Maximum number of resources to return, between 1 and 100.

        '
      schema:
        type: string
        pattern: ^\d+$
        default: '10'
        example: '50'
    AfterPagination:
      name: after
      in: query
      required: false
      description: 'A cursor for use in pagination.


        The cursor that points to the starting item of the next page of results. If not provided, the first page of results is returned.

        '
      schema:
        type: string
        example: 0vE213P96LbXNap56NAqVoM7knOedQg4
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authorization Bearer API Key (see <a href="#section/Authentication">Authentication</a>)
    AccessToken:
      type: apiKey
      in: query
      name: access_token
      description: 'An API key used to access a resource that accepts it in the URL.


        Note: Lune API keys are not URL-safe, which means that they can''t be included in URLs directly.

        They need to be percent-encoded using a function like JavaScript''s [`encodeURIComponent()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) or

        Python''s [`urllib.parse.quote()`](https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote).

        '
x-refined-from:
- openapi.yml
- lune-openapi.yml