OmniStream Docs
  • Panduan Pengguna
  • Developer
  • API Reference
Information
Auth
    Login with email and passwordpostGet current agent profilegetLogout (clears cookie)postIssue a fresh JWT for the current sessiongetRegister a new tenant organizationpost
Conversations
    List conversationsgetGet a single conversationgetAssign or unassign an agentpatchUpdate conversation statuspatchMark conversation as readpostExpire stale conversationspostUpdate conversation tagspatchTakeover a conversationpostBulk conversation actionspost
Messages
    List messages in a conversationgetSend an outbound messagepostSearch messages across conversationsget
Contacts
    List contactsgetGet a contact by IDgetUpdate a contactpatchList conversations for a contactget
Agents
    List all agentsgetCreate a new agentpostGet an agent by IDgetDelete an agentdeleteUpdate an agentpatchToggle agent online/offline statuspatch
Notes
    List notes for a conversationgetCreate a notepostDelete a notedeleteUpdate a notepatch
Quick Replies
    List all quick repliesgetCreate a quick replypostDelete a quick replydeleteUpdate a quick replypatchExport quick replies as CSVgetImport quick replies from CSVpostRecord usage of a quick replypostAdd quick reply to favoritespostRemove quick reply from favoritesdelete
Analytics
    Dashboard overview KPIsgetConversation and message trendsgetPer-agent workload metricsgetPer-channel metricsgetCSAT analyticsgetWhatsApp message analyticsgetWhatsApp conversation analyticsgetWhatsApp template analyticsget
Media
    Upload a media filepostDownload or proxy a media filegetUpload a file to S3/MinIOpost
Divisions
    List divisionsgetCreate a divisionpostGet a division with agentsgetDelete a divisiondeleteUpdate a divisionpatchList agents in a divisiongetAssign agents to a divisionpostRemove agents from a divisiondelete
Transfers
    Transfer a conversationpostList transfer history for a conversationget
Scheduled Messages
    Schedule a message for future deliverypostList scheduled messages for a conversationgetCancel a scheduled messagedelete
CSAT
    Get CSAT survey for a conversationgetCreate a CSAT survey for a conversationpostSubmit a CSAT ratingpatchCSAT analyticsget
SLA
    List SLA policiesgetCreate an SLA policypostDelete an SLA policydeleteUpdate an SLA policypatchList SLA breaches for a policygetGet SLA status for a conversationget
Outgoing Webhooks
    List outgoing webhooksgetCreate an outgoing webhookpostList available webhook event typesgetDelete an outgoing webhookdeleteUpdate an outgoing webhookpatchList deliveries for a webhookgetSend a test event to the webhookpost
Campaigns
    List campaignsgetCreate a new campaign (draft)postGet a campaigngetDelete a draft campaigndeleteUpdate a draft campaignpatchList campaign recipientsgetAdd recipients to a campaignpostClear all recipients from a campaigndeleteSend or schedule a campaignpostCancel a campaignpost
Integrations
    List all channel integrationsgetGet a single integration by channelgetCreate or update an integration (upsert)putDelete an integrationdeleteList integration accountsgetCreate an integration accountpostGet an integration account by IDgetDelete an integration accountdeleteUpdate an integration accountpatchSet an integration account as the default for its channelpostFetch WhatsApp account health from Meta Graph APIgetGet WhatsApp Embedded Signup configgetComplete WhatsApp Embedded SignuppostGet Instagram OAuth app configgetConnect Instagram account via OAuthpostGet Messenger OAuth app configgetConnect Messenger via Facebook Login OAuthpostSubscribe selected Facebook Pages to Messenger webhookspostDisconnect a Messenger pagepostGet Messenger persistent menugetSet or delete Messenger persistent menupost
Activity Logs
    List activity logsget
WA Templates
    List WhatsApp message templatesgetCreate a WhatsApp message templatepostSync templates from MetapostGet a WhatsApp template by IDgetDelete a WhatsApp template (local only)deleteUpdate template header media URLpatch
Webhooks
    Meta webhook verificationgetReceive Meta webhook (WhatsApp + Instagram)postReceive inbound email webhookpostMeta webhook verification for MessengergetReceive Messenger inbound webhook eventspostMeta webhook verification for InstagramgetReceive Instagram inbound webhook eventspost
