GET /v1/billing
Get billing overview
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/billingParameters
| Name | Type | Default |
|---|---|---|
| refreshquery, optional | boolean | false |
200 response (application/json)
200 response fields and schemaShowHide
Fields
| Name | Type | Default |
|---|---|---|
| organization_idrequired | string | |
| providerrequired | string | |
| planrequired | string | |
| credit_price_centsrequired | integer | |
| balancerequired | object | |
| auto_reloadrequired | object | |
| presetsrequired | (object)[] | |
| packsrequired | (object)[] | |
| payment_method_savedrequired | boolean | |
| payment_methodoptional | object or null | |
| portal_availablerequired | boolean | |
| payment_methodsoptional | (object)[] or null | [] |
| billing_detailsoptional | object or null | |
| spend_limitoptional | object or null |
{
"$ref": "#/$defs/BillingResponse",
"$defs": {
"BalanceResponse": {
"type": "object",
"required": [
"allowance",
"allowance_available",
"purchased",
"total_available",
"reset_at"
],
"properties": {
"allowance": {
"type": "integer"
},
"allowance_available": {
"type": "integer"
},
"purchased": {
"type": "integer"
},
"total_available": {
"type": "integer"
},
"reset_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
},
"AutoReloadResponse": {
"type": "object",
"required": [
"enabled",
"threshold_credits",
"amount_cents",
"monthly_cap_cents",
"disabled_reason",
"this_month_cents"
],
"properties": {
"enabled": {
"type": "boolean"
},
"threshold_credits": {
"type": "integer"
},
"amount_cents": {
"type": "integer"
},
"monthly_cap_cents": {
"type": "integer"
},
"disabled_reason": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"this_month_cents": {
"type": "integer"
}
}
},
"PresetResponse": {
"type": "object",
"required": [
"amount_cents",
"credits"
],
"properties": {
"amount_cents": {
"type": "integer"
},
"credits": {
"type": "integer"
}
}
},
"PackResponse": {
"type": "object",
"required": [
"slug",
"display_name",
"credits",
"amount_cents"
],
"properties": {
"slug": {
"type": "string"
},
"display_name": {
"type": "string"
},
"credits": {
"type": "integer"
},
"amount_cents": {
"type": "integer"
}
}
},
"PaymentMethodResponse": {
"type": "object",
"required": [
"brand",
"last4",
"exp_month",
"exp_year"
],
"properties": {
"brand": {
"type": "string"
},
"last4": {
"type": "string"
},
"exp_month": {
"type": "integer"
},
"exp_year": {
"type": "integer"
}
}
},
"SavedMethodResponse": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string"
},
"brand": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"last4": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"exp_month": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"exp_year": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"default": {
"type": "boolean",
"default": false
},
"wallet": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
},
"AddressResponse": {
"type": "object",
"properties": {
"line1": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"line2": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"city": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"postal_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
},
"TaxIdResponse": {
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"BillingDetailsResponse": {
"type": "object",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"address": {
"anyOf": [
{
"$ref": "#/$defs/AddressResponse"
},
{
"type": "null"
}
]
},
"tax_ids": {
"type": "array",
"default": [],
"items": {
"$ref": "#/$defs/TaxIdResponse"
}
}
}
},
"SpendLimitResponse": {
"type": "object",
"required": [
"monthly_credits",
"notify_percent",
"used_this_month"
],
"properties": {
"monthly_credits": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"notify_percent": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"used_this_month": {
"type": "integer"
}
}
},
"BillingResponse": {
"type": "object",
"required": [
"organization_id",
"provider",
"plan",
"credit_price_cents",
"balance",
"auto_reload",
"presets",
"packs",
"payment_method_saved",
"portal_available"
],
"properties": {
"organization_id": {
"type": "string"
},
"provider": {
"type": "string"
},
"plan": {
"type": "string"
},
"credit_price_cents": {
"type": "integer"
},
"balance": {
"$ref": "#/$defs/BalanceResponse"
},
"auto_reload": {
"$ref": "#/$defs/AutoReloadResponse"
},
"presets": {
"type": "array",
"items": {
"$ref": "#/$defs/PresetResponse"
}
},
"packs": {
"type": "array",
"items": {
"$ref": "#/$defs/PackResponse"
}
},
"payment_method_saved": {
"type": "boolean"
},
"payment_method": {
"anyOf": [
{
"$ref": "#/$defs/PaymentMethodResponse"
},
{
"type": "null"
}
]
},
"portal_available": {
"type": "boolean"
},
"payment_methods": {
"default": [],
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/$defs/SavedMethodResponse"
}
},
{
"type": "null"
}
]
},
"billing_details": {
"anyOf": [
{
"$ref": "#/$defs/BillingDetailsResponse"
},
{
"type": "null"
}
]
},
"spend_limit": {
"anyOf": [
{
"$ref": "#/$defs/SpendLimitResponse"
},
{
"type": "null"
}
]
}
}
}
}
}Illustrative response shape. Values are placeholders, not a recorded result.
{
"organization_id": "<value>",
"provider": "<value>",
"plan": "<value>",
"credit_price_cents": 0,
"balance": {
"allowance": 0,
"allowance_available": 0,
"purchased": 0,
"total_available": 0,
"reset_at": "<value>"
},
"auto_reload": {
"enabled": false,
"threshold_credits": 0,
"amount_cents": 0,
"monthly_cap_cents": 0,
"disabled_reason": "<value>",
"this_month_cents": 0
},
"presets": [
{
"amount_cents": 0,
"credits": 0
}
],
"packs": [
{
"slug": "<value>",
"display_name": "<value>",
"credits": 0,
"amount_cents": 0
}
],
"payment_method_saved": false,
"payment_method": {
"brand": "<value>",
"last4": "<value>",
"exp_month": 0,
"exp_year": 0
},
"portal_available": false,
"payment_methods": [],
"billing_details": {
"name": "<value>",
"email": "<value>",
"address": {
"line1": "<value>",
"line2": "<value>",
"city": "<value>",
"state": "<value>",
"postal_code": "<value>",
"country": "<value>"
},
"tax_ids": []
},
"spend_limit": {
"monthly_credits": 0,
"notify_percent": 0,
"used_this_month": 0
}
}Returns 200 or 422.
PUT /v1/billing/auto-reload
Change auto-reload
Only an organization admin can use this.
curl -H "x-api-key: $PHI_KEY" -X PUT https://api.dynophi.com/v1/billing/auto-reload \
-H "content-type: application/json" \
-d '{
"enabled": "<enabled>",
"threshold_credits": "<threshold_credits>",
"amount_cents": "<amount_cents>",
"monthly_cap_cents": "<monthly_cap_cents>"
}'Body
| Name | Type | Description |
|---|---|---|
| enabledrequired | boolean | |
| threshold_creditsrequired | integer | minimum: 0 |
| amount_centsrequired | integer | greater than: 0 |
| monthly_cap_centsrequired | integer | greater than: 0 |
Complete request schemaShowHide
Fields
| Name | Type | Description |
|---|---|---|
| enabledrequired | boolean | |
| threshold_creditsrequired | integer | minimum: 0 |
| amount_centsrequired | integer | greater than: 0 |
| monthly_cap_centsrequired | integer | greater than: 0 |
{
"$ref": "#/$defs/AutoReloadRequest",
"$defs": {
"AutoReloadRequest": {
"type": "object",
"required": [
"enabled",
"threshold_credits",
"amount_cents",
"monthly_cap_cents"
],
"properties": {
"enabled": {
"type": "boolean"
},
"threshold_credits": {
"type": "integer",
"minimum": 0
},
"amount_cents": {
"type": "integer",
"exclusiveMinimum": 0
},
"monthly_cap_cents": {
"type": "integer",
"exclusiveMinimum": 0
}
}
}
}
}200 response (application/json)
200 response fields and schemaShowHide
Fields
| Name | Type |
|---|---|
| enabledrequired | boolean |
| threshold_creditsrequired | integer |
| amount_centsrequired | integer |
| monthly_cap_centsrequired | integer |
| disabled_reasonrequired | string or null |
| this_month_centsrequired | integer |
{
"$ref": "#/$defs/AutoReloadResponse",
"$defs": {
"AutoReloadResponse": {
"type": "object",
"required": [
"enabled",
"threshold_credits",
"amount_cents",
"monthly_cap_cents",
"disabled_reason",
"this_month_cents"
],
"properties": {
"enabled": {
"type": "boolean"
},
"threshold_credits": {
"type": "integer"
},
"amount_cents": {
"type": "integer"
},
"monthly_cap_cents": {
"type": "integer"
},
"disabled_reason": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"this_month_cents": {
"type": "integer"
}
}
}
}
}Illustrative response shape. Values are placeholders, not a recorded result.
{
"enabled": false,
"threshold_credits": 0,
"amount_cents": 0,
"monthly_cap_cents": 0,
"disabled_reason": "<value>",
"this_month_cents": 0
}Returns 200 or 422.
GET /v1/billing/loads
List loads
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/billing/loadsParameters
| Name | Type | Default | Description |
|---|---|---|---|
| limitquery, optional | integer | 20 | minimum: 1; maximum: 100 |
200 response (application/json)
200 response fields and schemaShowHide
{
"type": "array",
"items": {
"$ref": "#/$defs/LoadResponse"
},
"$defs": {
"PaidWithResponse": {
"type": "object",
"properties": {
"brand": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"last4": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
},
"LoadResponse": {
"type": "object",
"required": [
"id",
"kind",
"amount_cents",
"credits",
"status",
"provider_ref",
"error",
"created_at",
"settled_at"
],
"properties": {
"id": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"load",
"auto"
]
},
"amount_cents": {
"type": "integer"
},
"credits": {
"type": "integer"
},
"status": {
"type": "string",
"enum": [
"pending",
"charged",
"credited",
"failed"
]
},
"provider_ref": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"created_at": {
"type": "string"
},
"settled_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"receipt_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"paid_with": {
"anyOf": [
{
"$ref": "#/$defs/PaidWithResponse"
},
{
"type": "null"
}
]
}
}
}
}
}Illustrative response shape. Values are placeholders, not a recorded result.
[
{
"id": "<value>",
"kind": "load",
"amount_cents": 0,
"credits": 0,
"status": "pending",
"provider_ref": "<value>",
"error": "<value>",
"created_at": "<value>",
"settled_at": "<value>",
"receipt_url": "<value>",
"paid_with": {
"brand": "<value>",
"last4": "<value>"
}
}
]Returns 200 or 422.
POST /v1/billing/loads
Buy credits
Only an organization admin can use this.
curl -H "x-api-key: $PHI_KEY" -X POST https://api.dynophi.com/v1/billing/loads \
-H "content-type: application/json" \
-d '{
"amount_cents": "<amount_cents>"
}'Body
| Name | Type |
|---|---|
| amount_centsoptional | integer or null |
| packoptional | string or null |
| return_urloptional | string or null |
Complete request schemaShowHide
Fields
| Name | Type |
|---|---|
| amount_centsoptional | integer or null |
| packoptional | string or null |
| return_urloptional | string or null |
{
"$ref": "#/$defs/LoadRequest",
"$defs": {
"LoadRequest": {
"type": "object",
"properties": {
"amount_cents": {
"anyOf": [
{
"type": "integer",
"exclusiveMinimum": 0
},
{
"type": "null"
}
]
},
"pack": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"return_url": {
"anyOf": [
{
"type": "string",
"maxLength": 300
},
{
"type": "null"
}
]
}
}
}
}
}201 response (application/json)
201 response fields and schemaShowHide
Fields
| Name | Type |
|---|---|
| urlrequired | string |
| loadrequired | object |
{
"$ref": "#/$defs/LoadStartResponse",
"$defs": {
"PaidWithResponse": {
"type": "object",
"properties": {
"brand": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"last4": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
},
"LoadResponse": {
"type": "object",
"required": [
"id",
"kind",
"amount_cents",
"credits",
"status",
"provider_ref",
"error",
"created_at",
"settled_at"
],
"properties": {
"id": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"load",
"auto"
]
},
"amount_cents": {
"type": "integer"
},
"credits": {
"type": "integer"
},
"status": {
"type": "string",
"enum": [
"pending",
"charged",
"credited",
"failed"
]
},
"provider_ref": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"created_at": {
"type": "string"
},
"settled_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"receipt_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"paid_with": {
"anyOf": [
{
"$ref": "#/$defs/PaidWithResponse"
},
{
"type": "null"
}
]
}
}
},
"LoadStartResponse": {
"type": "object",
"required": [
"url",
"load"
],
"properties": {
"url": {
"type": "string"
},
"load": {
"$ref": "#/$defs/LoadResponse"
}
}
}
}
}Illustrative response shape. Values are placeholders, not a recorded result.
{
"url": "<value>",
"load": {
"id": "<value>",
"kind": "load",
"amount_cents": 0,
"credits": 0,
"status": "pending",
"provider_ref": "<value>",
"error": "<value>",
"created_at": "<value>",
"settled_at": "<value>",
"receipt_url": "<value>",
"paid_with": {
"brand": "<value>",
"last4": "<value>"
}
}
}Returns 201 or 422.
POST /v1/billing/portal
Manage payment methods
Only an organization admin can use this.
curl -H "x-api-key: $PHI_KEY" -X POST https://api.dynophi.com/v1/billing/portal \
-H "content-type: application/json" \
-d '{}'Body
| Name | Type |
|---|---|
| return_urloptional | string or null |
Complete request schemaShowHide
Fields
| Name | Type |
|---|---|
| return_urloptional | string or null |
{
"anyOf": [
{
"$ref": "#/$defs/PortalRequest"
},
{
"type": "null"
}
],
"$defs": {
"PortalRequest": {
"type": "object",
"properties": {
"return_url": {
"anyOf": [
{
"type": "string",
"maxLength": 300
},
{
"type": "null"
}
]
}
}
}
}
}200 response (application/json)
200 response fields and schemaShowHide
Fields
| Name | Type |
|---|---|
| urlrequired | string |
{
"$ref": "#/$defs/PortalResponse",
"$defs": {
"PortalResponse": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string"
}
}
}
}
}Illustrative response shape. Values are placeholders, not a recorded result.
{
"url": "<value>"
}Returns 200 or 422.
PUT /v1/billing/spend-limit
Set the monthly spend limit
Only an organization admin can use this.
curl -H "x-api-key: $PHI_KEY" -X PUT https://api.dynophi.com/v1/billing/spend-limit \
-H "content-type: application/json" \
-d '{}'Body
| Name | Type |
|---|---|
| monthly_creditsoptional | integer or null |
| notify_percentoptional | integer or null |
Complete request schemaShowHide
Fields
| Name | Type |
|---|---|
| monthly_creditsoptional | integer or null |
| notify_percentoptional | integer or null |
{
"$ref": "#/$defs/SpendLimitRequest",
"$defs": {
"SpendLimitRequest": {
"type": "object",
"properties": {
"monthly_credits": {
"anyOf": [
{
"type": "integer",
"exclusiveMinimum": 0
},
{
"type": "null"
}
]
},
"notify_percent": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 100
},
{
"type": "null"
}
]
}
}
}
}
}200 response (application/json)
200 response fields and schemaShowHide
Fields
| Name | Type |
|---|---|
| monthly_creditsrequired | integer or null |
| notify_percentrequired | integer or null |
| used_this_monthrequired | integer |
{
"$ref": "#/$defs/SpendLimitResponse",
"$defs": {
"SpendLimitResponse": {
"type": "object",
"required": [
"monthly_credits",
"notify_percent",
"used_this_month"
],
"properties": {
"monthly_credits": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"notify_percent": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"used_this_month": {
"type": "integer"
}
}
}
}
}Illustrative response shape. Values are placeholders, not a recorded result.
{
"monthly_credits": 0,
"notify_percent": 0,
"used_this_month": 0
}Returns 200 or 422.
From phi-api 0.2.2, 2026-11-23.