latestOpenAPI 3.0.02026-08-10517386.6 KB

a9f1b102faca

Organizations

Transact with credits in inventory

This endpoint creates a transaction for credits in the organization's inventory

post/organizations/{id}/inventory/action/{action}

Path parameters

action'transfer' | 'retire' | 'transfer_retire' | 'cancel' | 'issuance' | 'receive' | 'claim' | 'create_project' | 'create_vintages' required

The action to perform on the token credit, one of transfer, retire, transfer_retire, cancel

idstring required

The ID of the organization

Headers

x-icr-api-versionstring

API version

Request body

creditIdstring required

The ID of the token credit

amountnumber required

The amount of the token credit

toOrganizationIdstring

The ID of the organization receiving the token credit - if not provided, toAddress must be provided

toAddressstring

The address of the organization receiving the token credit - if not provided, toOrganizationId must be provided

Example request

{
  "creditId": "exPost-2-0x1234567890abcdef",
  "amount": 100,
  "toOrganizationId": "123e4567-e89b-12d3-a456-426614174000",
  "toAddress": "0x1234567890abcdef",
  "retirementData": {
    "reason": "Retirement reason",
    "beneficiaryName": "John Doe",
    "comment": "This is a comment"
  }
}

Response

action'transfer' | 'retire' | 'transfer_retire' | 'cancel' | 'issuance' | 'receive' | 'claim' | 'create_project' | 'create_vintages' required

Action of the credit request

type'exAnte' | 'exPost' | 'retirementCertificate' required

Type of the credit request

idstring required

ID of the credit request

toAddressstring

Address of the recipient of the credit request

createdAtstring date-time required

Timestamp of when the credit request was created

updatedAtstring date-time required

Timestamp of when the credit request was last updated

tokenIdstring required

ID of the token associated with the credit request

tokenAddressstring required

Address of the token associated with the credit request

creditIdstring required

ID of the credit associated with the credit request

serializationstring required

Serialization of the credit request

vintagestring required

The vintage year of the credit

amountnumber required

Amount of the credit request

fromOrganizationIdstring required

ID of the organization sending the credit request

toOrganizationIdstring

ID of the organization receiving the credit request

txIdstring

ID of the transaction associated with the credit request

state'processed' | 'failed' | 'pending_queue' | 'pending_onchain' | 'pending_request' | 'rejected' | 'pending_reserved' | 'cancelled' required

State of the credit request: cancelled | failed | pending_onchain | pending_queue | pending_request | pending_reserved | processed | rejected

retirementIdstring

The retirement ID of the reservation

retirementReasonstring

Reason for retirement of the credit request

retirementCommentstring

Comment for retirement of the credit request

beneficiaryNamestring

Name of the beneficiary of the credit request

Example response

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "toAddress": "0x1234567890abcdef",
  "createdAt": "2022-01-01T00:00:00Z",
  "updatedAt": "2022-01-01T00:00:00Z",
  "tokenId": "123e4567-e89b-12d3-a456-426614174000",
  "tokenAddress": "0x1234567890abcdef",
  "creditId": "exPost-2-0x1234567890abcdef",
  "serialization": "serialization",
  "vintage": "2020",
  "amount": 1000,
  "fromOrganizationId": "123e4567-e89b-12d3-a456-426614174000",
  "toOrganizationId": "123e4567-e89b-12d3-a456-426614174000",
  "project": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "fullName": "Project 1",
    "url": "https://api.carbonregistry.com/projects/47abd663-fb35-4b2e-ad08-c347e761649e",
    "publicUrl": "https://carbonregistry.com/explore/projects/47abd663-fb35-4b2e-ad08-c347e761649e"
  },
  "txId": "0x1234567890abcdef",
  "retirementId": "1",
  "retirementReason": "reason",
  "retirementComment": "comment",
  "beneficiaryName": "John Doe"
}