Roles
    List all roles with permissionsgetCreate a custom rolepostGet a single role with permissionsgetDelete a custom roledeleteUpdate a rolepatchList all available permissionsget
API Keys
    List caller's API keysgetCreate a new API keypostRevoke an API keydelete
Health
    API Gateway health checkget
Automation
    List automation rulesgetCreate an automation rulepostList snoozed automation rulesgetSnooze multiple automation rulespostAutomation stats overviewgetAutomation stats time seriesgetAutomation alert statsgetDry-run an automation rule against a test payloadpostGet an automation rule by IDgetDelete an automation ruledeleteUpdate an automation rulepatchToggle automation rule active statepostSnooze an automation rule until a given timepostUnsnooze an automation rulepostGet stats for a specific automation rulegetGet time series stats for a specific automation rulegetGet the effective state of an automation rulegetUpdate alert settings for an automation rulepatchUpdate schedule settings for an automation rulepatchUpdate rollout percentage for an automation rulepatchPreview upcoming schedule windows for an automation rulegetGet global automation control stategetUpdate global automation control statepatchList automation rule runsgetExport automation runs as CSVgetList automation runs for a specific rulegetList automation runs for a specific eventgetGet a single automation run by IDgetGet replay context for an automation rungetList automation event queue itemsgetAutomation event queue statsgetExport automation events as CSVgetRetry all failed automation eventspostClean up old failed automation eventspostList automation events for a conversationgetList automation events for a rulegetList automation events by payload fingerprintgetGet a single automation event by IDgetRetry a single automation eventpostReprocess an automation event with the current rule setpostGet automation worker metricsget
Chat Expiration
    List chat expiration rulesgetUpsert a chat expiration rule for a channelput
AI Agents
    List all AI agentsgetCreate a new AI agentpostGet an AI agent by IDgetUpdate an AI agentputDelete an AI agentdeleteToggle AI agent active stateputList AI agent assignmentsgetCreate an AI agent assignmentpostUpdate an AI agent assignmentputDelete an AI agent assignmentdeleteList handoff rules for an AI agentgetCreate a handoff rulepostUpdate a handoff ruleputDelete a handoff ruledeleteGet daily usage stats for an AI agentgetList knowledge sources for an AI agentgetAdd a knowledge sourcepostDelete a knowledge sourcedeleteReprocess a knowledge sourcepostList QnA pairs for a knowledge sourcegetAdd a QnA pairpostDelete a QnA pairdeleteList products for an AI agentgetCreate a productpostBulk import productspostUpdate a productputDelete a productdeleteList orchestration rulesgetCreate an orchestration rulepostUpdate an orchestration ruleputDelete an orchestration ruledeleteList evaluations for an AI agentgetCreate an AI response evaluationpostUpdate an AI evaluationputDelete an AI evaluationdeleteGet aggregated AI usage summarygetSend a test message to an AI agentpost
Working Hours
    List global working hoursgetUpsert global working hoursputList division working hoursgetUpsert division working hours overrideputDelete division working hours overridedeleteGet tenant timezonegetUpdate tenant timezoneputCheck working hours status (public)get
Super Admin
    Super-admin loginpostList all tenant organizationsgetProvision a new tenantpostGet a tenant organizationgetSuspend a tenant organizationdeleteUpdate a tenant organizationpatchImpersonate a tenant adminpostList all tenants with usage statisticsgetSystem health checkgetList super-admin accountsgetCreate a super-admin accountpostDelete a super-admin accountdeleteReset a super-admin's passwordpostList tenant usersgetReset a tenant user's passwordpostSuspend a tenant userpostActivate a tenant userpostImpersonate a tenant userpost
Billing Admin
    List all billing plansgetCreate a billing planpostGet a billing plan by IDgetDelete a billing plandeleteUpdate a billing planpatchList all couponsgetCreate a couponpostDelete a coupondeleteUpdate a couponpatchList all add-onsgetCreate an add-onpostDelete an add-ondeleteUpdate an add-onpatchCombined analytics dashboardgetMonthly recurring revenue summarygetRevenue breakdown by plangetMonthly revenue over time (last 12 months)getChurn metrics for current monthgetRefund an invoicepost
Billing
    Get current subscription and plangetList available billing plansgetSubscribe to a planpostUpgrade or downgrade subscription planpostCancel subscriptionpostGet current month's usagegetList invoicesgetDownload invoice PDFgetList payment methodsgetAdd a payment methodpostDelete a payment methoddeleteValidate a coupon codepostList available add-onsgetList attached add-onsgetAttach an add-on to subscriptionpostDetach an add-on from subscriptiondelete
Schemas
OmniStream CRM API
OmniStream CRM API

Billing

Endpoint

Tenant subscription, usage, invoices, and payment method management


Get current subscription and plan

GET
https://api-chat.bara.my.id
/api/billing/plan

Retrieve the current subscription with plan details for the tenant.

Get current subscription and plan › Responses

Current plan with subscription details

Current subscription with embedded plan details
id
​string · uuid · required
org_id
​string · uuid · required
plan_id
​string · uuid · required
status
​string · enum · required
Enum values:
trial
active
past_due
cancelled
suspended
billing_period
​string · enum · required
Enum values:
monthly
annual
cancel_at_period_end
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
plan_name
​string · required
limits
​object · required
features
​object · required
trial_ends_at
​string · date-time
current_period_start
​string · date-time
current_period_end
​string · date-time
payment_gateway
​string
gateway_customer_id
​string
gateway_subscription_id
​string
GET/api/billing/plan
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/plan
shell
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "org_id": "00000000-0000-0000-0000-000000000000", "plan_id": "00000000-0000-0000-0000-000000000000", "status": "trial", "billing_period": "monthly", "trial_ends_at": "2024-08-25T15:00:00Z", "current_period_start": "2024-08-25T15:00:00Z", "current_period_end": "2024-08-25T15:00:00Z", "payment_gateway": "payment_gateway", "gateway_customer_id": "gateway_customer_id", "gateway_subscription_id": "gateway_subscription_id", "cancel_at_period_end": true, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z", "plan_name": "plan_name", "limits": {}, "features": {} }
json
application/json

List available billing plans

GET
https://api-chat.bara.my.id
/api/billing/plans

List all active billing plans available for subscription.

List available billing plans › Responses

200

Array of active billing plans

​object[]
id
​string · uuid · required
name
​string · required
slug
​string · required
currency
​string · required
base_price_monthly
​integer · int64 · required
base_price_annual
​integer · int64 · required
per_agent_price
​integer · int64 · required
overage_message_price
​integer · int64 · required
limits
​object · required

Plan resource limits (max_agents, max_contacts, max_messages_month, max_channels, max_ai_agents)

features
​object · required

Feature flags (ai_agent, api_access, dedicated_support)

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
GET/api/billing/plans
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/plans
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "currency": "IDR", "base_price_monthly": 0, "base_price_annual": 0, "per_agent_price": 0, "overage_message_price": 0, "limits": {}, "features": {}, "is_active": true, "sort_order": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Subscribe to a plan

POST
https://api-chat.bara.my.id
/api/billing/subscribe

Create a new subscription with a 14-day trial. If plan_id is omitted, the cheapest active plan is used. Rejects if already subscribed.

Subscribe to a plan › Request Body

plan_id
​string · uuid

Plan to subscribe to (optional, defaults to cheapest)

Subscribe to a plan › Responses

Created subscription

id
​string · uuid · required
org_id
​string · uuid · required
plan_id
​string · uuid · required
status
​string · enum · required
Enum values:
trial
active
past_due
cancelled
suspended
billing_period
​string · enum · required
Enum values:
monthly
annual
cancel_at_period_end
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
trial_ends_at
​string · date-time
current_period_start
​string · date-time
current_period_end
​string · date-time
payment_gateway
​string
gateway_customer_id
​string
gateway_subscription_id
​string
POST/api/billing/subscribe
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/subscribe \ --header 'Content-Type: application/json' \ --data ' { "plan_id": "00000000-0000-0000-0000-000000000000" } '
shell
Example Request Body
{ "plan_id": "00000000-0000-0000-0000-000000000000" }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "org_id": "00000000-0000-0000-0000-000000000000", "plan_id": "00000000-0000-0000-0000-000000000000", "status": "trial", "billing_period": "monthly", "trial_ends_at": "2024-08-25T15:00:00Z", "current_period_start": "2024-08-25T15:00:00Z", "current_period_end": "2024-08-25T15:00:00Z", "payment_gateway": "payment_gateway", "gateway_customer_id": "gateway_customer_id", "gateway_subscription_id": "gateway_subscription_id", "cancel_at_period_end": true, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Upgrade or downgrade subscription plan

