Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
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.
openapi: 3.2.0
info:
title: Lune Bundle portfolios API
version: '1.0'
contact:
name: Lune Support
email: support@lune.co
termsOfService: https://lune.co/terms
description: 'Operations tagged Bundle portfolios 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: Bundle portfolios
description: A bundle portfolio is a preconfigured bundle selection managed by Lune.
x-lune-component: BundlePortfolio
paths:
/bundle-portfolios:
get:
summary: List all bundle portfolios
operationId: listAllBundlePortfolios
security:
- BearerAuth: []
tags:
- Bundle portfolios
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/BundlePortfolio'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
put:
summary: Update an account's bundle portfolio
operationId: updateBundlePortfolio
security:
- BearerAuth: []
tags:
- Bundle portfolios
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SetBundlePortfolioRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/BundlePortfolio'
'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'
servers:
- url: https://api.lune.co/v1
description: Lune's REST API
components:
schemas:
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.
'
BundlePercentage:
type: object
description: Maps a bundle's unique identifier to an allocation ratio
required:
- bundle_id
- percentage
properties:
bundle_id:
type: string
example: BmWxrvXo29eGqzA1qjANL5PwnkgaO8R3
description: The bundle's unique identifier
percentage:
oneOf:
- type: integer
example: 43
description: Selection percentage
x-lune-name: Selection percentage as integer
- type: string
example: '43.21'
pattern: ^[0-9]+(\.\d{1,2})?$
description: Selection percentage in decimals
x-lune-name: Selection percentage in decimals
BundlePortfolio:
type: object
description: 'A curated group of predefined project bundles., e.g., Oxford Offsetting Principles.
Project bundles for a particular Bundle portfolio may change over time.
'
required:
- id
- identifier
- label
- bundle_selection
properties:
id:
type: string
description: Bundle portfolio unique identifier.
example: A7hPO9C01RnzPkYxJgAHxq112roXlWO5
identifier:
type: string
description: Identifier of the bundle portfolio.
example: oxford-offsetting-principles
label:
type: string
description: Human readable name of the bundle portfolio.
example: Oxford Offseting Principles
bundle_selection:
$ref: '#/components/schemas/BundleSelection'
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'
BundleSelection:
type: array
description: 'A Bundle Selection represents an account''s default project bundle ratios that are used when an order is placed without specifying project bundles.
An account initial project bundle selection is
* Conserving forests in Asia - 95%
* Ocean Carbon Removal - 5%
'
items:
$ref: '#/components/schemas/BundlePercentage'
example:
- bundle_id: BmWxrvXo29eGqzA1qjANL5PwnkgaO8R3
percentage: 34
- bundle_id: VndoQ0PZjGMzvYOZGwqy6kbgN1eOJx9B
percentage: 66
SetBundlePortfolioRequest:
type: object
required:
- bundle_portfolio_id
properties:
bundle_portfolio_id:
type: string
example: j85vWbLVZNlOayV94P8AM1K29RgJq4xX
responses:
BadRequest:
description: The request is invalid. Parameters may be missing or are invalid
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
TooManyRequests:
description: Too many requests have been made in a short period of time
Unauthorized:
description: The API Key is missing or is invalid
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
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.
PayloadTooLarge:
description: The request is larger than 100kB.
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