Patch Order Line Items API

Manage individual line items inside a multi-line carbon credit order.

Operations 3

POST /v1/orders/{order_id}/line_items Create An Order Line Item #
PATCH /v1/orders/{order_id}/line_items/{serial_number} Update An Order Line Item #
DELETE /v1/orders/{order_id}/line_items/{serial_number} Delete An Order Line Item #

Documentation

Specifications

Schemas & Data

Other Resources

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/patch-io-order-line-items-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

patch-io-order-line-items-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Patch Io Order Line Items API
  version: '2'
  x-refined-note:
  - x-api-id differs across the merged source definitions and was not carried
  description: 'Operations tagged Order Line Items across 2 of this provider''s published API definitions: patch-io-carbon-api-openapi.yml, patch-io-patch-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.patch.io
  description: Production API
tags:
- name: Order Line Items
  description: Manage individual line items inside a multi-line carbon credit order.
paths:
  /v1/orders/{order_id}/line_items:
    post:
      tags:
      - Order Line Items
      operationId: createOrderLineItem
      summary: Create An Order Line Item
      description: Adds a new line item to a draft order tying a specific project, vintage, and quantity to the order.
      parameters:
      - name: order_id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderLineItemRequest'
      responses:
        '200':
          description: Order line item response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderLineItemResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.patch.io
      description: Production API
  /v1/orders/{order_id}/line_items/{serial_number}:
    patch:
      tags:
      - Order Line Items
      operationId: updateOrderLineItem
      summary: Update An Order Line Item
      description: Updates an existing line item on a draft order.
      parameters:
      - name: order_id
        in: path
        required: true
        schema:
          type: string
      - name: serial_number
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrderLineItemRequest'
      responses:
        '200':
          description: Order line item response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderLineItemResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - bearerAuth: []
    delete:
      tags:
      - Order Line Items
      operationId: deleteOrderLineItem
      summary: Delete An Order Line Item
      description: Removes a line item from a draft order.
      parameters:
      - name: order_id
        in: path
        required: true
        schema:
          type: string
      - name: serial_number
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Order line item response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderLineItemResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.patch.io
      description: Production API
components:
  schemas:
    Meta:
      type: object
      description: Pagination and response metadata block returned on list endpoints.
      properties:
        prev_page:
          type:
          - integer
          - 'null'
        next_page:
          type:
          - integer
          - 'null'
    OrderLineItemResponse:
      type: object
      properties:
        success:
          type: boolean
        error: {}
        data:
          $ref: '#/components/schemas/OrderLineItem'
        meta:
          $ref: '#/components/schemas/Meta'
    OrderLineItem:
      type: object
      properties:
        id:
          type: string
        project:
          $ref: '#/components/schemas/OrderLineItemProject'
        vintage_year:
          type:
          - integer
          - 'null'
        vintage_start_year:
          type:
          - integer
          - 'null'
        vintage_end_year:
          type:
          - integer
          - 'null'
        amount:
          type: integer
          description: Mass in grams.
        unit:
          type: string
          example: g
        price:
          type: integer
        currency:
          type: string
          example: USD
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
        data: {}
        meta:
          type: object
          properties:
            patch_version:
              type: integer
    OrderLineItemProject:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
    CreateOrderLineItemRequest:
      type: object
      required:
      - project_id
      properties:
        project_id:
          type: string
        vintage_year:
          type: integer
        vintage_start_year:
          type: integer
        vintage_end_year:
          type: integer
        price:
          type: integer
        currency:
          type: string
          example: USD
        amount:
          type: integer
        unit:
          type: string
          example: g
    UpdateOrderLineItemRequest:
      type: object
      properties:
        vintage_year:
          type: integer
        vintage_start_year:
          type: integer
        vintage_end_year:
          type: integer
        price:
          type: integer
        currency:
          type: string
          example: USD
        amount:
          type: integer
        unit:
          type: string
          example: g
    OrderLineItemResponse_2:
      type: object
      description: API response wrapping an OrderLineItem
      properties:
        success:
          type: boolean
          description: Whether the request was successful
        error:
          type:
          - string
          - 'null'
          description: Error message if the request failed
        data:
          $ref: '#/components/schemas/OrderLineItem_2'
    OrderLineItem_2:
      type: object
      description: An individual line item within an order
      properties:
        id:
          type: string
          description: Unique identifier for the line item
        project:
          $ref: '#/components/schemas/OrderLineItemProject_2'
        vintage_year:
          type: integer
          description: Specific vintage year for the carbon credits
        vintage_start_year:
          type: integer
          description: Start year of the vintage range
        vintage_end_year:
          type: integer
          description: End year of the vintage range
        amount:
          type: integer
          description: Amount of carbon offset in grams of CO2 equivalent
        unit:
          type: string
          description: Unit of measurement
        price:
          type: integer
          description: Price in the smallest currency unit
        currency:
          type: string
          description: ISO 4217 currency code
    ErrorResponse_2:
      type: object
      description: API error response
      properties:
        success:
          type: boolean
          example: false
          description: Always false for error responses
        error:
          type: string
          description: Error message describing what went wrong
    OrderLineItemProject_2:
      type: object
      description: Project reference within an order line item
      properties:
        id:
          type: string
          description: Project identifier
        name:
          type: string
          description: Project name
    DeleteOrderLineItemResponse:
      type: object
      description: API response confirming order line item deletion
      properties:
        success:
          type: boolean
          description: Whether the deletion was successful
        error:
          type:
          - string
          - 'null'
          description: Error message if the deletion failed
        data:
          type: object
          properties:
            id:
              type: string
              description: ID of the deleted line item
    CreateOrderLineItemRequest_2:
      type: object
      description: Request body for creating an order line item
      required:
      - project_id
      properties:
        project_id:
          type: string
          description: ID of the carbon project for this line item
        vintage_year:
          type: integer
          description: Specific vintage year for the carbon credits
        vintage_start_year:
          type: integer
          description: Start year of the vintage range
        vintage_end_year:
          type: integer
          description: End year of the vintage range
        price:
          type: integer
          description: Price in the smallest currency unit
        currency:
          type: string
          description: ISO 4217 currency code
        amount:
          type: integer
          description: Amount of carbon offset in grams of CO2 equivalent
        unit:
          type: string
          description: Unit of measurement
    UpdateOrderLineItemRequest_2:
      type: object
      description: Request body for updating an order line item
      properties:
        vintage_year:
          type: integer
          description: Specific vintage year for the carbon credits
        vintage_start_year:
          type: integer
          description: Start year of the vintage range
        vintage_end_year:
          type: integer
          description: End year of the vintage range
        price:
          type: integer
          description: Price in the smallest currency unit
        currency:
          type: string
          description: ISO 4217 currency code
        amount:
          type: integer
          description: Amount of carbon offset in grams of CO2 equivalent
        unit:
          type: string
          description: Unit of measurement
  responses:
    BadRequest:
      description: Request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: API key missing, malformed, or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key bearer token issued from the Patch dashboard. Sandbox and live keys are separated.
    bearer_auth:
      type: http
      scheme: bearer
      description: 'Bearer token API key obtained from the Patch dashboard. Use test keys for sandbox and production keys for live orders.

        '
x-refined-from:
- patch-io-carbon-api-openapi.yml
- patch-io-patch-api-openapi.yml