POST
https://api-chat.bara.my.id
/api/billing/upgrade

Changes the subscription plan with mid-cycle proration. Creates a prorated invoice for the net price difference with 11% PPN tax for IDR.

Upgrade or downgrade subscription plan › Request Body

plan_id
​string · uuid · required
period
​string · enum

Optional billing period override. If omitted, keeps the current billing period.

Enum values:
monthly
annual

Upgrade or downgrade subscription plan › Responses

Upgraded subscription with optional prorated invoice

​object
​object
POST/api/billing/upgrade
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/upgrade \ --header 'Content-Type: application/json' \ --data ' { "plan_id": "00000000-0000-0000-0000-000000000000", "period": "monthly" } '
shell
Example Request Body
{ "plan_id": "00000000-0000-0000-0000-000000000000", "period": "monthly" }
json
Example Responses
{ "subscription": { "id": "00000000-0000-0000-0000-000000000000", "org_id": "00000000-0000-0000-0000-000000000000", "plan_id": "00000000-0000-0000-0000-000000000000", "status": "trial", "billing_period": "monthly", "trial_ends_at": "2024-08-25T15:00:00Z", "current_period_start": "2024-08-25T15:00:00Z", "current_period_end": "2024-08-25T15:00:00Z", "payment_gateway": "payment_gateway", "gateway_customer_id": "gateway_customer_id", "gateway_subscription_id": "gateway_subscription_id", "cancel_at_period_end": true, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }, "prorated_invoice": { "id": "00000000-0000-0000-0000-000000000000", "org_id": "00000000-0000-0000-0000-000000000000", "subscription_id": "00000000-0000-0000-0000-000000000000", "invoice_number": "INV-202605-0001", "currency": "currency", "subtotal": 0, "tax": 0, "total": 0, "status": "open", "line_items": [ { "description": "description", "quantity": 0, "unit_price": 0, "amount": 0 } ], "pdf_url": "pdf_url", "gateway_invoice_id": "gateway_invoice_id", "payment_url": "payment_url", "retry_count": 0, "last_retry_at": "2024-08-25T15:00:00Z", "paid_at": "2024-08-25T15:00:00Z", "due_date": "2024-08-25", "created_at": "2024-08-25T15:00:00Z" } }
json
application/json

Cancel subscription

POST
https://api-chat.bara.my.id
/api/billing/cancel

Mark subscription for cancellation at end of current billing period.

Cancel subscription › Responses

Updated subscription with cancel_at_period_end=true

id
​string · uuid · required
org_id
​string · uuid · required
plan_id
​string · uuid · required
status
​string · enum · required
Enum values:
trial
active
past_due
cancelled
suspended
billing_period
​string · enum · required
Enum values:
monthly
annual
cancel_at_period_end
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
trial_ends_at
​string · date-time
current_period_start
​string · date-time
current_period_end
​string · date-time
payment_gateway
​string
gateway_customer_id
​string
gateway_subscription_id
​string
POST/api/billing/cancel
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/cancel
shell
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "org_id": "00000000-0000-0000-0000-000000000000", "plan_id": "00000000-0000-0000-0000-000000000000", "status": "trial", "billing_period": "monthly", "trial_ends_at": "2024-08-25T15:00:00Z", "current_period_start": "2024-08-25T15:00:00Z", "current_period_end": "2024-08-25T15:00:00Z", "payment_gateway": "payment_gateway", "gateway_customer_id": "gateway_customer_id", "gateway_subscription_id": "gateway_subscription_id", "cancel_at_period_end": true, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Get current month's usage

GET
https://api-chat.bara.my.id
/api/billing/usage

Retrieve usage metrics and plan limits for the current billing period.

Get current month's usage › Responses

Usage metrics with plan limits

org_id
​string · uuid · required
agent_count
​integer · required
contact_count
​integer · required
messages_this_month
​integer · int64 · required
active_integrations
​integer · required
usage_month
​string · date · required
limits
​object · required

Plan limits for comparison

