Browse the docs

Pay

Pay in Allpage: its screens, what you can do there and its operations.

Availability. Works when the business has it turned on and its plan includes it. Otherwise its tools answer needs (kind module) with how to turn it on: business.useTool, or a plan that includes it.

Screens

  • Team pay (/team-pay)

What you can do

  • Save a pay rule: the assistant asks you first
  • Stop using a pay rule: the assistant asks you first
  • Set the pay period: the assistant asks you first
  • Export pay statements: the assistant asks you first

For apps

Tools

  • pay_saveRule (Save a pay rule): customers see it: waits for the owner’s approval unless they chose Just do it for your app
  • pay_archiveRule (Stop using a pay rule): customers see it: waits for the owner’s approval unless they chose Just do it for your app
  • pay_saveSettings (Set the pay period): customers see it: waits for the owner’s approval unless they chose Just do it for your app
  • pay_export (Export pay statements): customers see it: waits for the owner’s approval unless they chose Just do it for your app

Reads

  • pay_rules (See your pay rules)
  • pay_statements (See pay statements)
  • pay_download (Download exported pay statements)
  • pay_summary (What’s going on)

The owner’s screens

  • Team pay (/team-pay)

Operations

Each one's input and output, as JSON Schema. Ids are typed (typed ids).

pay.archiveRule

Stop using a pay rule

Kind
Change
Tool
pay_archiveRule
Scope
pay:write
Reached by
API, MCP, ChatGPT

customers see it: waits for the owner’s approval unless they chose Just do it for your app

Input
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ruleId": {
      "type": "string",
      "pattern": "^prl_[0-9a-hjkmnp-tv-z]{26}$",
      "description": "A pay rule id: prl_ and 26 letters and digits."
    }
  },
  "required": [
    "ruleId"
  ],
  "additionalProperties": false
}
Output
{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "status",
        "title",
        "change"
      ],
      "properties": {
        "status": {
          "const": "done"
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "result": {},
        "undo": {
          "type": "object",
          "properties": {
            "command": {
              "type": "string"
            },
            "input": {}
          }
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "proposalId"
      ],
      "properties": {
        "status": {
          "const": "proposed"
        },
        "proposalId": {
          "type": "string"
        },
        "preview": {},
        "approveAt": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "check"
      ],
      "properties": {
        "status": {
          "const": "pending"
        },
        "message": {
          "type": "string"
        },
        "check": {
          "type": "string"
        },
        "checkInput": {
          "type": "object"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "message"
      ],
      "properties": {
        "status": {
          "const": "refused"
        },
        "message": {
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "kind",
        "message"
      ],
      "properties": {
        "status": {
          "const": "needs"
        },
        "kind": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      }
    }
  ]
}

pay.export

Export pay statements

Kind
Change
Tool
pay_export
Scope
pay:write
Reached by
API, MCP, ChatGPT

customers see it: waits for the owner’s approval unless they chose Just do it for your app

Input
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "period": {
      "description": "Any day in the period to export. Left out, the period that just ended (or this one, once that’s exported).",
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "format": {
      "default": "lines",
      "description": "lines: every line with who it’s for; journal: one entry per person for the books.",
      "type": "string",
      "enum": [
        "lines",
        "journal"
      ]
    }
  },
  "additionalProperties": false
}
Output
{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "status",
        "title",
        "change"
      ],
      "properties": {
        "status": {
          "const": "done"
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "result": {},
        "undo": {
          "type": "object",
          "properties": {
            "command": {
              "type": "string"
            },
            "input": {}
          }
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "proposalId"
      ],
      "properties": {
        "status": {
          "const": "proposed"
        },
        "proposalId": {
          "type": "string"
        },
        "preview": {},
        "approveAt": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "check"
      ],
      "properties": {
        "status": {
          "const": "pending"
        },
        "message": {
          "type": "string"
        },
        "check": {
          "type": "string"
        },
        "checkInput": {
          "type": "object"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "message"
      ],
      "properties": {
        "status": {
          "const": "refused"
        },
        "message": {
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "kind",
        "message"
      ],
      "properties": {
        "status": {
          "const": "needs"
        },
        "kind": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      }
    }
  ]
}

pay.rules

See your pay rules

Kind
Read
Tool
pay_rules
Scope
pay:read
Reached by
API, MCP, ChatGPT

Read-only.

Input
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
Output
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "done"
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "result": {
          "type": "object",
          "properties": {
            "rules": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "ruleId": {
                    "type": "string",
                    "pattern": "^prl_[0-9a-hjkmnp-tv-z]{26}$",
                    "description": "A pay rule id: prl_ and 26 letters and digits."
                  },
                  "key": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "session",
                      "commission"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "archived"
                    ]
                  },
                  "appliesTo": {
                    "type": "object",
                    "properties": {
                      "resourceId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^res_[0-9a-hjkmnp-tv-z]{26}$",
                            "description": "A resource id: res_ and 26 letters and digits."
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "offeringId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^off_[0-9a-hjkmnp-tv-z]{26}$",
                            "description": "A offering id: off_ and 26 letters and digits."
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "role": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "lead",
                              "substitute",
                              "assistant",
                              "host"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "resourceId",
                      "offeringId",
                      "role"
                    ],
                    "additionalProperties": false
                  },
                  "who": {
                    "type": "string"
                  },
                  "version": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "terms": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "session"
                          },
                          "flatMinor": {
                            "default": 0,
                            "description": "A flat amount for each session, in cents.",
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1000000
                          },
                          "perAttendee": {
                            "description": "Pay for each person who came (comps count).",
                            "type": "object",
                            "properties": {
                              "brackets": {
                                "minItems": 1,
                                "maxItems": 10,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "from": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 1000,
                                      "description": "The first person this rate is for: 6 means from the 6th person on (over 5)."
                                    },
                                    "eachMinor": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 1000000,
                                      "description": "What each of those people adds, in cents."
                                    }
                                  },
                                  "required": [
                                    "from",
                                    "eachMinor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "cliff": {
                                "default": false,
                                "description": "true: once enough people come to reach a rate, every person is paid at it (10+ people at $4 pays all 12 at $4). false: each rate is only for the people past its start.",
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "brackets",
                              "cliff"
                            ],
                            "additionalProperties": false
                          },
                          "percentBps": {
                            "description": "A share of what the session brought in (its value from what people paid, without tax), in basis points: 3000 is 30%.",
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 10000
                          },
                          "minimumMinor": {
                            "description": "The least a session pays, in cents. A session that’s called off pays this, or nothing without it.",
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1000000
                          }
                        },
                        "required": [
                          "kind",
                          "flatMinor"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "commission"
                          },
                          "percentBps": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 10000,
                            "description": "The share of each payment for their services, without tax, in basis points: 4000 is 40%."
                          }
                        },
                        "required": [
                          "kind",
                          "percentBps"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "words": {
                    "type": "string"
                  }
                },
                "required": [
                  "ruleId",
                  "key",
                  "name",
                  "kind",
                  "status",
                  "appliesTo",
                  "who",
                  "version",
                  "terms",
                  "words"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "rules"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "status",
        "title",
        "change",
        "result"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "refused"
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "title",
        "change",
        "message"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "needs"
        },
        "kind": {
          "type": "string",
          "enum": [
            "module",
            "portal",
            "business",
            "limit",
            "paused",
            "reauth"
          ]
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "kind",
        "title",
        "change",
        "message"
      ],
      "additionalProperties": {}
    }
  ]
}

