#!/usr/bin/env bash
set -euo pipefail

# FinanceGPT generated client starter
# Source: FinanceGPT API v2 OpenAPI index
# OpenAPI SHA-256: 228f3cf999f801d03634f0dad1fc6d296671bc13a8cf0d80994b00a57b62f910
# Operations: post-actions-intents
# Credential: FINANCEGPT_API_KEY environment variable; no credential is embedded.
# Authority: API identity and generated code do not create model-promotion, QLM-binding or Financial Actions authority.

# Create a governed Financial Action envelope | scope: actions:create
curl -X POST \
  -H "Authorization: Bearer $FINANCEGPT_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  --data '{
    "connector_id": 1,
    "counterparty_id": 1,
    "action_key": "vendor_payment",
    "action_type": "payment",
    "currency": "string",
    "amount": 1,
    "purpose": "string",
    "calculation_source": "deterministic_calculation",
    "calculation_reference": "string",
    "execution_mode": "observe",
    "external_reference": "string",
    "idempotency_key": "string"
}' \
  "https://financegpt.dev/api/v2/actions/intents"