GET/api/billing/usage
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/usage
shell
Example Responses
{ "org_id": "00000000-0000-0000-0000-000000000000", "agent_count": 0, "contact_count": 0, "messages_this_month": 0, "active_integrations": 0, "usage_month": "2024-08-25", "limits": {} }
json
application/json

List invoices

GET
https://api-chat.bara.my.id
/api/billing/invoices

List invoices › Responses

200

Array of invoices

​object[]
id
​string · uuid · required
org_id
​string · uuid · required
invoice_number
​string · required
currency
​string · required
subtotal
​integer · int64 · required
tax
​integer · int64 · required
total
​integer · int64 · required
status
​string · enum · required
Enum values:
open
paid
past_due
void
refunded
partially_refunded
​object[] · required
retry_count
​integer · required
created_at
​string · date-time · required
subscription_id
​string · uuid
pdf_url
​string
gateway_invoice_id
​string
payment_url
​string
last_retry_at
​string · date-time
paid_at
​string · date-time
due_date
​string · date
GET/api/billing/invoices
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/invoices
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "org_id": "00000000-0000-0000-0000-000000000000", "subscription_id": "00000000-0000-0000-0000-000000000000", "invoice_number": "INV-202605-0001", "currency": "currency", "subtotal": 0, "tax": 0, "total": 0, "status": "open", "line_items": [ { "description": "description", "quantity": 0, "unit_price": 0, "amount": 0 } ], "pdf_url": "pdf_url", "gateway_invoice_id": "gateway_invoice_id", "payment_url": "payment_url", "retry_count": 0, "last_retry_at": "2024-08-25T15:00:00Z", "paid_at": "2024-08-25T15:00:00Z", "due_date": "2024-08-25", "created_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Download invoice PDF

GET
https://api-chat.bara.my.id
/api/billing/invoices/{id}/pdf

Redirects to the PDF URL. Generates PDF on-the-fly if not cached.

Download invoice PDF › path Parameters

id
​string · uuid · required

Download invoice PDF › Responses

Redirect to PDF URL

No data returned
GET/api/billing/invoices/{id}/pdf
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/invoices/:id/pdf
shell
Example Responses
No example specified for this content type

List payment methods

GET
https://api-chat.bara.my.id
/api/billing/payment-methods

List payment methods › Responses

200

Array of payment methods

​object[]
id
​string · uuid · required
org_id
​string · uuid · required
gateway
​string · required
gateway_payment_method_id
​string · required
type
​string · required

Payment method type (e.g. credit_card, e_wallet, virtual_account, bank_transfer)

label
​string · required
is_default
​boolean · required
created_at
​string · date-time · required
GET/api/billing/payment-methods
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/payment-methods
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "org_id": "00000000-0000-0000-0000-000000000000", "gateway": "xendit", "gateway_payment_method_id": "gateway_payment_method_id", "type": "type", "label": "BCA VA ****1234", "is_default": true, "created_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Add a payment method

POST
https://api-chat.bara.my.id
/api/billing/payment-methods

If is_default is true, existing methods are unset as default first.

Add a payment method › Request Body

gateway
​string · required
gateway_payment_method_id
​string · required
type
​string · required

Payment method type (e.g. credit_card, e_wallet, virtual_account)

label
​string · required
is_default
​boolean

Add a payment method › Responses

200

Created payment method

id
​string · uuid · required
org_id
​string · uuid · required
gateway
​string · required
gateway_payment_method_id
​string · required
type
​string · required

Payment method type (e.g. credit_card, e_wallet, virtual_account, bank_transfer)

label
​string · required
is_default
​boolean · required
created_at
​string · date-time · required
POST/api/billing/payment-methods
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/payment-methods \ --header 'Content-Type: application/json' \ --data ' { "gateway": "gateway", "gateway_payment_method_id": "gateway_payment_method_id", "type": "type", "label": "label", "is_default": true } '
shell
Example Request Body
{ "gateway": "gateway", "gateway_payment_method_id": "gateway_payment_method_id", "type": "type", "label": "label", "is_default": true }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "org_id": "00000000-0000-0000-0000-000000000000", "gateway": "xendit", "gateway_payment_method_id": "gateway_payment_method_id", "type": "type", "label": "BCA VA ****1234", "is_default": true, "created_at": "2024-08-25T15:00:00Z" }
json
application/json