pay.saveRule

Save a pay rule

Kind
Change
Tool
pay_saveRule
Scope
pay:write
Reached by
API, MCP, ChatGPT

customers see it: waits for the owner’s approval unless they chose Just do it for your app

Input
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ruleId": {
      "description": "The rule to change, from pay.rules.",
      "type": "string",
      "pattern": "^prl_[0-9a-hjkmnp-tv-z]{26}$"
    },
    "key": {
      "description": "Its own short name: saving with a key that exists changes that rule.",
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9_-]{0,59}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "appliesTo": {
      "default": {},
      "description": "Who it’s for. Leave it empty for everyone on the team; owners are paid only by a rule that names them.",
      "type": "object",
      "properties": {
        "resourceId": {
          "description": "Only this person: their calendar id, from the team list. Their own rule wins over any other.",
          "type": "string",
          "pattern": "^res_[0-9a-hjkmnp-tv-z]{26}$"
        },
        "offeringId": {
          "description": "Only sessions (or services) of this offering.",
          "type": "string",
          "pattern": "^off_[0-9a-hjkmnp-tv-z]{26}$"
        },
        "role": {
          "description": "Only people doing this at a session: lead, substitute, assistant or host. A substitute gets the lead’s rule when there’s none for substitutes.",
          "type": "string",
          "enum": [
            "lead",
            "substitute",
            "assistant",
            "host"
          ]
        }
      },
      "additionalProperties": false
    },
    "terms": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "session"
            },
            "flatMinor": {
              "default": 0,
              "description": "A flat amount for each session, in cents.",
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000
            },
            "perAttendee": {
              "description": "Pay for each person who came (comps count).",
              "type": "object",
              "properties": {
                "brackets": {
                  "minItems": 1,
                  "maxItems": 10,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1000,
                        "description": "The first person this rate is for: 6 means from the 6th person on (over 5)."
                      },
                      "eachMinor": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000,
                        "description": "What each of those people adds, in cents."
                      }
                    },
                    "required": [
                      "from",
                      "eachMinor"
                    ],
                    "additionalProperties": false
                  }
                },
                "cliff": {
                  "default": false,
                  "description": "true: once enough people come to reach a rate, every person is paid at it (10+ people at $4 pays all 12 at $4). false: each rate is only for the people past its start.",
                  "type": "boolean"
                }
              },
              "required": [
                "brackets"
              ],
              "additionalProperties": false
            },
            "percentBps": {
              "description": "A share of what the session brought in (its value from what people paid, without tax), in basis points: 3000 is 30%.",
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            },
            "minimumMinor": {
              "description": "The least a session pays, in cents. A session that’s called off pays this, or nothing without it.",
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "commission"
            },
            "percentBps": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "description": "The share of each payment for their services, without tax, in basis points: 4000 is 40%."
            }
          },
          "required": [
            "kind",
            "percentBps"
          ],
          "additionalProperties": false
        }
      ],
      "description": "session: pay for each session run (flatMinor, perAttendee brackets, percentBps of what it brought in, minimumMinor). commission: percentBps of each payment for their services, taken back on refunds."
    }
  },
  "required": [
    "name",
    "terms"
  ],
  "additionalProperties": false
}
Output
{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "status",
        "title",
        "change"
      ],
      "properties": {
        "status": {
          "const": "done"
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "result": {},
        "undo": {
          "type": "object",
          "properties": {
            "command": {
              "type": "string"
            },
            "input": {}
          }
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "proposalId"
      ],
      "properties": {
        "status": {
          "const": "proposed"
        },
        "proposalId": {
          "type": "string"
        },
        "preview": {},
        "approveAt": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "check"
      ],
      "properties": {
        "status": {
          "const": "pending"
        },
        "message": {
          "type": "string"
        },
        "check": {
          "type": "string"
        },
        "checkInput": {
          "type": "object"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "message"
      ],
      "properties": {
        "status": {
          "const": "refused"
        },
        "message": {
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "kind",
        "message"
      ],
      "properties": {
        "status": {
          "const": "needs"
        },
        "kind": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      }
    }
  ]
}

pay.saveSettings

Set the pay period

Kind
Change
Tool
pay_saveSettings
Scope
pay:write
Reached by
API, MCP, ChatGPT

customers see it: waits for the owner’s approval unless they chose Just do it for your app

Input
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "enum": [
        "week",
        "two_weeks",
        "half_month",
        "month"
      ],
      "description": "week, two_weeks, half_month (1st–15th and 16th–end) or month."
    },
    "startsOn": {
      "description": "For a week or two weeks: the first day of any period.",
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "period"
  ],
  "additionalProperties": false
}
Output
{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "status",
        "title",
        "change"
      ],
      "properties": {
        "status": {
          "const": "done"
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "result": {},
        "undo": {
          "type": "object",
          "properties": {
            "command": {
              "type": "string"
            },
            "input": {}
          }
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "proposalId"
      ],
      "properties": {
        "status": {
          "const": "proposed"
        },
        "proposalId": {
          "type": "string"
        },
        "preview": {},
        "approveAt": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "check"
      ],
      "properties": {
        "status": {
          "const": "pending"
        },
        "message": {
          "type": "string"
        },
        "check": {
          "type": "string"
        },
        "checkInput": {
          "type": "object"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "message"
      ],
      "properties": {
        "status": {
          "const": "refused"
        },
        "message": {
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "status",
        "kind",
        "message"
      ],
      "properties": {
        "status": {
          "const": "needs"
        },
        "kind": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      }
    }
  ]
}

pay.summary

What’s going on

Kind
Read
Tool
pay_summary
Scope
pay:read
Reached by
API, MCP

Read-only.

Input
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
Output
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "done"
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "result": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "facts": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "One-line facts, e.g. \"3 bookings today\"."
            },
            "attention": {
              "description": "Things that need the owner, each with a plain reason.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "href": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "text"
                ],
                "additionalProperties": false
              }
            },
            "happening": {
              "description": "What’s on today, each at its time.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "at": {
                    "type": "number",
                    "description": "Epoch milliseconds."
                  },
                  "text": {
                    "type": "string"
                  },
                  "href": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "at",
                  "text"
                ],
                "additionalProperties": false
              }
            },
            "metrics": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "value": {
                    "type": "number"
                  },
                  "prior": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "count",
                      "money"
                    ]
                  },
                  "href": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "label",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "title",
            "facts"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "status",
        "title",
        "change",
        "result"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "refused"
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "title",
        "change",
        "message"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "needs"
        },
        "kind": {
          "type": "string",
          "enum": [
            "module",
            "portal",
            "business",
            "limit",
            "paused",
            "reauth"
          ]
        },
        "title": {
          "type": "string"
        },
        "change": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "kind",
        "title",
        "change",
        "message"
      ],
      "additionalProperties": {}
    }
  ]
}