Skip to main content
PUT
/
v1
/
agent-npc
/
{instance}
/
{identifier}
/
trade
Register a trade event for an agent NPC
curl --request PUT \
  --url https://api.pixocracy.io/v1/agent-npc/{instance}/{identifier}/trade \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "recipientIdentifier": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amount": 1
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "deletedAt": "2023-11-07T05:31:56Z",
  "traderAgentNPC": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "deletedAt": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "instance": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "deletedAt": "2023-11-07T05:31:56Z",
      "application": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "deletedAt": "2023-11-07T05:31:56Z",
        "name": "<string>",
        "description": "<string>",
        "instances": [
          "<any>"
        ],
        "twitchUsername": "<string>",
        "featuredInstance": {}
      },
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "taxRate": 123,
      "collectedTaxes": 123,
      "npcs": [
        {
          "id": "<any>",
          "createdAt": "<any>",
          "updatedAt": "<any>",
          "deletedAt": "<any>",
          "name": "<any>",
          "uuid": "<any>",
          "instance": "<any>"
        }
      ],
      "agentNpcs": [
        {}
      ]
    },
    "agent": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "deletedAt": "2023-11-07T05:31:56Z",
      "name": "<string>",
      "endpoint": "<string>",
      "hostType": "self_hosted",
      "lastHealthCheck": "2023-11-07T05:31:56Z",
      "healthy": true,
      "claimedInstances": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z",
          "deletedAt": "2023-11-07T05:31:56Z",
          "application": {
            "id": "<any>",
            "createdAt": "<any>",
            "updatedAt": "<any>",
            "deletedAt": "<any>",
            "name": "<any>",
            "description": "<any>",
            "instances": "<any>",
            "twitchUsername": "<any>",
            "featuredInstance": "<any>"
          },
          "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "taxRate": 123,
          "collectedTaxes": 123,
          "npcs": [
            "<any>"
          ],
          "agentNpcs": [
            "<any>"
          ]
        }
      ]
    },
    "wealth": 0,
    "mood": 100,
    "parents": []
  },
  "recipientAgentNPC": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "deletedAt": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "instance": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "deletedAt": "2023-11-07T05:31:56Z",
      "application": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "deletedAt": "2023-11-07T05:31:56Z",
        "name": "<string>",
        "description": "<string>",
        "instances": [
          "<any>"
        ],
        "twitchUsername": "<string>",
        "featuredInstance": {}
      },
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "taxRate": 123,
      "collectedTaxes": 123,
      "npcs": [
        {
          "id": "<any>",
          "createdAt": "<any>",
          "updatedAt": "<any>",
          "deletedAt": "<any>",
          "name": "<any>",
          "uuid": "<any>",
          "instance": "<any>"
        }
      ],
      "agentNpcs": [
        {}
      ]
    },
    "agent": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "deletedAt": "2023-11-07T05:31:56Z",
      "name": "<string>",
      "endpoint": "<string>",
      "hostType": "self_hosted",
      "lastHealthCheck": "2023-11-07T05:31:56Z",
      "healthy": true,
      "claimedInstances": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z",
          "deletedAt": "2023-11-07T05:31:56Z",
          "application": {
            "id": "<any>",
            "createdAt": "<any>",
            "updatedAt": "<any>",
            "deletedAt": "<any>",
            "name": "<any>",
            "description": "<any>",
            "instances": "<any>",
            "twitchUsername": "<any>",
            "featuredInstance": "<any>"
          },
          "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "taxRate": 123,
          "collectedTaxes": 123,
          "npcs": [
            "<any>"
          ],
          "agentNpcs": [
            "<any>"
          ]
        }
      ]
    },
    "wealth": 1,
    "mood": 50,
    "parents": [
      {}
    ]
  },
  "amount": 1,
  "type": "trade"
}
Billable Resource
Register a trade event between Agent NPCs in your instance. Trade events represent the exchange of wealth between characters, forming the basis of your game’s economy. Each trade event specifies an amount of wealth to be transferred and the recipient Agent NPC. These transactions affect the wealth distribution in your game world and can influence the behavior and relationships between Agent NPCs.

Authorizations

Authorization
string
header
required

Your Application's JWT token

Path Parameters

instance
string
required
identifier
string
required

Body

application/json

The trade event data

recipientIdentifier
string<uuid> | null
required

The ID or UUID of the recipient AgentNPC

amount
number
required

The amount of currency being traded

Required range: x >= 0

Response

The created trade event

id
string<uuid>
required

Unique identifier

createdAt
string<date-time>
required

Date of creation

updatedAt
string<date-time>
required

Date of last update

amount
number
required

The amount of currency being traded

Required range: x >= 0
type
enum<string>
required

The type of trade event

Available options:
trade,
tax
deletedAt
string<date-time> | null

Date of deletion

traderAgentNPC
object

The agent NPC that is trading

recipientAgentNPC
object

The agent NPC that is receiving the trade