Delete a payment method

DELETE
https://api-chat.bara.my.id
/api/billing/payment-methods/{id}

Delete a payment method › path Parameters

id
​string · uuid · required

Delete a payment method › Responses

Deletion confirmation

deleted
​boolean
DELETE/api/billing/payment-methods/{id}
curl --request DELETE \ --url https://api-chat.bara.my.id/api/billing/payment-methods/:id
shell
Example Responses
{ "deleted": true }
json
application/json

Validate a coupon code

POST
https://api-chat.bara.my.id
/api/billing/validate-coupon

Validate a coupon code › Request Body

code
​string · required
plan_id
​string · uuid

Validate a coupon code › Responses

200

Coupon validation result

valid
​boolean
​object
reason
​string
POST/api/billing/validate-coupon
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/validate-coupon \ --header 'Content-Type: application/json' \ --data ' { "code": "code", "plan_id": "00000000-0000-0000-0000-000000000000" } '
shell
Example Request Body
{ "code": "code", "plan_id": "00000000-0000-0000-0000-000000000000" }
json
Example Responses
{ "valid": true, "coupon": { "id": "00000000-0000-0000-0000-000000000000", "code": "code", "discount_type": "percentage", "discount_value": 0, "currency": "currency", "max_uses": 0, "current_uses": 0, "valid_from": "2024-08-25T15:00:00Z", "valid_until": "2024-08-25T15:00:00Z", "applicable_plans": [ "00000000-0000-0000-0000-000000000000" ], "is_active": true, "created_at": "2024-08-25T15:00:00Z" }, "reason": "reason" }
json
application/json

List available add-ons

GET
https://api-chat.bara.my.id
/api/billing/addons

List available add-ons › Responses

200

Array of available add-ons

​object[]
id
​string · uuid · required
name
​string · required
slug
​string · required
price_monthly
​integer · int64 · required
price_annual
​integer · int64 · required
unit
​string · required

Pricing unit (e.g. flat, per agent)

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
description
​string
GET/api/billing/addons
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/addons
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "description": "description", "price_monthly": 0, "price_annual": 0, "unit": "unit", "is_active": true, "sort_order": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ]
json
application/json

List attached add-ons

GET
https://api-chat.bara.my.id
/api/billing/my-addons

Returns add-ons currently attached to the tenant's subscription.

List attached add-ons › Responses

200

Array of attached add-ons with details

​object[]
id
​string · uuid · required
addon_id
​string · uuid · required
name
​string · required
slug
​string · required
price_monthly
​integer · int64 · required
quantity
​integer · required
created_at
​string · date-time · required
GET/api/billing/my-addons
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/my-addons
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "addon_id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "price_monthly": 0, "quantity": 0, "created_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Attach an add-on to subscription

POST
https://api-chat.bara.my.id
/api/billing/addons/attach

Attach an add-on to subscription › Request Body

addon_id
​string · uuid · required
quantity
​integer
Default: 1

Attach an add-on to subscription › Responses

200

Attached subscription add-on

id
​string · uuid · required
subscription_id
​string · uuid · required
addon_id
​string · uuid · required
quantity
​integer · required
created_at
​string · date-time · required
POST/api/billing/addons/attach
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/addons/attach \ --header 'Content-Type: application/json' \ --data ' { "addon_id": "00000000-0000-0000-0000-000000000000", "quantity": 1 } '
shell
Example Request Body
{ "addon_id": "00000000-0000-0000-0000-000000000000", "quantity": 1 }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "subscription_id": "00000000-0000-0000-0000-000000000000", "addon_id": "00000000-0000-0000-0000-000000000000", "quantity": 0, "created_at": "2024-08-25T15:00:00Z" }
json
application/json

Detach an add-on from subscription

DELETE
https://api-chat.bara.my.id
/api/billing/addons/detach/{addon_id}

Detach an add-on from subscription › path Parameters

addon_id
​string · uuid · required

Detach an add-on from subscription › Responses

Detached confirmation

No data returned
DELETE/api/billing/addons/detach/{addon_id}
curl --request DELETE \ --url https://api-chat.bara.my.id/api/billing/addons/detach/:addon_id
shell
Example Responses
No example specified for this content type

Billing Admin