> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tolt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Commission

> This endpoint creates a commission.

## Base URL `https://api.tolt.com`

<br />

### Body Parameters

<ParamField body="amount*" type="number">
  The commission amount in cents
</ParamField>

<ParamField body="customer_id*" type="string">
  The ID of the customer associated with this commission
</ParamField>

<ParamField body="transaction_id" type="string - optional">
  Associated transaction identifier
</ParamField>

<ParamField body="charge_id" type="string - optional">
  Associated charge identifier
</ParamField>

<ParamField body="source" type="string - optional">
  Source of the commission
</ParamField>

<ParamField body="status" type="string - optional">
  Commission status. Valid values are: 'pending', 'approved', 'paid',
  'rejected', 'refunded'
</ParamField>

<ParamField body="revenue" type="number - optional">
  The revenue amount in cents
</ParamField>

<ParamField body="created_at" type="string - optional">
  ISO 8601 timestamp of when the commission was created
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Whether the request was successful
</ResponseField>

<ResponseField name="data" type="array[object]">
  <Expandable title="properties" defaultOpen={true}>
    <ResponseField name="id" type="string">
      Unique identifier for the commission
    </ResponseField>

    <ResponseField name="amount" type="number">
      Commission amount in cents
    </ResponseField>

    <ResponseField name="customer_id" type="string">
      ID of the associated customer
    </ResponseField>

    <ResponseField name="transaction_id" type="string">
      Associated transaction identifier
    </ResponseField>

    <ResponseField name="charge_id" type="string | null">
      Associated charge identifier
    </ResponseField>

    <ResponseField name="charge_status" type="string | null">
      Status of the related charge (e.g. "paid", "failed")
    </ResponseField>

    <ResponseField name="source" type="string | null">
      Source of the commission
    </ResponseField>

    <ResponseField name="status" type="string | null">
      Commission status
    </ResponseField>

    <ResponseField name="type" type="string | null">
      Type of commission (e.g. "reward", "referral")
    </ResponseField>

    <ResponseField name="currency" type="string | null">
      Currency of the commission (ISO currency code) or null if not set
    </ResponseField>

    <ResponseField name="revenue" type="number | null">
      Revenue amount in cents
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of creation
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      ISO 8601 timestamp of update
    </ResponseField>

    <ResponseField name="partner_id" type="string">
      ID of the partner who earned the commission
    </ResponseField>

    <ResponseField name="program_id" type="string">
      Program ID the commission belongs to
    </ResponseField>

    <ResponseField name="organization_id" type="string">
      Organization ID
    </ResponseField>

    <ResponseField name="payout_id" type="string | null">
      ID of the payout if the commission has been paid, otherwise null
    </ResponseField>

    <ResponseField name="scheduled_approval_date" type="string | null">
      Scheduled approval date if applicable, otherwise null
    </ResponseField>

    <ResponseField name="approval_type" type="string | null">
      Approval type for the commission (e.g. "immediate", "manual")
    </ResponseField>

    <ResponseField name="flow_id" type="string | null">
      ID of the flow that generated the commission
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X POST 'https://api.tolt.com/v1/commissions' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
      "amount": 1999,
      "customer_id": "cust_dK9bzRGn46BhVgNFHD6fDgXW",
      "transaction_id": "txn_7mbzRGn46BhVgNFHD6fDgXW",
      "charge_id": "ch_9bzRGn46BhVgNFHD6fDgXW",
      "source": "stripe",
      "status": "pending",
      "revenue": 9999,
      "created_at": "2025-01-15T14:30:00.000Z"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={"system"}
  {
    "success": true,
    "data": [
      {
        "id": "comm_eK9bzRGn46BhVgNFHD6fDgXW",
        "revenue": null,
        "charge_id": "ch_9bzRGn46BhVgNFHD6fDgXW",
        "charge_status": null,
        "source": "stripe",
        "status": "pending",
        "type": null,
        "currency": null,
        "program_id": "prg_YRsbPDAKhWfdqJbFACheh",
        "organization_id": "org_JE3mfYNL9ci7sFaJazAv2",
        "transaction_id": "txn_7mbzRGn46BhVgNFHD6fDgXW",
        "customer_id": "cust_dK9bzRGn46BhVgNFHD6fDgXW",
        "payout_id": null,
        "created_at": "2025-01-15T14:30:00.000Z",
        "updated_at": "2025-01-15T14:30:00.000Z",
        "amount": "1999",
        "scheduled_approval_date": null,
        "approval_type": "manual",
        "flow_id": null
      }
    ]
  }
  ```
</ResponseExample>
