Skip to content

Instantly share code, notes, and snippets.

@Ellisande
Last active June 25, 2025 18:01
Show Gist options
  • Save Ellisande/e016b140d6f0e2cb62548458a6a5502d to your computer and use it in GitHub Desktop.
Save Ellisande/e016b140d6f0e2cb62548458a6a5502d to your computer and use it in GitHub Desktop.
Open API Schema
This file has been truncated, but you can view the full file.
{
"openapi": "3.1.0",
"info": {
"title": "String Theory API",
"version": "Evergreen"
},
"paths": {
"/v2/deposit": {
"post": {
"tags": [
"Current"
],
"summary": "Adds positive value to an entity in the ledger",
"operationId": "deposit",
"requestBody": {
"description": "Add deposit",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"deposits": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": {
"currency_micros": "currency_micros",
"loyalty_points": "loyalty_points"
}
},
"unitToken": {
"type": "string",
"minLength": 1
},
"unitCount": {
"type": "integer",
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
},
"required": [
"amount"
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"commonTags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"commonGroups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"deposits",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots deposited into the ledger",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"knots",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/deposit/cancel": {
"post": {
"tags": [
"Current"
],
"summary": "Cancels pending deposits stopping the value from being added to the ledger",
"operationId": "cancel deposit",
"requestBody": {
"description": "Cancel deposit",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"sources",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Canceled deposits that were pending",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"knots",
"idempotentResponse"
]
}
}
}
},
"404": {
"description": "Thrown when the provided resources can't be found to continue the operation",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
404
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"NotFoundError"
]
},
"data": {
"type": "object",
"properties": {
"missingIds": {
"type": "array",
"items": {
"type": "string"
}
},
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"missingGroups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"missingHolds": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
]
}
}
},
"required": []
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
},
"500": {
"description": "Thrown when the requested knots are in a state incompatible with the operation",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
500
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"InvalidStateError"
]
},
"data": {
"type": "object",
"properties": {
"invalidKnotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
}
},
"required": [
"invalidKnotIds"
]
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v2/deposit/confirm": {
"post": {
"tags": [
"Current"
],
"summary": "Confirms pending deposits creating available value in the ledger",
"operationId": "confirm deposit",
"requestBody": {
"description": "Confirm deposit",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"sources",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Confirmed deposits that were pending",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"knots",
"idempotentResponse"
]
}
}
}
},
"404": {
"description": "Thrown when the provided resources can't be found to continue the operation",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
404
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"NotFoundError"
]
},
"data": {
"type": "object",
"properties": {
"missingIds": {
"type": "array",
"items": {
"type": "string"
}
},
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"missingGroups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"missingHolds": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
]
}
}
},
"required": []
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
},
"500": {
"description": "Thrown when the requested knots are in a state incompatible with the operation",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
500
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"InvalidStateError"
]
},
"data": {
"type": "object",
"properties": {
"invalidKnotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
}
},
"required": [
"invalidKnotIds"
]
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v2/deposit/debt": {
"post": {
"tags": [
"Current"
],
"summary": "Adds negative value to an entity in the ledger",
"operationId": "deposit debt",
"requestBody": {
"description": "Add debt deposit",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"deposits": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": {
"currency_micros": "currency_micros",
"loyalty_points": "loyalty_points"
}
},
"unitToken": {
"type": "string",
"minLength": 1
},
"unitCount": {
"type": "integer",
"pattern": "^-[0-9]\\d*$"
}
}
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
},
"required": [
"amount"
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"commonTags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"commonGroups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"deposits",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots deposited into the ledger",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"knots",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/deposit/pending": {
"post": {
"tags": [
"Current"
],
"summary": "Adds pending positive value to an entity in the ledger",
"operationId": "pending deposit",
"requestBody": {
"description": "Add pending deposit",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"deposits": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": {
"currency_micros": "currency_micros",
"loyalty_points": "loyalty_points"
}
},
"unitToken": {
"type": "string",
"minLength": 1
},
"unitCount": {
"type": "integer",
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
},
"required": [
"amount"
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"commonTags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"commonGroups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"deposits",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Pending deposits added into the ledger",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"knots",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/deposit/restore": {
"post": {
"tags": [
"Current"
],
"summary": "Restores cancelled deposits back to pending",
"operationId": "restore cancelled deposit",
"requestBody": {
"description": "Restore cancelled deposit",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"sources",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots restored back to pending deposit",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"knots",
"idempotentResponse"
]
}
}
}
},
"404": {
"description": "Thrown when the provided resources can't be found to continue the operation",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
404
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"NotFoundError"
]
},
"data": {
"type": "object",
"properties": {
"missingIds": {
"type": "array",
"items": {
"type": "string"
}
},
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"missingGroups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"missingHolds": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
]
}
}
},
"required": []
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
},
"500": {
"description": "Thrown when the requested knots are in a state incompatible with the operation",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
500
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"InvalidStateError"
]
},
"data": {
"type": "object",
"properties": {
"invalidKnotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
}
},
"required": [
"invalidKnotIds"
]
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v1/exchange": {
"post": {
"tags": [
"Beta"
],
"summary": "Exchange knots for a different asset class",
"operationId": "exchange knots",
"requestBody": {
"description": "Money to exchange, asset class to exchange to, and exchange rate to use",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"from": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"oneOf": [
{
"type": "string",
"pattern": "^-?[1-9]\\d*$"
},
{
"type": "number",
"pattern": "^-?[1-9]\\d*$"
}
]
}
},
"required": [
"unitType",
"unitToken"
]
},
"to": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"oneOf": [
{
"type": "string",
"pattern": "^-?[1-9]\\d*$"
},
{
"type": "number",
"pattern": "^-?[1-9]\\d*$"
}
]
}
},
"required": [
"unitType",
"unitToken"
]
},
"exchangeRateKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"strategy": {
"type": "string",
"enum": [
"smallest-largest",
"newest-oldest",
"random"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"sources",
"owner",
"from",
"to",
"exchangeRateKey",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots with the requested amount exchanged to the target asset class and any exchange rates used. Also returns the remaining knot if a split was required.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"exchangedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"remainingKnot": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
},
"exchangeRates": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"rate": {
"type": "string"
}
},
"required": [
"key",
"rate"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"exchangedKnots",
"exchangeRates",
"idempotentResponse"
]
}
}
}
},
"400": {
"description": "Thrown when the requested amount is greater than the available balance",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
400
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"InsufficientFundsError"
]
},
"data": {
"type": "object",
"properties": {
"sourceBalances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
}
},
"required": [
"amount",
"knotIds"
]
}
},
"requestedAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"overageAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
}
},
"required": [
"sourceBalances",
"requestedAmount",
"overageAmount"
]
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v1/exchange/quote": {
"post": {
"tags": [
"Beta"
],
"summary": "Preview an exchange of knots from one asset class to another",
"operationId": "exchange quote",
"requestBody": {
"description": "Money to exchange, and asset class to exchange to",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"from": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"oneOf": [
{
"type": "string",
"pattern": "^-?[1-9]\\d*$"
},
{
"type": "number",
"pattern": "^-?[1-9]\\d*$"
}
]
}
},
"required": [
"unitType",
"unitToken"
]
},
"to": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"oneOf": [
{
"type": "string",
"pattern": "^-?[1-9]\\d*$"
},
{
"type": "number",
"pattern": "^-?[1-9]\\d*$"
}
]
}
},
"required": [
"unitType",
"unitToken"
]
},
"exchangeRateKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"strategy": {
"type": "string",
"enum": [
"smallest-largest",
"newest-oldest",
"random"
]
}
},
"required": [
"sources",
"owner",
"from",
"to",
"actor"
]
}
}
}
},
"responses": {
"200": {
"description": "Balance in the target asset class, the exchange rates used, and the knots that were chosen to exchange.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"quotedAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"exchangeRates": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"rate": {
"type": "string"
}
},
"required": [
"key",
"rate"
]
}
},
"chosenKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"remainingKnot": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"required": [
"quotedAmount",
"exchangeRates",
"chosenKnots"
]
}
}
}
},
"400": {
"description": "Thrown when the requested amount is greater than the available balance",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
400
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"InsufficientFundsError"
]
},
"data": {
"type": "object",
"properties": {
"sourceBalances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
}
},
"required": [
"amount",
"knotIds"
]
}
},
"requestedAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"overageAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
}
},
"required": [
"sourceBalances",
"requestedAmount",
"overageAmount"
]
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v2/groups": {
"post": {
"tags": [
"Current"
],
"summary": "Returns all groups with matching ids",
"operationId": "get groups by id",
"requestBody": {
"description": "Get groups by id",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"ids"
]
}
}
}
},
"responses": {
"200": {
"description": "Groups matching the specified criteria",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
}
},
"required": [
"groups"
]
}
}
}
},
"404": {
"description": "Thrown when the provided resources can't be found to continue the operation",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
404
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"NotFoundError"
]
},
"data": {
"type": "object",
"properties": {
"missingIds": {
"type": "array",
"items": {
"type": "string"
}
},
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"missingGroups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"missingHolds": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
]
}
}
},
"required": []
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v2/groups/search": {
"post": {
"tags": [
"Current"
],
"summary": "Searches for groups",
"operationId": "search groups",
"requestBody": {
"description": "Search groups",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"term": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"groups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
},
"required": []
}
}
}
},
"responses": {
"200": {
"description": "Groups found matching the search criteria",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
}
},
"required": [
"groups"
]
}
}
}
}
}
}
},
"/v2/hold/add": {
"post": {
"tags": [
"Deprecated"
],
"summary": "Add a hold to a knot, preventing it from being used in transfers, loans, repayments, or withdrawals",
"operationId": "add hold(s) to knots",
"requestBody": {
"description": "Add hold(s) to knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"holds": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
]
}
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"sources",
"owner",
"holds",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots that had a hold added, and the holds themselves.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"heldKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
},
"unchangedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"heldKnots",
"holds",
"unchangedKnots",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v1/hold/create": {
"post": {
"tags": [
"Deprecated"
],
"summary": "Creates a new hold without associating any knots",
"operationId": "create a hold",
"requestBody": {
"description": "Create a hold",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"required": [
"type",
"token",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "The newly created hold",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"hold": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"hold",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/hold/create": {
"post": {
"tags": [
"Current"
],
"summary": "Creates a new hold without associating any knots",
"operationId": "create a hold",
"requestBody": {
"description": "Create a hold",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"type",
"token",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "The newly created hold",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"hold": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"hold",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/hold/release": {
"post": {
"tags": [
"Deprecated"
],
"summary": "Release a hold from a knot, allowing it to be used in transfers, loans, repayments, or withdrawals",
"operationId": "release hold(s) from knots",
"requestBody": {
"description": "Release hold(s) from knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"holdIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"sources",
"owner",
"holdIds",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots that had a holds released, and the released holds.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"releasedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"releasedHolds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
},
"unchangedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"releasedKnots",
"releasedHolds",
"unchangedKnots",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/holds": {
"post": {
"tags": [
"Current"
],
"summary": "Returns all holds with matching ids",
"operationId": "get holds by id",
"requestBody": {
"description": "Get holds by id",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"ids"
]
}
}
}
},
"responses": {
"200": {
"description": "Holds matching the specified criteria",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"holds"
]
}
}
}
}
}
}
},
"/v3/holds/add": {
"post": {
"tags": [
"Current"
],
"summary": "Add a holds to knots, preventing them from being used in transfers, loans, repayments, or withdrawals",
"operationId": "add hold(s) to knots",
"requestBody": {
"description": "Add hold(s) to knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"holds": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
]
}
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"sources",
"owner",
"holds",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots that had a hold added, and the holds themselves",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"heldKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"heldKnots",
"holds",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/holds/knots": {
"post": {
"tags": [
"Current"
],
"summary": "Returns all knots associated with the specified hold(s)",
"operationId": "get knots by holds",
"requestBody": {
"description": "Get knots by holds",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"holdIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"current": {
"type": "string",
"enum": [
"current",
"old",
"any"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"holdIds"
]
}
}
}
},
"responses": {
"200": {
"description": "All knots associated with the specified hold(s)",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"heldKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
}
},
"required": [
"heldKnots"
]
}
}
}
}
}
}
},
"/v3/holds/release": {
"post": {
"tags": [
"Current"
],
"summary": "Release holds from knots, potentially allowing the knots to be used in transfers, loans, repayments, or withdrawals",
"operationId": "release hold(s) from knots",
"requestBody": {
"description": "Release hold(s) from knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"holdIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"sources",
"owner",
"holdIds",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots that were released from the holds, and the released holds",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"releasedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"releasedHolds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"releasedKnots",
"releasedHolds",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/holds/tags": {
"post": {
"tags": [
"Current"
],
"summary": "Fetches all tags associated with the specified holds",
"operationId": "tags on holds",
"requestBody": {
"description": "Get tags by holds",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"holdIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"current": {
"type": "string",
"enum": [
"current",
"old",
"any"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"holdIds"
]
}
}
}
},
"responses": {
"200": {
"description": "All tags (common and sparse) associated with the holds",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"commonTags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"sparseTags": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
},
"examples": [
{
"[key]": [
"string"
]
}
]
}
},
"required": [
"commonTags",
"sparseTags"
]
}
}
}
}
}
}
},
"/v1/holds/tags/alter": {
"post": {
"tags": [
"Current"
],
"summary": "Adds, updates, or removes tags for held knots",
"operationId": "alter tags for held knots",
"requestBody": {
"description": "Alter tags for held knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"holds": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
]
}
},
"tagsToUpdate": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"tagsToRemove": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"holds",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "All held knots that had their tags altered",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"alteredKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"tagsUpdated": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"tagsRemoved": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"alteredKnots",
"tagsUpdated",
"tagsRemoved",
"idempotentResponse"
]
}
}
}
},
"404": {
"description": "Thrown when the provided resources can't be found to continue the operation",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
404
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"NotFoundError"
]
},
"data": {
"type": "object",
"properties": {
"missingIds": {
"type": "array",
"items": {
"type": "string"
}
},
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"missingGroups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"missingHolds": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
]
}
}
},
"required": []
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v2/knots": {
"post": {
"tags": [
"Current"
],
"summary": "Fetches knots by sources if they meet the specified filter",
"operationId": "get knots by sources",
"requestBody": {
"description": "Sources and filters that describe the knots you are looking for.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
},
"current": {
"type": "string",
"enum": [
"current",
"old",
"any"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"sources"
]
}
}
}
},
"responses": {
"200": {
"description": "All knots matching from the sources matching the provided filters",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
}
},
"required": [
"knots"
]
}
}
}
}
}
}
},
"/v2/knots/allocate": {
"post": {
"tags": [
"Current"
],
"summary": "Get an exact amount from a pool of knots",
"operationId": "allocate knots",
"requestBody": {
"description": "Allocate knots for an exact amount",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"requestedAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"oneOf": [
{
"type": "string",
"pattern": "^-?[0-9]\\d*$"
},
{
"type": "number",
"pattern": "^-?[0-9]\\d*$"
}
]
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"strategy": {
"type": "string",
"enum": [
"smallest-largest",
"newest-oldest",
"random"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupsToRemove": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"sources",
"owner",
"requestedAmount",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots that equal the exact requested amount. Also returns the remaining knot if a split was required.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"allocatedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"remainingKnot": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"allocatedKnots",
"idempotentResponse"
]
}
}
}
},
"400": {
"description": "Thrown when the requested amount is greater than the available balance",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
400
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"InsufficientFundsError"
]
},
"data": {
"type": "object",
"properties": {
"sourceBalances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
}
},
"required": [
"amount",
"knotIds"
]
}
},
"requestedAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"overageAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
}
},
"required": [
"sourceBalances",
"requestedAmount",
"overageAmount"
]
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v2/knots/balances": {
"post": {
"tags": [
"Current"
],
"summary": "Computes balances based on the provided knot sources",
"operationId": "get balances from knots",
"requestBody": {
"description": "Get balances from knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"anyOf": [
{
"type": "string",
"pattern": "any"
},
{
"type": "array",
"items": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
}
}
]
},
"excludeDebt": {
"type": "boolean"
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"includeKnots": {
"type": "boolean"
}
},
"required": [
"sources"
]
}
}
}
},
"responses": {
"200": {
"description": "Balances derived from the provided knots",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"balances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
}
},
"required": [
"amount"
]
}
}
},
"required": [
"balances"
]
}
}
}
}
}
}
},
"/v2/knots/groups": {
"post": {
"tags": [
"Current"
],
"summary": "Gets groups associated with a set of knots",
"operationId": "get groups for knots",
"requestBody": {
"description": "Get groups for knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
},
"current": {
"type": "string",
"enum": [
"current",
"old",
"any"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"sources"
]
}
}
}
},
"responses": {
"200": {
"description": "Groups from knots in the specified sources",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"commonGroups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"sparseGroups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
}
},
"required": [
"commonGroups",
"sparseGroups"
]
}
}
}
}
}
}
},
"/v1/knots/groups/alter": {
"post": {
"tags": [
"Deprecated"
],
"summary": "Adds or removes groups for knots",
"operationId": "alter groups for knots",
"requestBody": {
"description": "Alter groups for knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
}
},
"required": []
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupsToRemove": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"sources",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "All knots that had their groups altered",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"alteredKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"unchangedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"groupsAdded": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"groupsRemoved": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"alteredKnots",
"unchangedKnots",
"groupsAdded",
"groupsRemoved",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/knots/groups/alter": {
"post": {
"tags": [
"Current"
],
"summary": "Adds or removes groups for knots",
"operationId": "alter groups for knots",
"requestBody": {
"description": "Alter groups for knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
}
},
"required": []
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupsToRemove": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"sources",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "All knots that had their groups altered",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"alteredKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"groupsAdded": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"groupsRemoved": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"alteredKnots",
"groupsAdded",
"groupsRemoved",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/knots/recent": {
"post": {
"tags": [
"Current"
],
"summary": "Returns the most recently created knots",
"operationId": "get recently created knots",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": []
}
}
}
},
"responses": {
"200": {
"description": "The most recently created knots",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
}
},
"required": [
"knots"
]
}
}
}
}
}
}
},
"/v2/knots/search": {
"post": {
"tags": [
"Current"
],
"summary": "Searches for knots matching the specified criteria",
"operationId": "search knots",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"term": {
"type": "string"
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
},
"current": {
"type": "string",
"enum": [
"current",
"old",
"any"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"term"
]
}
}
}
},
"responses": {
"200": {
"description": "All knots matching the specified criteria",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
}
},
"required": [
"knots"
]
}
}
}
}
}
}
},
"/v2/knots/tags": {
"post": {
"tags": [
"Current"
],
"summary": "Gets common and sparse tags from knots in a thread",
"operationId": "get tags for threads",
"requestBody": {
"description": "Get tags for threads",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
},
"current": {
"type": "string",
"enum": [
"current",
"old",
"any"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"sources"
]
}
}
}
},
"responses": {
"200": {
"description": "Common and sparse tags associated with the thread",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"commonTags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"sparseTags": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
},
"examples": [
{
"[key]": [
"string"
]
}
]
}
},
"required": [
"commonTags",
"sparseTags"
]
}
}
}
}
}
}
},
"/v1/knots/tags/alter": {
"post": {
"tags": [
"Deprecated"
],
"summary": "Adds, updates, or removes tags for knots",
"operationId": "alter tags for knots",
"requestBody": {
"description": "Alter tags for knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
}
},
"required": []
},
"tagsToUpdate": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"tagsToRemove": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"sources",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "All knots that had their tags altered",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"alteredKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"unchangedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"tagsUpdated": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"tagsRemoved": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"alteredKnots",
"unchangedKnots",
"tagsUpdated",
"tagsRemoved",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/knots/tags/alter": {
"post": {
"tags": [
"Current"
],
"summary": "Adds, updates, or removes tags for knots",
"operationId": "alter tags for knots",
"requestBody": {
"description": "Alter tags for knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
}
},
"required": []
},
"tagsToUpdate": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"tagsToRemove": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"sources",
"owner",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "All knots that had their tags altered",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"alteredKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"tagsUpdated": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"tagsRemoved": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"alteredKnots",
"tagsUpdated",
"tagsRemoved",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/knots/trace": {
"post": {
"tags": [
"Current"
],
"summary": "Provides the complete trace of each piece of source money from deposit to current",
"operationId": "trace the history of knots",
"requestBody": {
"description": "Trace the history of knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sources": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"threadIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
}
},
"groupUnions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"groupIntersections": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
}
},
"required": []
},
"filters": {
"type": "object",
"properties": {
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return",
"any"
]
},
"holdStatus": {
"type": "string",
"enum": [
"any",
"held",
"free"
]
},
"current": {
"type": "string",
"enum": [
"current",
"old",
"any"
]
}
},
"required": []
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"sources"
]
}
}
}
},
"responses": {
"200": {
"description": "History of all knots",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
}
},
"required": [
"knots"
]
}
}
}
}
}
}
},
"/v2/loan/group": {
"post": {
"tags": [
"Current"
],
"summary": "Loan money from one group to another",
"operationId": "loan between groups",
"requestBody": {
"description": "Loan between groups",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"source": {
"type": "object",
"properties": {
"groupIntersection": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"groupIntersection",
"owner"
]
},
"destination": {
"type": "object",
"properties": {
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"owner"
]
},
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": {
"currency_micros": "currency_micros",
"loyalty_points": "loyalty_points"
}
},
"unitToken": {
"type": "string",
"minLength": 1
},
"unitCount": {
"type": "integer",
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"source",
"destination",
"amount",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots that were part of the loan, and the loan group",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"loanedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"positiveKnotsLoaned": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"debtKnotsLoaned": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"loanGroup": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
},
"transfers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "transfer_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"type": {
"type": "string",
"enum": [
"threaded",
"withdraw"
]
},
"sourceKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"pendingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"withdrawnKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"destinationKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"step": {
"type": "string",
"enum": [
"pending",
"transferred",
"complete"
]
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"sourceOwner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"destinationOwner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"group": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
},
"groupId": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id",
"createdAt",
"type",
"sourceKnotId",
"destinationKnotId",
"step",
"actorType",
"actorId",
"actionData",
"sourceOwner",
"destinationOwner",
"group",
"groupId"
]
}
},
"withdrawnKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"loanedKnots",
"positiveKnotsLoaned",
"debtKnotsLoaned",
"loanGroup",
"transfers",
"withdrawnKnots",
"idempotentResponse"
]
}
}
}
},
"500": {
"description": "Thrown when the requested amount is greater than the available balance",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
400
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"InsufficientFundsError"
]
},
"data": {
"type": "object",
"properties": {
"sourceBalances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
}
},
"required": [
"amount",
"knotIds"
]
}
},
"requestedAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"overageAmount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
}
},
"required": [
"sourceBalances",
"requestedAmount",
"overageAmount"
]
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v1/loan/group/bulk": {
"post": {
"tags": [
"Beta"
],
"summary": "Make multiple loans from the same source of money to a single destination owner",
"operationId": "bulk loan",
"requestBody": {
"description": "Bulk loan",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"source": {
"type": "object",
"properties": {
"groupIntersection": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"groupIntersection",
"owner"
]
},
"destination": {
"type": "object",
"properties": {
"commonGroups": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"commonTags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"owner"
]
},
"loanStrategy": {
"type": "string",
"enum": [
"smallest-largest",
"newest-oldest",
"random"
]
},
"loans": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": {
"currency_micros": "currency_micros",
"loyalty_points": "loyalty_points"
}
},
"unitToken": {
"type": "string",
"minLength": 1
},
"unitCount": {
"type": "integer",
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"amount"
]
}
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"source",
"destination",
"loans",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots that were part of the loan, and the loan group created for each loan",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"loans": {
"type": "array",
"items": {
"type": "object",
"properties": {
"loanedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
}
},
"required": [
"loanedKnots"
]
}
},
"totalAmountLoaned": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": {
"currency_micros": "currency_micros",
"loyalty_points": "loyalty_points"
}
},
"unitToken": {
"type": "string",
"minLength": 1
},
"unitCount": {
"type": "integer",
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"loans",
"totalAmountLoaned",
"idempotentResponse"
]
}
}
}
}
}
}
},
"/v2/loan/knots": {
"post": {
"tags": [
"Current"
],
"summary": "Loan money from one owner to another",
"operationId": "loan from knots",
"requestBody": {
"description": "Loan from knots",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"source": {
"type": "object",
"properties": {
"knotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"knotIds",
"owner"
]
},
"destination": {
"type": "object",
"properties": {
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
}
},
"required": [
"owner"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"source",
"destination",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots that were part of the loan, and the loan group",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"loanedKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"loanGroup": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
},
"transfers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "transfer_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"type": {
"type": "string",
"enum": [
"threaded",
"withdraw"
]
},
"sourceKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"pendingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"withdrawnKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"destinationKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"step": {
"type": "string",
"enum": [
"pending",
"transferred",
"complete"
]
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"sourceOwner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"destinationOwner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"group": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
},
"groupId": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id",
"createdAt",
"type",
"sourceKnotId",
"destinationKnotId",
"step",
"actorType",
"actorId",
"actionData",
"sourceOwner",
"destinationOwner",
"group",
"groupId"
]
}
},
"withdrawnKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"idempotentResponse": {
"type": "boolean"
}
},
"required": [
"loanedKnots",
"loanGroup",
"transfers",
"withdrawnKnots",
"idempotentResponse"
]
}
}
}
},
"500": {
"description": "Thrown when the requested knots are in a state incompatible with the operation",
"links": {},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
500
]
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"InvalidStateError"
]
},
"data": {
"type": "object",
"properties": {
"invalidKnotIds": {
"type": "array",
"items": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
}
}
},
"required": [
"invalidKnotIds"
]
}
},
"required": [
"status",
"message",
"type",
"data"
]
}
}
}
}
}
}
},
"/v1/owner/balances": {
"post": {
"tags": [
"Current"
],
"summary": "Returns the sum of all available, current knots owned by the specified owner",
"operationId": "get owner balances",
"requestBody": {
"description": "Get owner balances",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"includeKnots": {
"type": "boolean"
}
},
"required": [
"owner"
]
}
}
}
},
"responses": {
"200": {
"description": "Balances for the owner, potentially including knots",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"balances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"unitCount": {
"type": "integer"
}
},
"required": [
"unitType",
"unitToken",
"unitCount"
]
},
"knots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
}
},
"required": [
"amount"
]
}
}
},
"required": [
"balances"
]
}
}
}
}
}
}
},
"/v2/repay/group": {
"post": {
"tags": [
"Current"
],
"summary": "Removes debt by withdrawing debt and moving the positive amount to a destination group",
"operationId": "repay debt between groups",
"requestBody": {
"description": "Repay debt between groups",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"source": {
"type": "object",
"properties": {
"positiveKnotIntersection": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"debtKnotIntersection": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
}
},
"required": [
"positiveKnotIntersection",
"debtKnotIntersection",
"owner"
]
},
"destination": {
"type": "object",
"properties": {
"groupsToAdd": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
}
},
"required": [
"id"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
],
"example": {
"type": "string",
"token": "string"
}
}
]
}
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
}
},
"required": [
"owner"
]
},
"repaymentStrategy": {
"type": "string",
"enum": [
"exact",
"sufficient-funds",
"partial-repayment"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"idempotencyKey": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
}
},
"required": [
"type",
"token"
]
}
},
"required": [
"source",
"destination",
"actor",
"idempotencyKey"
]
}
}
}
},
"responses": {
"200": {
"description": "Knots that were repaid",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"repaidDebtKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
"withdraw"
]
},
"actionData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"depositThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"currentThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitThreadId": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"nextSplitKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"nextRemainingKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"examples": [
{
"[key]": "string"
}
]
},
"current": {
"type": "boolean"
},
"threads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "thread_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string",
"enum": [
"root",
"split"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"initialKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"id",
"type",
"createdAt",
"initialKnotId",
"actorType",
"actorId",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId"
]
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"id": {
"type": "string",
"pattern": "group_[a-zA-Z0-9]{26}"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
}
},
"required": [
"type",
"token",
"id",
"ownerType",
"ownerId"
]
}
},
"holds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "hold_[a-zA-Z0-9]{26}"
},
"type": {
"type": "string"
},
"token": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"actor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"type",
"id"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"type",
"token",
"owner",
"actor",
"createdAt"
]
}
}
},
"required": [
"id",
"availability",
"createdAt",
"unitCount",
"unitType",
"unitToken",
"ownerType",
"ownerId",
"actorType",
"actorId",
"actionType",
"actionData",
"depositThreadId",
"currentThreadId",
"nextSplitThreadId",
"nextSplitKnotId",
"nextRemainingKnotId",
"tags",
"current",
"threads",
"groups",
"holds"
]
}
},
"transferredKnots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"availability": {
"type": "string",
"enum": [
"available",
"withdrawn",
"cancelled",
"pending_deposit",
"pending_withdrawal",
"pending_transfer",
"pending_return"
]
},
"parentKnotId": {
"type": "string",
"pattern": "knot_[a-zA-Z0-9]{26}"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"unitCount": {
"type": "integer"
},
"unitType": {
"type": "string",
"enum": [
"currency_micros",
"loyalty_points"
]
},
"unitToken": {
"type": "string"
},
"ownerType": {
"type": "string"
},
"ownerId": {
"type": "string"
},
"actorType": {
"type": "string"
},
"actorId": {
"type": "string"
},
"actionType": {
"type": "string",
"enum": [
"add_group",
"add_hold",
"allocate",
"alter_groups",
"cancel_deposit",
"cancel_return",
"cancel_withdrawal",
"confirm_deposit",
"confirm_return",
"confirm_withdrawal",
"deposit",
"exchange",
"loan",
"pending_deposit",
"pending_return",
"pending_withdrawal",
"release_hold",
"remove_group",
"repay",
"restore_pending_deposit",
"return",
"split",
"tags",
"transfer",
"transfer_deposit",
"transfer_withdrawal",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment