{"openapi":"3.1.0","info":{"title":"Stream App","description":"Stream App API Documentation","version":"2"},"servers":[{"url":"https://stream-app-service.streampay.sa"}],"paths":{"/api/v2/me":{"get":{"tags":["User"],"summary":"Get User And Organization Info","description":"Retrieve information about the authenticated user and their organization.\n\nIt requires a valid authentication token and can be used to verify API\nconnectivity and retrieve user context. This endpoint returns details about the currently\nauthenticated user and their associated organization.","operationId":"get_user_and_organization_info_api_v2_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}},"security":[{"JWTBearer":[]},{"APIKey":[]}]}},"/api/v2/organization/invite":{"post":{"tags":["Organization"],"summary":"Create Invite For A User To Join The Organization By Email","description":"Send an email invitation for a user to join the organization.\n\nAn invitation email will be sent to the specified address with a link to accept the invitation.\nThe caller can invite to the whole organization only as an organization admin, and to a\nbranch only where they hold ``members:write``.","operationId":"Create_invite_for_a_user_to_join_the_organization_by_email_api_v2_organization_invite_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"language","in":"header","required":false,"schema":{"$ref":"#/components/schemas/Language","default":"AR"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationInviteCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationInviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/branch":{"get":{"tags":["Branches"],"summary":"Get All Branches","description":"List the branches where the caller holds ``branches:read``.\n\nAn organization-wide holder sees every branch. A branch-scoped holder sees those branches.","operationId":"Get_All_Branches_api_v2_branch_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchListResponse"}}}}},"security":[{"JWTBearer":[]},{"APIKey":[]}]},"post":{"tags":["Branches"],"summary":"Create Branch","description":"Create a new branch for the organization.\n\nIf a branch with the same name already exists, returns the existing branch.","operationId":"Create_Branch_api_v2_branch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBranchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"JWTBearer":[]},{"APIKey":[]}]}},"/api/v2/branch/{branch_id}":{"put":{"tags":["Branches"],"summary":"Update Branch","description":"Update branch information.\n\nIf a branch with the same name already exists, returns an error.","operationId":"Update_Branch_api_v2_branch__branch_id__put","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the branch to update","title":"Branch Id"},"description":"Unique identifier (UUID) of the branch to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBranchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Branches"],"summary":"Get Branch By Id","description":"Retrieve detailed information about a specific branch by its ID.","operationId":"Get_Branch_By_Id_api_v2_branch__branch_id__get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the branch to retrieve","title":"Branch Id"},"description":"Unique identifier (UUID) of the branch to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Branches"],"summary":"Delete Branch","description":"Delete a branch from the organization.","operationId":"Delete_Branch_api_v2_branch__branch_id__delete","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the branch to delete","title":"Branch Id"},"description":"Unique identifier (UUID) of the branch to delete"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/consumers":{"post":{"tags":["Consumers"],"summary":"Create Consumer","description":"Create a new consumer with contact information and payment details.","operationId":"Create_Consumer_api_v2_consumers_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumerCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Consumers"],"summary":"Get All Consumers","description":"List consumers with pagination, sorting, and optional filters.\n\n**Query filters** (all optional; combine as needed):\n- `search_term` — partial match on name, email, phone, alias, external_id,\n  associated entity name, or associated entity field values\n\n**External metadata filters** (optional, combine with other filters):\n- Use any external metadata key you stored on create/update as a query parameter: `external_metadata.<key>=<value>`\n- Exact match, case-sensitive. Multiple keys are ANDed.\n- Example: if a consumer was created with `\"external_metadata\": {\"segment\": \"enterprise\", \"tier\": \"gold\"}`, filter with\n  `?external_metadata.segment=enterprise&external_metadata.tier=gold`\n\n**Pagination**: `page` (default 1), `limit` (default 10, max 100)\n\n**Sorting**: `sort_field` (`name`, `created_at`, `email`, `phone_number`, `external_id`; default `created_at`),\n`sort_direction` (`asc` or `desc`; default `desc`)\n\n**Example**: `/api/v2/consumers?search_term=Acme&external_metadata.segment=enterprise&page=1&limit=20`","operationId":"Get_All_Consumers_api_v2_consumers_get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Page number, defaults to 1.","default":1},"description":"Page number, defaults to 1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Size of a page, defaults to 10. Maximum is 100.","default":10},"description":"Size of a page, defaults to 10. Maximum is 100."},{"name":"search_term","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Free-text search (case-insensitive, partial match). Matches product name and description. Omit to skip text search. Example: `?search_term=premium`."},"description":"Free-text search (case-insensitive, partial match). Matches product name and description. Omit to skip text search. Example: `?search_term=premium`."},{"name":"sort_field","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},{"name":"sort_direction","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Sorting direction ('asc' or 'desc')"},"description":"Sorting direction ('asc' or 'desc')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResource_ConsumerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/consumers/{consumer_id}":{"get":{"tags":["Consumers"],"summary":"Get Consumer","description":"Retrieve detailed information about a specific consumer by their ID.","operationId":"Get_Consumer_api_v2_consumers__consumer_id__get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the consumer","title":"Consumer Id"},"description":"Unique identifier (UUID) of the consumer"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseConsumerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Consumers"],"summary":"Update Consumer","description":"Update consumer information such as contact details or payment methods.","operationId":"Update_Consumer_api_v2_consumers__consumer_id__put","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the consumer to update","title":"Consumer Id"},"description":"Unique identifier (UUID) of the consumer to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumerUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseConsumerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Consumers"],"summary":"Delete Consumer","description":"Delete a consumer from the organization.","operationId":"Delete_Consumer_api_v2_consumers__consumer_id__delete","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the consumer to delete","title":"Consumer Id"},"description":"Unique identifier (UUID) of the consumer to delete"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/coupons":{"get":{"tags":["Coupons"],"summary":"List Coupons","description":"List all coupons with pagination, filtering, and sorting options.","operationId":"List_Coupons_api_v2_coupons_get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Page number, defaults to 1.","default":1},"description":"Page number, defaults to 1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Size of a page, defaults to 10. Maximum is 100.","default":10},"description":"Size of a page, defaults to 10. Maximum is 100."},{"name":"search_term","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Search by coupon name."},"description":"Search by coupon name."},{"name":"active","in":"query","required":false,"schema":{"type":"boolean","nullable":true,"description":"Filter by active or inactive coupons."},"description":"Filter by active or inactive coupons."},{"name":"is_percentage","in":"query","required":false,"schema":{"type":"boolean","nullable":true,"description":"Filter by percentage-based or fixed-amount coupons."},"description":"Filter by percentage-based or fixed-amount coupons."},{"name":"sort_field","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},{"name":"sort_direction","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Sorting direction ('asc' or 'desc')"},"description":"Sorting direction ('asc' or 'desc')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResource_CouponDetailed_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Coupons"],"summary":"Create Coupon","description":"Create a new coupon with discount details and active/inactive status.","operationId":"Create_Coupon_api_v2_coupons_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/coupons/{coupon_id}":{"put":{"tags":["Coupons"],"summary":"Update Coupon","description":"Update coupon details such as discount amount or active status.","operationId":"Update_Coupon_api_v2_coupons__coupon_id__put","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"coupon_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the coupon to update","title":"Coupon Id"},"description":"Unique identifier (UUID) of the coupon to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Coupons"],"summary":"Get Coupon","description":"Retrieve detailed information about a specific coupon including redemption history.","operationId":"Get_Coupon_api_v2_coupons__coupon_id__get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"coupon_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the coupon","title":"Coupon Id"},"description":"Unique identifier (UUID) of the coupon"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Coupons"],"summary":"Delete Coupon","description":"Delete a coupon from the organization.","operationId":"Delete_Coupon_api_v2_coupons__coupon_id__delete","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"coupon_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the coupon to delete","title":"Coupon Id"},"description":"Unique identifier (UUID) of the coupon to delete"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/invoices/{invoice_id}/inplace":{"patch":{"tags":["Invoices"],"summary":"Update Invoice In Place","description":"Partially update specific invoice fields in-place.\n\nThis endpoint allows updating only the fields specified in the request.\nUse for quick changes such as updating the description or scheduled date.","operationId":"Update_Invoice_In_Place_api_v2_invoices__invoice_id__inplace_patch","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceInPlaceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/invoices/{invoice_id}/cancel":{"post":{"tags":["Invoices"],"summary":"Cancel an invoice","description":"Cancels an invoice and marks it as `CANCELED`. Use this when the invoice should no longer be collected or shown as payable.","operationId":"Cancel_Invoice_api_v2_invoices__invoice_id__cancel_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/invoices/{invoice_id}":{"get":{"tags":["Invoices"],"summary":"Get Invoice","description":"Retrieve detailed information about a specific invoice by its ID.","operationId":"Get_Invoice_api_v2_invoices__invoice_id__get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the invoice","title":"Invoice Id"},"description":"Unique identifier (UUID) of the invoice"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/invoices":{"post":{"tags":["Invoices"],"summary":"Create Invoice","description":"Create a new invoice with items and payment details.\n\nImportant: For most use cases, use the Checkout/Payment Link API (`/v2/payment_links`) instead.\nIt generates a payment link that you can embed in your own web page or redirect to.\n\nUse Cases:\n- Create an invoice and manually mark it as paid for reference\n- Automated invoice generation","operationId":"Create_Invoice_api_v2_invoices_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Invoices"],"summary":"List Invoices","description":"List all invoices with pagination, filtering, and sorting options.","operationId":"List_Invoices_api_v2_invoices_get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"include_payments","in":"query","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"payment_link_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","nullable":true}},{"name":"statuses","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceStatusEnum"},"nullable":true}},{"name":"payment_statuses","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentStatusEnum"},"nullable":true,"description":"Invoice includes payments with the following statuses"},"description":"Invoice includes payments with the following statuses"},{"name":"search_term","in":"query","required":false,"schema":{"type":"string","nullable":true}},{"name":"from_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true}},{"name":"to_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true}},{"name":"due_date_from","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Invoice's payment due date from this date onwards"},"description":"Invoice's payment due date from this date onwards"},{"name":"due_date_to","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Invoice's payment due date to this date or older"},"description":"Invoice's payment due date to this date or older"},{"name":"from_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}]}},{"name":"to_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}]}},{"name":"organization_consumer_id","in":"query","required":false,"schema":{"type":"string","format":"uuid4","nullable":true}},{"name":"subscription_id","in":"query","required":false,"schema":{"type":"string","format":"uuid4","nullable":true}},{"name":"metered_subscription_id","in":"query","required":false,"schema":{"type":"string","format":"uuid4","nullable":true}},{"name":"currencies","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Filter by invoice currency codes (OR). E.g. currencies=SAR,USD"},"description":"Filter by invoice currency codes (OR). E.g. currencies=SAR,USD"},{"name":"payments_not_settled","in":"query","required":false,"schema":{"type":"boolean","nullable":true,"description":"When true, only include invoices with a SUCCEEDED card/wallet payment (e.g. MADA, Visa)."},"description":"When true, only include invoices with a SUCCEEDED card/wallet payment (e.g. MADA, Visa)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Page number, defaults to 1.","default":1},"description":"Page number, defaults to 1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Size of a page, defaults to 10. Maximum is 100.","default":10},"description":"Size of a page, defaults to 10. Maximum is 100."},{"name":"sort_field","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},{"name":"sort_direction","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Sorting direction ('asc' or 'desc')"},"description":"Sorting direction ('asc' or 'desc')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResource_InvoiceListItem_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/payments":{"get":{"tags":["Payments"],"summary":"List Payments","description":"List all payments with pagination, filtering, and sorting options.\n\nPayments can be filtered by invoice IDs, statuses, date ranges, or search terms.","operationId":"List_Payments_api_v2_payments_get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"invoice_id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true,"description":"Filter by invoice IDs. Default is None."},"description":"Filter by invoice IDs. Default is None."},{"name":"statuses","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentStatusEnum"},"nullable":true,"description":"Filter by payment statuses. Default is None."},"description":"Filter by payment statuses. Default is None."},{"name":"search_term","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Search term to filter payments. Default is None."},"description":"Search term to filter payments. Default is None."},{"name":"from_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Filter payments from this date. Default is None."},"description":"Filter payments from this date. Default is None."},{"name":"to_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Filter payments up to this date. Default is None."},"description":"Filter payments up to this date. Default is None."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Page number, defaults to 1.","default":1},"description":"Page number, defaults to 1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Size of a page, defaults to 10. Maximum is 100.","default":10},"description":"Size of a page, defaults to 10. Maximum is 100."},{"name":"sort_field","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},{"name":"sort_direction","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Sorting direction ('asc' or 'desc')"},"description":"Sorting direction ('asc' or 'desc')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResource_PaymentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/payments/{payment_id}/mark-paid":{"post":{"tags":["Payments"],"summary":"Mark Payment As Paid","description":"Manually mark a payment as paid (full or partial).\n\nRecord a payment received through manual methods (CASH, BANK_TRANSFER, CARD, or QURRAH).\n\n**Full:** omit ``amount`` or pass ``amount == payment.amount``.\n**Partial:** pass ``amount < payment.amount`` with remainder greater than 1 in the\npayment currency (not allowed while UNDER_REVIEW).\n  - Selected payment amount is reduced and marked SUCCEEDED.\n  - A new PENDING ``SPLIT_REMAINDER`` payment is created for the remainder.\n  - ``invoice.type`` is unchanged (ONE_OFF stays ONE_OFF).\n  - Invoice completes only when every payment is paid.","operationId":"Mark_Payment_as_Paid_api_v2_payments__payment_id__mark_paid_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the payment to mark as paid","title":"Payment Id"},"description":"Unique identifier (UUID) of the payment to mark as paid"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMarkPaidRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMarkPaidResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/payments/{payment_id}":{"get":{"tags":["Payments"],"summary":"Get Payment","description":"Retrieve detailed information about a specific payment by its ID.","operationId":"Get_Payment_api_v2_payments__payment_id__get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the payment","title":"Payment Id"},"description":"Unique identifier (UUID) of the payment"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/payments/{payment_id}/refund":{"post":{"tags":["Payments"],"summary":"Refund Payment","description":"Process a refund for a payment.\n\nRefunds settle the requested amount or the remaining refundable balance for the selected payment.\nIf that payment is part of a shared Moyasar charge, set\n``payment_is_part_of_related_set`` to true to distribute the refund across related payments in\ninvoice order.","operationId":"Refund_Payment_api_v2_payments__payment_id__refund_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the payment to refund","title":"Payment Id"},"description":"Unique identifier (UUID) of the payment to refund"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRefundRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentResponse"}}}},"400":{"description":"Multiple payments were paid in a single transaction. Set 'payment_is_part_of_related_set' to true to refund across them.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiplePaymentsInTransactionErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/payments/auto-charge-on-demand/{payment_id}":{"post":{"tags":["Payments"],"summary":"Auto Charge On Demand","description":"Charge a payment using the consumer's latest tokenized card.\n\nThis endpoint allows organizations to charge a payment using the consumer's latest\nactive tokenized card. The following conditions must be met:\n\n- The consumer must have at least one active tokenized card.\n- The payment must be in an unpaid status (PENDING, PROCESSING, FAILED, etc.).\n\n**This is a restricted API and is only available to some organizations.**","operationId":"Auto_Charge_On_Demand_api_v2_payments_auto_charge_on_demand__payment_id__post","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the payment to charge","title":"Payment Id"},"description":"Unique identifier (UUID) of the payment to charge"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoChargeOnDemandResponse"}}}},"400":{"description":"If no active card exists, payment is already paid, or payment processing fails."},"401":{"description":"If the organization does not have access to this API."},"404":{"description":"If payment, consumer, card, or consent is not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/products":{"get":{"tags":["Products"],"summary":"List Products","description":"List products with pagination, sorting, and optional filters.\n\n**Query filters** (all optional; combine as needed):\n- `search_term` — partial match on product name or description\n- `active` — `true` for active products only, `false` for inactive only\n- `type` — product type: `RECURRING`, `ONE_OFF`, or `METERED` (when enabled)\n- `currency` — only products with an active price in this ISO currency code (e.g. `SAR`)\n\n**External metadata filters** (optional, combine with other filters):\n- Use any external metadata key you stored on create/update as a query parameter: `external_metadata.<key>=<value>`\n- Exact match, case-sensitive. Multiple keys are ANDed.\n- Example: if a consumer was created with `\"external_metadata\": {\"segment\": \"enterprise\", \"tier\": \"gold\"}`, filter with\n  `?external_metadata.segment=enterprise&external_metadata.tier=gold`\n\n**Pagination**: `page` (default 1), `limit` (default 10, max 100)\n\n**Sorting**: `sort_field` (`price`, `name`, `created_at`; default `created_at`),\n`sort_direction` (`asc` or `desc`; default `desc`)\n\n**Example**: `/api/v2/products?active=true&type=RECURRING&external_metadata.category=saas&currency=SAR`","operationId":"List_Products_api_v2_products_get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Page number, defaults to 1.","default":1},"description":"Page number, defaults to 1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Size of a page, defaults to 10. Maximum is 100.","default":10},"description":"Size of a page, defaults to 10. Maximum is 100."},{"name":"search_term","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Free-text search (case-insensitive, partial match). Matches product name and description. Omit to skip text search. Example: `?search_term=premium`."},"description":"Free-text search (case-insensitive, partial match). Matches product name and description. Omit to skip text search. Example: `?search_term=premium`."},{"name":"active","in":"query","required":false,"schema":{"type":"boolean","nullable":true,"description":"Filter by product active status. `true` = active only, `false` = inactive only. Omit to return both. Example: `?active=true`."},"description":"Filter by product active status. `true` = active only, `false` = inactive only. Omit to return both. Example: `?active=true`."},{"name":"type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ProductType","nullable":true,"description":"Filter by product type. Allowed values: `RECURRING`, `ONE_OFF`, `METERED` (when enabled). Example: `?type=RECURRING`."},"description":"Filter by product type. Allowed values: `RECURRING`, `ONE_OFF`, `METERED` (when enabled). Example: `?type=RECURRING`."},{"name":"currency","in":"query","required":false,"schema":{"type":"string","minLength":3,"maxLength":3,"nullable":true,"description":"Return only products with an active price in this currency. 3-letter ISO 4217 code. Example: `?currency=SAR`."},"description":"Return only products with an active price in this currency. 3-letter ISO 4217 code. Example: `?currency=SAR`."},{"name":"sort_field","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},{"name":"sort_direction","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Sorting direction ('asc' or 'desc')"},"description":"Sorting direction ('asc' or 'desc')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResource_ProductDto_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Products"],"summary":"Create Product","description":"Create a new product with pricing and description.","operationId":"Create_Product_api_v2_products_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/products/{product_id}":{"get":{"tags":["Products"],"summary":"Get Product","description":"Retrieve detailed information about a specific product by its ID.","operationId":"Get_Product_api_v2_products__product_id__get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the product","title":"Product Id"},"description":"Unique identifier (UUID) of the product"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Products"],"summary":"Update Product","description":"Update product details such as name, price, or description.","operationId":"Update_Product_api_v2_products__product_id__put","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the product to update","title":"Product Id"},"description":"Unique identifier (UUID) of the product to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Products"],"summary":"Delete Product","description":"Delete a product from the organization.","operationId":"Delete_Product_api_v2_products__product_id__delete","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the product to delete","title":"Product Id"},"description":"Unique identifier (UUID) of the product to delete"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/products/{product_id}/prices":{"post":{"tags":["Products"],"summary":"Add Product Price","description":"Add a new price to a product in a different currency.\n\nEach product can have one active price per currency. The currency must be\nenabled in the organization's currency configuration.","operationId":"Add_Product_Price_api_v2_products__product_id__prices_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the product","title":"Product Id"},"description":"Unique identifier (UUID) of the product"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPriceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPriceDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/products/{product_id}/prices/{price_id}":{"put":{"tags":["Products"],"summary":"Update Product Price","description":"Update a product price.\n\nThis follows an immutable pricing pattern: the old price is archived\nand a new price is created with the updated values.","operationId":"Update_Product_Price_api_v2_products__product_id__prices__price_id__put","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the product","title":"Product Id"},"description":"Unique identifier (UUID) of the product"},{"name":"price_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the price to update","title":"Price Id"},"description":"Unique identifier (UUID) of the price to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPriceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPriceDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Products"],"summary":"Delete Product Price","description":"Archive (soft delete) a product price.\n\nCannot delete the last active price for a product. Each product must\nhave at least one active price.","operationId":"Delete_Product_Price_api_v2_products__product_id__prices__price_id__delete","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the product","title":"Product Id"},"description":"Unique identifier (UUID) of the product"},{"name":"price_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the price to delete","title":"Price Id"},"description":"Unique identifier (UUID) of the price to delete"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/subscriptions/{subscription_id}":{"get":{"tags":["Subscriptions"],"summary":"Get Subscription","description":"Retrieve detailed information about a specific subscription by its ID.","operationId":"Get_Subscription_api_v2_subscriptions__subscription_id__get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the subscription","title":"Subscription Id"},"description":"Unique identifier (UUID) of the subscription"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Subscriptions"],"summary":"Update Subscription","description":"Update subscription items, coupons, billing interval, description, auto-cancel cycles, or payment methods.\n\nUpdatable fields:\n\n- **Items** (products and quantities) — deferred to the next cycle.\n- **Subscription-level coupons** — same deferral as items.\n- **Recurring interval / interval count** (e.g. monthly ↔ yearly) — deferred to the next cycle.\n- **Description** — applied immediately.\n- **Until cycle number** (auto-cancel) — applied immediately.\n- **Payment method overrides** — applied immediately.\n\nAny change to items, coupons, or interval is recorded as a *pending\nchange* that takes effect at ``current_period_end``. The response carries a\n``pending_change`` block describing the deferred change, including a\n``next_invoice_preview`` and the per-line diff. If the next-cycle invoice\nhas already been generated and is unpaid, it is automatically cancelled\nand re-issued with the new amount.\n\nTo change anything else (e.g. the consumer / payer), cancel the\nsubscription and create a new one. Use ``DELETE /pending-change`` to\nrevert a previously scheduled change before it takes effect.","operationId":"Update_Subscription_api_v2_subscriptions__subscription_id__put","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the subscription to update","title":"Subscription Id"},"description":"Unique identifier (UUID) of the subscription to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/subscriptions":{"get":{"tags":["Subscriptions"],"summary":"List Subscriptions","description":"List all subscriptions with pagination, filtering, and sorting options.","operationId":"List_Subscriptions_api_v2_subscriptions_get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"statuses","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionStatus"},"nullable":true,"description":"Filter by subscription status"},"description":"Filter by subscription status"},{"name":"latest_invoice_is_paid","in":"query","required":false,"schema":{"type":"boolean","nullable":true,"description":"Filter subscriptions based on if their latest invoice is paid or partially paid"},"description":"Filter subscriptions based on if their latest invoice is paid or partially paid"},{"name":"from_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"datetime is created_at"},"description":"datetime is created_at"},{"name":"to_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"datetime is created_at"},"description":"datetime is created_at"},{"name":"current_period_start_from_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Filter subscriptions with current_period_start from this date onwards"},"description":"Filter subscriptions with current_period_start from this date onwards"},{"name":"current_period_start_to_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Filter subscriptions with current_period_start up to this date"},"description":"Filter subscriptions with current_period_start up to this date"},{"name":"current_period_end_from_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Filter subscriptions with current_period_end from this date onwards"},"description":"Filter subscriptions with current_period_end from this date onwards"},{"name":"current_period_end_to_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Filter subscriptions with current_period_end up to this date"},"description":"Filter subscriptions with current_period_end up to this date"},{"name":"from_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"description":"limit list by min subscription amount inclusive"},"description":"limit list by min subscription amount inclusive"},{"name":"to_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"description":"limit list by max subscription amount inclusive"},"description":"limit list by max subscription amount inclusive"},{"name":"organization_consumer_id","in":"query","required":false,"schema":{"type":"string","format":"uuid4","nullable":true,"description":"filter subscriptions that belongs to organization consumer"},"description":"filter subscriptions that belongs to organization consumer"},{"name":"search_term","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Serach by product name or description."},"description":"Serach by product name or description."},{"name":"product_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true,"description":"Product ids that need to be in the list of subscriptions"},"description":"Product ids that need to be in the list of subscriptions"},{"name":"currencies","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Filter subscriptions by currency codes (OR). E.g. currencies=SAR,USD"},"description":"Filter subscriptions by currency codes (OR). E.g. currencies=SAR,USD"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Page number, defaults to 1.","default":1},"description":"Page number, defaults to 1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Size of a page, defaults to 10. Maximum is 100.","default":10},"description":"Size of a page, defaults to 10. Maximum is 100."},{"name":"sort_field","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},{"name":"sort_direction","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Sorting direction ('asc' or 'desc')"},"description":"Sorting direction ('asc' or 'desc')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResource_SubscriptionDetailed_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Subscriptions"],"summary":"Create Subscription","description":"Create a new subscription with items, coupons, and payment methods.\n\nImportant: For most use cases, use the Checkout/Payment Link API (`/v2/payment_links`) instead.\nIt generates a payment link that you can embed in your own web page or redirect to.\n\nUse Cases:\n- Create a subscription and manually marking it as paid for reference\n- Automated subscription creation","operationId":"Create_Subscription_api_v2_subscriptions_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/subscriptions/{subscription_id}/cancel":{"post":{"tags":["Subscriptions"],"summary":"Cancel Subscription","description":"Schedule or complete cancellation and optionally cancel related invoices.\n\nBehavior depends on subscription **status**:\n\n- **ACTIVE**: Cancellation is **scheduled for the end of the current billing period** (the subscription\n  stays active until then; it is not moved to ``CANCELED`` immediately).\n- **INACTIVE**, **TRIALING**, **TRIAL_PENDING**: The subscription is **canceled immediately**\n  (status becomes ``CANCELED``).\n\nUse ``cancel_related_invoices`` to also cancel ongoing invoices tied to this subscription.","operationId":"Cancel_Subscription_api_v2_subscriptions__subscription_id__cancel_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the subscription to cancel","title":"Subscription Id"},"description":"Unique identifier (UUID) of the subscription to cancel"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCancel"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/subscriptions/{subscription_id}/uncancel":{"put":{"tags":["Subscriptions"],"summary":"Uncancel Subscription","description":"Withdraw a pending cancellation so the subscription continues after the current billing period.\n\nOnly **ACTIVE** subscriptions are accepted.\nIf the subscription is not scheduled to be cancelled, the request succeeds as a no-op.","operationId":"Uncancel_Subscription_api_v2_subscriptions__subscription_id__uncancel_put","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the subscription","title":"Subscription Id"},"description":"Unique identifier (UUID) of the subscription"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/subscriptions/{subscription_id}/pending-change":{"delete":{"tags":["Subscriptions"],"summary":"Cancel Scheduled Subscription Plan Change","description":"Cancel a previously-scheduled deferred plan change.\n\nNo-op (still 200) when no SCHEDULED pending change exists. If the original\nschedule call had already re-issued the next-cycle invoice (Arm B), the new\ninvoice remains unchanged — it represents the upcoming cycle the consumer was\nnotified about.","operationId":"Cancel_Scheduled_Subscription_Plan_Change_api_v2_subscriptions__subscription_id__pending_change_delete","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the subscription","title":"Subscription Id"},"description":"Unique identifier (UUID) of the subscription"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/subscriptions/{subscription_id}/freeze":{"post":{"tags":["Subscriptions"],"summary":"Freeze Subscription","description":"Freeze a subscription to pause invoice generation for a specific period.\n\nDuring the freeze period, no invoices will be generated for the subscription. The subscription\nwill automatically resume after the freeze period ends.","operationId":"Freeze_Subscription_api_v2_subscriptions__subscription_id__freeze_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the subscription to freeze","title":"Subscription Id"},"description":"Unique identifier (UUID) of the subscription to freeze"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeSubscriptionCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeSubscriptionBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Subscriptions"],"summary":"List Subscription Freezes","description":"List all freeze periods for a specific subscription.","operationId":"List_Subscription_Freezes_api_v2_subscriptions__subscription_id__freeze_get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the subscription","title":"Subscription Id"},"description":"Unique identifier (UUID) of the subscription"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Page number, defaults to 1.","default":1},"description":"Page number, defaults to 1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Size of a page, defaults to 10. Maximum is 100.","default":10},"description":"Size of a page, defaults to 10. Maximum is 100."},{"name":"sort_field","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},{"name":"sort_direction","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Sorting direction ('asc' or 'desc')"},"description":"Sorting direction ('asc' or 'desc')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResource_FreezeSubscriptionBase_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/subscriptions/{subscription_id}/freeze/{freeze_id}":{"put":{"tags":["Subscriptions"],"summary":"Update Subscription Freeze","description":"Update an existing subscription freeze period.\n\nAllows modifying the start and end dates of a freeze period. The subscription will remain\nfrozen during the updated period.","operationId":"Update_Subscription_Freeze_api_v2_subscriptions__subscription_id__freeze__freeze_id__put","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the subscription","title":"Subscription Id"},"description":"Unique identifier (UUID) of the subscription"},{"name":"freeze_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the freeze period to update","title":"Freeze Id"},"description":"Unique identifier (UUID) of the freeze period to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeSubscriptionUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeSubscriptionBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Subscriptions"],"summary":"Delete Subscription Freeze","description":"Remove a freeze period from a subscription.\n\nDeletes the specified freeze period, allowing the subscription to resume normal invoice\ngeneration immediately (if the freeze period was active).","operationId":"Delete_Subscription_Freeze_api_v2_subscriptions__subscription_id__freeze__freeze_id__delete","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the subscription","title":"Subscription Id"},"description":"Unique identifier (UUID) of the subscription"},{"name":"freeze_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the freeze period to delete","title":"Freeze Id"},"description":"Unique identifier (UUID) of the freeze period to delete"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/payment_links/{payment_link_id}":{"get":{"tags":["Checkout/Payment Links"],"summary":"Get Payment Link","description":"Retrieve detailed information about a specific payment link by its ID.","operationId":"Get_Payment_Link_api_v2_payment_links__payment_link_id__get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"payment_link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the payment link","title":"Payment Link Id"},"description":"Unique identifier (UUID) of the payment link"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLinkDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/payment_links":{"post":{"tags":["Checkout/Payment Links"],"summary":"Create Payment Link","description":"Create a new checkout/payment link for collecting payments.\n\n- **One-time products**: Creates an invoice (with its associated payment) when paid.\n- **Recurring products**: Creates a subscription (with its associated invoice and payment) when paid.\n\n**Notes:**\n- Cannot mix one-time and recurring products in the same payment link.\n- Installments are automatically disabled for recurring products (subscriptions).\n- Invoices, subscriptions and payments are created only after a successful payment.","operationId":"Create_Payment_Link_api_v2_payment_links_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentLinkDto"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLinkDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Checkout/Payment Links"],"summary":"List Payment Links","description":"List all payment links with pagination, filtering, and sorting options.","operationId":"List_Payment_Links_api_v2_payment_links_get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"statuses","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentLinkStatus"},"nullable":true,"description":"Filter by subscription status"},"description":"Filter by subscription status"},{"name":"from_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"datetime is created_at"},"description":"datetime is created_at"},{"name":"to_date","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"datetime is created_at"},"description":"datetime is created_at"},{"name":"from_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"description":"limit list by min payment link total amount inclusive"},"description":"limit list by min payment link total amount inclusive"},{"name":"to_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"description":"limit list by max payment link total amount inclusive"},"description":"limit list by max payment link total amount inclusive"},{"name":"product_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true,"description":"Product ids that need to be in the list of payment links"},"description":"Product ids that need to be in the list of payment links"},{"name":"currencies","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Filter by currency codes (OR). E.g. currencies=SAR,USD"},"description":"Filter by currency codes (OR). E.g. currencies=SAR,USD"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Page number, defaults to 1.","default":1},"description":"Page number, defaults to 1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Size of a page, defaults to 10. Maximum is 100.","default":10},"description":"Size of a page, defaults to 10. Maximum is 100."},{"name":"sort_field","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},"description":"Field to sort by, e.g., 'amount', 'scheduled_on'"},{"name":"sort_direction","in":"query","required":false,"schema":{"type":"string","nullable":true,"description":"Sorting direction ('asc' or 'desc')"},"description":"Sorting direction ('asc' or 'desc')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResource_PaymentLinkDetailed_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/payment_links/{payment_link_id}/status":{"patch":{"tags":["Checkout/Payment Links"],"summary":"Update Payment Link Status","description":"Update the status of a payment link.\n\nAllows activating or deactivating a payment link. When deactivated, the link will no longer\naccept new payments. Existing payments in progress are not affected.","operationId":"update_payment_link_status_api_v2_payment_links__payment_link_id__status_patch","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"payment_link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the payment link to update","title":"Payment Link Id"},"description":"Unique identifier (UUID) of the payment link to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentLinkStatusDto"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLinkDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/payment_links/{payment_link_id}/coupons":{"patch":{"tags":["Checkout/Payment Links"],"summary":"Update Payment Link Coupons","description":"Update link-level and item-level coupons on a payment link.\n\nRecomputes totals. New checkouts use the updated coupons;\npayments already in progress are unchanged.","operationId":"update_payment_link_coupons_api_v2_payment_links__payment_link_id__coupons_patch","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"payment_link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier (UUID) of the payment link to update","title":"Payment Link Id"},"description":"Unique identifier (UUID) of the payment link to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentLinkCouponsDto"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLinkDetailed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/consumer_portal/sessions":{"post":{"tags":["Consumer Portal Sessions"],"summary":"Create a consumer portal session","description":"Creates a short-lived, single-use portal session token for a merchant-owned consumer. The returned URL can be used to redirect the consumer or embed the portal in an iframe.","operationId":"create_portal_session_api_v2_consumer_portal_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePortalSessionRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"JWTBearer":[]},{"APIKey":[]}]}},"/api/v2/metered_subscriptions/record":{"post":{"tags":["Metered Subscriptions"],"summary":"Record Metered Usage","description":"Record metered usage events in bulk","operationId":"Record_Metered_Usage_api_v2_metered_subscriptions_record_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeterUsageBulkRequest","description":"Bulk usage records to record. Each record includes product_id, organization_consumer_id, usage_amount, and a source event ID."}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"JWTBearer":[]},{"APIKey":[]}]}},"/api/v2/metered_subscriptions":{"post":{"tags":["Metered Subscriptions"],"summary":"Create Metered Subscription","description":"Create a new metered subscription linking a METERED product to an organization consumer. The subscription is active immediately when its start time is reached. Usage can begin as soon as the subscription exists, and billing will use the subscription's billable window.","operationId":"Create_Metered_Subscription_api_v2_metered_subscriptions_post","security":[{"JWTBearer":[]},{"APIKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeteredSubscriptionCreateRequest","description":"Metered subscription creation request. Includes product_id (must be METERED type), organization_consumer_id, and optional start and end times."}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeteredSubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Metered Subscriptions"],"summary":"List Metered Subscriptions","description":"List metered subscriptions.","operationId":"List_Metered_Subscriptions_api_v2_metered_subscriptions_get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"include_usage","in":"query","required":false,"schema":{"type":"boolean","description":"Include current usage in each subscription response","default":false},"description":"Include current usage in each subscription response"},{"name":"ends_at_lte","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"End time is on or before this time"},"description":"End time is on or before this time"},{"name":"ends_at_gte","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"End time is on or after this time; ends_at null is included."},"description":"End time is on or after this time; ends_at null is included."},{"name":"starts_at_lte","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Start time is on or before this time"},"description":"Start time is on or before this time"},{"name":"starts_at_gte","in":"query","required":false,"schema":{"type":"string","format":"date-time","nullable":true,"description":"Start time is on or after this time"},"description":"Start time is on or after this time"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Page number, defaults to 1.","default":1},"description":"Page number, defaults to 1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"description":"Size of a page, defaults to 10. Maximum is 100.","default":10},"description":"Size of a page, defaults to 10. Maximum is 100."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResource_MeteredSubscriptionListItemResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/metered_subscriptions/{subscription_id}":{"get":{"tags":["Metered Subscriptions"],"summary":"Get Metered Subscription","description":"Retrieve a metered subscription.","operationId":"Get_Metered_Subscription_api_v2_metered_subscriptions__subscription_id__get","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier of the metered subscription to retrieve","title":"Subscription Id"},"description":"Unique identifier of the metered subscription to retrieve"},{"name":"include_usage","in":"query","required":false,"schema":{"type":"boolean","description":"Include current usage in the subscription response","default":false},"description":"Include current usage in the subscription response"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeteredSubscriptionListItemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Metered Subscriptions"],"summary":"Deactivate Metered Subscription","description":"Deactivate a metered subscription by setting its end time to now. This subscription stops being billable after this exact time. Note: deactivated subscriptions can still have usage recorded; it won't be billed.","operationId":"Deactivate_Metered_Subscription_api_v2_metered_subscriptions__subscription_id__delete","security":[{"JWTBearer":[]},{"APIKey":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Unique identifier of the metered subscription to deactivate","title":"Subscription Id"},"description":"Unique identifier of the metered subscription to deactivate"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeteredSubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AddressCreate":{"properties":{"street":{"type":"string","title":"Street","description":"Street name (alias: address_line_1)"},"district":{"type":"string","nullable":true,"description":"District (alias: address_line_2)"},"building_number":{"type":"string","maxLength":255,"nullable":true,"description":"Building number (4 digits for Saudi addresses)"},"city":{"type":"string","title":"City","description":"City"},"postal_code":{"type":"string","nullable":true,"description":"Postal code"},"country":{"type":"string","title":"Country","description":"Country"}},"type":"object","required":["street","city","country"],"title":"AddressCreate","description":"Address creation model for B2B consumers.\n\n``address_line_1`` and ``address_line_2`` are accepted as aliases of ``street`` and ``district``."},"AddressResponse":{"properties":{"street":{"type":"string","title":"Street","description":"Street name"},"district":{"type":"string","nullable":true,"description":"District"},"building_number":{"type":"string","nullable":true,"description":"Building number"},"city":{"type":"string","title":"City","description":"City"},"postal_code":{"type":"string","nullable":true,"description":"Postal code"},"country":{"type":"string","title":"Country","description":"Country"},"address_line_1":{"type":"string","title":"Address Line 1","description":"Same as street","readOnly":true},"address_line_2":{"type":"string","nullable":true,"description":"Same as district"}},"type":"object","title":"AddressResponse","description":"Address response model.\n\n``address_line_1``/``address_line_2`` mirror ``street``/``district`` for existing clients (the dashboard's\ncustomer pages still read them)."},"AutoChargeOnDemandResponse":{"properties":{"payment_id":{"type":"string","format":"uuid","title":"Payment Id","description":"ID of the payment that was charged"},"invoice_id":{"type":"string","format":"uuid","title":"Invoice Id","description":"ID of the invoice associated with the payment"}},"type":"object","title":"AutoChargeOnDemandResponse"},"BaseConsumerResponse":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the organization consumer"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"name":{"type":"string","title":"Name","description":"Name of the consumer"},"phone_number":{"type":"string","format":"phone","nullable":true,"description":"Phone number of the consumer"},"email":{"type":"string","format":"email","nullable":true,"description":"Email address of the consumer"},"external_id":{"type":"string","nullable":true,"description":"External identifier for the consumer"},"consumer":{"$ref":"#/components/schemas/app__consumer__v2__dtos__Consumer","nullable":true,"description":"Consumer information"},"iban":{"type":"string","nullable":true,"description":"IBAN (International Bank Account Number) of the consumer"},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether the consumer has been deleted"},"alias":{"type":"string","nullable":true,"description":"Alias of the consumer"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Date and time when the consumer was created"},"branch":{"$ref":"#/components/schemas/Branch","description":"Branch information for this consumer"},"comment":{"type":"string","nullable":true,"description":"Additional comments or notes about the consumer"},"communication_methods":{"items":{"$ref":"#/components/schemas/ConsumerCommunicationMethod"},"type":"array","title":"Communication Methods","description":"Preferred communication methods for the consumer"},"preferred_language":{"$ref":"#/components/schemas/Language","description":"Preferred language of the consumer"},"consumer_type":{"$ref":"#/components/schemas/OrganizationConsumerType","description":"Consumer type: individual or business"},"address":{"$ref":"#/components/schemas/AddressResponse","nullable":true,"description":"National address (required for business type)"},"vat_number":{"type":"string","nullable":true,"description":"VAT number (optional for business type)"},"commercial_registration":{"type":"string","nullable":true,"description":"Commercial registration number (optional for business type)"},"external_metadata":{"$ref":"#/components/schemas/ExternalMetadataStorage","description":"Flat key-value external metadata. Keys: ASCII letters/digits/underscore/hyphen, start with a letter, max 64 chars. Values: strings up to 128 chars in any language (no nested objects)."},"beneficiaries":{"items":{"$ref":"#/components/schemas/Beneficiary"},"type":"array","title":"Beneficiaries","description":"List of beneficiaries"},"fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Fields","description":"Catalog field values for this consumer"}},"type":"object","title":"BaseConsumerResponse"},"Beneficiary":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the beneficiary"},"name":{"type":"string","title":"Name","description":"Name of the beneficiary"},"fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Fields","description":"Catalog field values for this associated entity"}},"type":"object","title":"Beneficiary"},"BeneficiaryCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Associated entity name"},"fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Fields","description":"Catalog field values for this associated entity (keys from GET /resource-fields)"}},"type":"object","required":["name"],"title":"BeneficiaryCreate"},"BeneficiaryLink":{"properties":{"beneficiary_id":{"type":"string","format":"uuid","title":"Beneficiary Id"},"beneficiary_name":{"type":"string","title":"Beneficiary Name"},"fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Fields","description":"Catalog field values for this associated entity"}},"type":"object","title":"BeneficiaryLink"},"BeneficiaryUpdate":{"properties":{"id":{"type":"string","format":"uuid","nullable":true,"description":"Beneficiary to update"},"name":{"type":"string","title":"Name","description":"New name for the beneficiary"},"fields":{"additionalProperties":{"type":"string"},"type":"object","nullable":true,"description":"When set, replaces all catalog field values for this associated entity"},"delete":{"type":"boolean","title":"Delete","description":"Whether to delete the beneficiary","default":false}},"type":"object","required":["name"],"title":"BeneficiaryUpdate"},"BindingInput":{"properties":{"role_id":{"type":"string","format":"uuid","title":"Role Id"},"branch_id":{"type":"string","format":"uuid","nullable":true}},"type":"object","required":["role_id"],"title":"BindingInput"},"BnplEligibilityDto":{"properties":{"eligible":{"type":"boolean","title":"Eligible"},"provider_name":{"type":"string","title":"Provider Name"},"message":{"type":"string","nullable":true}},"type":"object","title":"BnplEligibilityDto"},"Branch":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the branch"},"name":{"type":"string","title":"Name","description":"Name of the branch"}},"type":"object","title":"Branch"},"BranchDto":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the branch"},"name":{"type":"string","title":"Name","description":"Name of the branch"}},"type":"object","title":"BranchDto"},"BranchItem":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"id":{"type":"string","format":"uuid4","title":"Id"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id"},"name":{"type":"string","title":"Name"},"user_count":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","title":"BranchItem"},"BranchListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/BranchItem"},"type":"array","title":"Data"}},"type":"object","title":"BranchListResponse"},"ConsumerCommunicationMethod":{"type":"string","enum":["WHATSAPP","EMAIL","SMS"],"title":"ConsumerCommunicationMethod"},"ConsumerCreate":{"properties":{"name":{"type":"string","maxLength":512,"title":"Name","description":"Consumer name"},"phone_number":{"type":"string","format":"phone","nullable":true,"description":"Phone number"},"email":{"type":"string","format":"email","nullable":true,"description":"Email address"},"external_id":{"type":"string","maxLength":512,"nullable":true,"description":"External ID"},"iban":{"type":"string","maxLength":34,"title":"IBAN","nullable":true,"description":"IBAN"},"alias":{"type":"string","maxLength":512,"nullable":true,"description":"Alias"},"comment":{"type":"string","maxLength":512,"nullable":true,"description":"Comment"},"preferred_language":{"$ref":"#/components/schemas/Language","nullable":true,"description":"Preferred language"},"communication_methods":{"items":{"$ref":"#/components/schemas/ConsumerCommunicationMethod"},"type":"array","nullable":true,"description":"Communication methods"},"consumer_type":{"$ref":"#/components/schemas/OrganizationConsumerType","description":"Consumer type: individual or business","default":"INDIVIDUAL"},"address":{"$ref":"#/components/schemas/AddressCreate","nullable":true,"description":"Address (required for business type)"},"vat_number":{"type":"string","maxLength":64,"nullable":true,"description":"VAT number (optional for business type)"},"commercial_registration":{"type":"string","maxLength":512,"nullable":true,"description":"Commercial registration number (optional for business type)"},"beneficiaries":{"items":{"$ref":"#/components/schemas/BeneficiaryCreate"},"type":"array","nullable":true,"description":"Associated entities to create with this consumer (optional)"},"fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Fields","description":"Catalog field values for this consumer (keys from GET /resource-fields?resource_type=consumer)"},"external_metadata":{"$ref":"#/components/schemas/ExternalMetadataStorage","description":"Flat key-value external metadata. Keys: ASCII letters/digits/underscore/hyphen, start with a letter, max 64 chars. Values: strings up to 128 chars in any language (no nested objects)."}},"type":"object","required":["name"],"title":"ConsumerCreate","description":"Consumer creation model."},"ConsumerResponse":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the organization consumer"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"name":{"type":"string","title":"Name","description":"Name of the consumer"},"phone_number":{"type":"string","format":"phone","nullable":true,"description":"Phone number of the consumer"},"email":{"type":"string","format":"email","nullable":true,"description":"Email address of the consumer"},"external_id":{"type":"string","nullable":true,"description":"External identifier for the consumer"},"consumer":{"$ref":"#/components/schemas/app__consumer__v2__dtos__Consumer","nullable":true,"description":"Consumer information"},"iban":{"type":"string","nullable":true,"description":"IBAN (International Bank Account Number) of the consumer"},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether the consumer has been deleted"},"alias":{"type":"string","nullable":true,"description":"Alias of the consumer"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Date and time when the consumer was created"},"branch":{"$ref":"#/components/schemas/Branch","description":"Branch information for this consumer"},"comment":{"type":"string","nullable":true,"description":"Additional comments or notes about the consumer"},"communication_methods":{"items":{"$ref":"#/components/schemas/ConsumerCommunicationMethod"},"type":"array","title":"Communication Methods","description":"Preferred communication methods for the consumer"},"preferred_language":{"$ref":"#/components/schemas/Language","description":"Preferred language of the consumer"},"consumer_type":{"$ref":"#/components/schemas/OrganizationConsumerType","description":"Consumer type: individual or business"},"address":{"$ref":"#/components/schemas/AddressResponse","nullable":true,"description":"National address (required for business type)"},"vat_number":{"type":"string","nullable":true,"description":"VAT number (optional for business type)"},"commercial_registration":{"type":"string","nullable":true,"description":"Commercial registration number (optional for business type)"},"external_metadata":{"$ref":"#/components/schemas/ExternalMetadataStorage","description":"Flat key-value external metadata. Keys: ASCII letters/digits/underscore/hyphen, start with a letter, max 64 chars. Values: strings up to 128 chars in any language (no nested objects)."},"beneficiaries":{"items":{"$ref":"#/components/schemas/Beneficiary"},"type":"array","title":"Beneficiaries","description":"List of beneficiaries"},"fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Fields","description":"Catalog field values for this consumer"},"last_invoice_activity":{"$ref":"#/components/schemas/LastInvoiceActivity","nullable":true,"description":"Information about the most recent invoice activity for this consumer"}},"type":"object","title":"ConsumerResponse"},"ConsumerUpdate":{"properties":{"name":{"type":"string","maxLength":512,"nullable":true,"description":"Consumer name"},"phone_number":{"type":"string","format":"phone","nullable":true,"description":"Phone number"},"email":{"type":"string","format":"email","nullable":true,"description":"Email address"},"external_id":{"type":"string","maxLength":512,"nullable":true,"description":"External ID"},"iban":{"type":"string","maxLength":34,"title":"IBAN","nullable":true,"description":"IBAN"},"alias":{"type":"string","maxLength":512,"nullable":true,"description":"Alias"},"comment":{"type":"string","maxLength":512,"nullable":true,"description":"Comment"},"preferred_language":{"$ref":"#/components/schemas/Language","nullable":true,"description":"Preferred language"},"communication_methods":{"items":{"$ref":"#/components/schemas/ConsumerCommunicationMethod"},"type":"array","nullable":true,"description":"Communication methods"},"consumer_type":{"$ref":"#/components/schemas/OrganizationConsumerType","nullable":true,"description":"Consumer type: individual or business"},"address":{"$ref":"#/components/schemas/AddressCreate","nullable":true,"description":"Address (required for business type)"},"vat_number":{"type":"string","maxLength":64,"nullable":true,"description":"VAT number (optional for business type)"},"commercial_registration":{"type":"string","maxLength":512,"nullable":true,"description":"Commercial registration number (optional for business type)"},"beneficiaries":{"items":{"$ref":"#/components/schemas/BeneficiaryUpdate"},"type":"array","nullable":true,"description":"List of beneficiaries (optional)"},"fields":{"additionalProperties":{"type":"string"},"type":"object","nullable":true,"description":"Full replacement of the consumer's catalog field values; omit to leave unchanged"},"external_metadata":{"$ref":"#/components/schemas/ExternalMetadataStorage","description":"Overwrites existing external metadata entirely. To merge values, send the full desired external metadata object."}},"type":"object","title":"ConsumerUpdate","description":"Consumer update model with all fields optional."},"ContactInformationType":{"type":"string","enum":["PHONE","EMAIL"],"title":"ContactInformationType"},"CouponCalculationMetadataDto":{"properties":{"coupons":{"items":{"$ref":"#/components/schemas/CouponMetadataDto"},"type":"array","title":"Coupons","description":"List of coupons applied and their calculation details"}},"type":"object","title":"CouponCalculationMetadataDto"},"CouponCreate":{"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name","description":"Name of the coupon."},"discount_value":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Discount Value","description":"Discount value of the coupon (either percentage or fixed)."},"currency":{"$ref":"#/components/schemas/CurrencyCode","nullable":true,"description":"Currency code for fixed-amount coupons (required when is_percentage=false). Must be null when is_percentage=true. Must be one of the supported currency codes."},"is_percentage":{"type":"boolean","title":"Is Percentage","description":"True if the discount is a percentage, False if it is a fixed amount.","default":false},"is_active":{"type":"boolean","title":"Is Active","description":"Indicates if the coupon is active upon creation.","default":true}},"type":"object","required":["name","discount_value"],"title":"CouponCreate"},"CouponDetailed":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the coupon"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name","description":"Name of the coupon."},"discount_value":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discount Value","description":"Discount value of the coupon (either percentage or fixed)."},"currency":{"$ref":"#/components/schemas/CurrencyCode","nullable":true,"description":"Currency code for fixed-amount coupons (e.g. SAR). Null for percentage coupons."},"is_percentage":{"type":"boolean","title":"Is Percentage","description":"True if the discount is a percentage, False if it is a fixed amount."},"is_active":{"type":"boolean","title":"Is Active","description":"Indicates if the coupon is currently active."},"redemptions":{"type":"integer","title":"Redemptions","description":"Indicates how many times this coupon has been used."}},"type":"object","title":"CouponDetailed"},"CouponDto":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the coupon"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name","description":"Name of the coupon."},"discount_value":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discount Value","description":"Discount value of the coupon (either percentage or fixed)."},"currency":{"$ref":"#/components/schemas/CurrencyCode","nullable":true,"description":"Currency code for fixed-amount coupons (e.g. SAR). Null for percentage coupons."},"is_percentage":{"type":"boolean","title":"Is Percentage","description":"True if the discount is a percentage, False if it is a fixed amount."},"is_active":{"type":"boolean","title":"Is Active","description":"Indicates if the coupon is currently active."}},"type":"object","title":"CouponDto"},"CouponMetadataDto":{"properties":{"coupon_id":{"type":"string","title":"Coupon Id","description":"Unique identifier of the coupon"},"name":{"type":"string","title":"Name","description":"Name of the coupon"},"is_percentage":{"type":"boolean","title":"Is Percentage","description":"Whether the discount is a percentage or fixed amount"},"discount_value":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discount Value","description":"Discount value (percentage or fixed amount)"},"currency":{"type":"string","nullable":true,"description":"Currency code for fixed-amount coupons (e.g., SAR, USD). Null for percentage coupons."},"order":{"type":"integer","title":"Order","description":"Order in which the coupon was applied"},"amount_before_discount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Before Discount","description":"Amount before applying this coupon"},"discount_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discount Amount","description":"Discount amount applied by this coupon"},"amount_after_discount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount After Discount","description":"Amount after applying this coupon"}},"type":"object","title":"CouponMetadataDto"},"CouponUpdate":{"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"nullable":true,"description":"Updated name of the coupon."},"discount_value":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Discount Value","description":"Updated discount value (either percentage or fixed)."},"currency":{"$ref":"#/components/schemas/CurrencyCode","nullable":true,"description":"Currency code for fixed-amount coupons. Null for percentage coupons."},"is_percentage":{"type":"boolean","nullable":true,"description":"True if the discount is a percentage, False if it is a fixed amount."},"is_active":{"type":"boolean","nullable":true,"description":"Whether the coupon should be active or inactive."}},"type":"object","title":"CouponUpdate"},"CreateBranchRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Branch name. Must be unique within the organization."}},"type":"object","required":["name"],"title":"CreateBranchRequest"},"CreatePaymentLinkDto":{"properties":{"name":{"type":"string","maxLength":512,"title":"Name","description":"Name of the payment link"},"description":{"type":"string","maxLength":512,"nullable":true,"description":"Optional description of the payment link"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency for the payment link (e.g. SAR, USD). All products must have a price in this currency.","default":"SAR"},"items":{"items":{"$ref":"#/components/schemas/CreatePaymentLinkItemDto"},"type":"array","minItems":1,"title":"Items","description":"List of products to include in the payment link"},"coupons":{"items":{"type":"string","format":"uuid4"},"type":"array","title":"Coupons","description":"List of coupon UUIDs to apply at the payment link level for discounts"},"max_number_of_payments":{"type":"integer","minimum":1.0,"nullable":true,"description":"Maximum number of times this payment link can be used. If null or 0, the payment link can be used unlimited times; 0 is normalized to null. If organization_consumer_id is set, this number becomes how many times that specific customer can pay. Typically this should be set to 1 in that scenario."},"valid_until":{"type":"string","format":"date-time","nullable":true,"description":"Datetime after which the payment link is no longer valid. If no timezone is specified, UTC is assumed."},"created_resource_effective_at":{"type":"string","format":"date-time","nullable":true,"description":"Datetime when the resource created from this payment link becomes effective. It is used as the one-off payment's scheduled_on, the recurring subscription's period_start, or the metered subscription's starts_at. If no timezone is specified, UTC is assumed."},"confirmation_message":{"type":"string","maxLength":512,"nullable":true,"description":"Optional message to display to the payer after successful payment"},"payment_methods":{"$ref":"#/components/schemas/PaymentMethodDto","nullable":true,"description":"Configure which payment methods are available. If null, organization defaults are used. Note: Installments are always disabled for recurring products (subscriptions)."},"installment_rule_override_id":{"type":"string","format":"uuid4","nullable":true,"description":"ID of the installment rule to use as an override at checkout for invoices created from this payment link. If null, the default rule is used. Follows the corresponding invoice field behavior. Must be null for subscription and metered-subscription payment links."},"installments_start_date":{"type":"string","format":"date-time","nullable":true,"description":"Date used to anchor the due dates of subsequent installments when an invoice created from this payment link is split into installments. Follows the corresponding invoice field behavior. Must be null for subscription and metered-subscription payment links."},"trial_period_days":{"type":"integer","maximum":365.0,"minimum":1.0,"nullable":true,"description":"Free trial duration (in days) for subscriptions created from this link. Only valid when the link contains recurring (subscription) products. Must be between 1 and 365. Omit (or null) for no trial."},"custom_fields":{"type":"object","title":"properties","description":"JSON Schema (https://json-schema.org/specification) to define and validate fields collected from payers during payment. Only string type properties allowed.","example":{"properties":{"child_name":{"title":"Child Name","type":"string"},"parent_email":{"title":"Parent Email","type":"string"}},"required":["child_name"],"type":"object"},"nullable":true},"success_redirect_url":{"type":"string","maxLength":2000,"minLength":1,"format":"uri","nullable":true,"description":"URL to redirect the payer to after a successful payment"},"failure_redirect_url":{"type":"string","maxLength":2000,"minLength":1,"format":"uri","nullable":true,"description":"URL to redirect the payer to after a failed payment"},"organization_consumer_id":{"type":"string","format":"uuid","nullable":true,"description":"ID of an existing consumer who will pay using this payment link. If set, customer information is not collected and this payment will be for that customer only. This is typically used when a specific customer is paying once. If not set, the link will collect customer information first. Use this when you expect multiple payments from different people, such as for a group trip or event."},"custom_metadata":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","nullable":true,"description":"Optional key-value metadata dictionary for attaching custom information. This metadata will be included as-is in payment link responses and webhook payloads."},"contact_information_type":{"$ref":"#/components/schemas/ContactInformationType","nullable":true,"description":"Type of contact information required for payment collection. Defaults to PHONE if not specified."},"document_ids":{"items":{"type":"string","format":"uuid4"},"type":"array","maxItems":10,"title":"Document Ids","description":"IDs of documents (previously uploaded via POST /v2/payment_links/documents) to attach to this payment link."},"form_id":{"type":"string","format":"uuid","nullable":true,"description":"ID of a form to attach. Only one form can be attached per payment link."}},"type":"object","required":["name","items"],"title":"CreatePaymentLinkDto"},"CreatePaymentLinkItemDto":{"properties":{"product_id":{"type":"string","format":"uuid4","title":"Product Id","description":"Unique identifier (UUID) of the product to include in the payment link"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","description":"Quantity of the product. Must be at least 1.","default":1},"coupons":{"items":{"type":"string","format":"uuid4"},"type":"array","title":"Coupons","description":"List of coupon UUIDs to apply to this specific item for discounts"},"allow_custom_quantity":{"type":"boolean","title":"Allow Custom Quantity","description":"Whether customers can select custom quantity for this item","default":false},"min_quantity":{"type":"integer","minimum":0.0,"nullable":true,"description":"Minimum quantity allowed if allow_custom_quantity is True; value is inclusive"},"max_quantity":{"type":"integer","minimum":0.0,"nullable":true,"description":"Maximum quantity allowed if allow_custom_quantity is True; value is inclusive"}},"type":"object","required":["product_id"],"title":"CreatePaymentLinkItemDto"},"CreatePortalSessionRequest":{"properties":{"organization_consumer_id":{"type":"string","format":"uuid","title":"Organization Consumer Id"},"subscription_id":{"type":"string","format":"uuid","nullable":true,"description":"Optional subscription to deep-link to. Must belong to the same organization_consumer_id. Forwarded to the portal as a URL query param so the SPA can route directly to that subscription on load."},"metered_subscription_id":{"type":"string","format":"uuid","nullable":true,"description":"Optional metered subscription to deep-link to. Must belong to the same organization_consumer_id. Forwarded to the portal as a URL query param so the SPA can route directly to that metered subscription on load."}},"type":"object","required":["organization_consumer_id"],"title":"CreatePortalSessionRequest"},"CreatedByType":{"type":"string","enum":["USER","API_KEY","CONNECTED_APP","CUSTOMER","ADMIN_PANEL","OPS","SYSTEM","UNKNOWN"],"title":"CreatedByType"},"CurrencyCode":{"type":"string","enum":["SAR","USD","EUR","GBP","AED","BHD","KWD","OMR","QAR"],"title":"CurrencyCode","description":"ISO 4217 currency codes supported by Moyasar.\n\nIncludes all currencies supported by Moyasar payment gateway."},"ExternalMetadataStorage":{"additionalProperties":{"type":"string"},"type":"object"},"FormNestedDto":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the form"},"name":{"type":"string","title":"Name","description":"Name of the form"},"definition":{"additionalProperties":true,"type":"object","title":"Definition","description":"Form-builder definition JSON"}},"type":"object","title":"FormNestedDto","description":"Form attached to a payment link, rendered by the payer UI."},"FreezeSubscriptionBase":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"freeze_start_datetime":{"type":"string","format":"date-time","title":"Freeze Start Datetime"},"freeze_end_datetime":{"type":"string","format":"date-time","nullable":true},"notes":{"type":"string","nullable":true},"subscription_id":{"type":"string","format":"uuid","title":"Subscription Id"},"invoice_id":{"type":"string","format":"uuid","title":"Invoice Id"},"duration":{"type":"integer","nullable":true}},"type":"object","title":"FreezeSubscriptionBase"},"FreezeSubscriptionCreateRequest":{"properties":{"freeze_start_datetime":{"type":"string","format":"date-time","title":"Freeze Start Datetime","description":"Start date and time when the subscription freeze period begins"},"freeze_end_datetime":{"type":"string","format":"date-time","nullable":true,"description":"End date and time when the subscription freeze period ends. If not provided, the freeze will continue indefinitely until manually removed."},"notes":{"type":"string","nullable":true,"description":"Optional notes explaining the reason for the freeze"}},"type":"object","required":["freeze_start_datetime"],"title":"FreezeSubscriptionCreateRequest"},"FreezeSubscriptionUpdateRequest":{"properties":{"freeze_start_datetime":{"type":"string","format":"date-time","title":"Freeze Start Datetime","description":"freeze_start_datetime is always provided even if it dont change"},"freeze_end_datetime":{"type":"string","format":"date-time","nullable":true,"description":"freeze_end_datetime is optional, if provided, it must be greater than freeze_start_datetime "},"notes":{"type":"string","nullable":true,"description":"Optional notes explaining the reason for the freeze"}},"type":"object","required":["freeze_start_datetime","freeze_end_datetime"],"title":"FreezeSubscriptionUpdateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvoiceAdjustmentChangedBy":{"type":"string","enum":["USER"],"title":"InvoiceAdjustmentChangedBy"},"InvoiceAdjustmentCouponDto":{"properties":{"side":{"$ref":"#/components/schemas/InvoiceAdjustmentSnapshotSide"},"coupon_id":{"type":"string","format":"uuid","title":"Coupon Id"},"order":{"type":"integer","title":"Order","default":0}},"type":"object","title":"InvoiceAdjustmentCouponDto"},"InvoiceAdjustmentDto":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid","title":"Id"},"type":{"$ref":"#/components/schemas/InvoiceAdjustmentType"},"adjustment_reason":{"$ref":"#/components/schemas/InvoiceAdjustmentReason"},"net_amount_change":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Net Amount Change"},"changed_by":{"$ref":"#/components/schemas/InvoiceAdjustmentChangedBy"},"changed_by_user_id":{"type":"string","format":"uuid","nullable":true},"products":{"items":{"$ref":"#/components/schemas/InvoiceAdjustmentProductDto"},"type":"array","title":"Products"},"coupons":{"items":{"$ref":"#/components/schemas/InvoiceAdjustmentCouponDto"},"type":"array","title":"Coupons"}},"type":"object","title":"InvoiceAdjustmentDto"},"InvoiceAdjustmentProductCouponDto":{"properties":{"coupon_id":{"type":"string","format":"uuid","title":"Coupon Id"},"order":{"type":"integer","title":"Order","default":0}},"type":"object","title":"InvoiceAdjustmentProductCouponDto"},"InvoiceAdjustmentProductDto":{"properties":{"side":{"$ref":"#/components/schemas/InvoiceAdjustmentSnapshotSide"},"product_id":{"type":"string","format":"uuid","title":"Product Id"},"quantity":{"type":"integer","title":"Quantity"},"coupons":{"items":{"$ref":"#/components/schemas/InvoiceAdjustmentProductCouponDto"},"type":"array","title":"Coupons"}},"type":"object","title":"InvoiceAdjustmentProductDto"},"InvoiceAdjustmentReason":{"type":"string","enum":["ERROR_IN_PRICING","CHANGE_IN_PRODUCT_OR_SERVICE","CHANGE_IN_TERM_AND_CONDITIONS","OTHER"],"title":"InvoiceAdjustmentReason"},"InvoiceAdjustmentSnapshotSide":{"type":"string","enum":["OLD","NEW"],"title":"InvoiceAdjustmentSnapshotSide"},"InvoiceAdjustmentType":{"type":"string","enum":["CREDIT","DEBIT","AMENDMENT"],"title":"InvoiceAdjustmentType"},"InvoiceBase":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the invoice"},"payment_link_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the payment link if invoice was created from one"},"metered_subscription_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the metered subscription billed by this invoice"},"user_id":{"type":"string","format":"uuid4","title":"User Id","description":"Unique identifier (UUID) of the user who created the invoice"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"organization_consumer_id":{"type":"string","format":"uuid4","title":"Organization Consumer Id","description":"Unique identifier (UUID) of the organization consumer"},"account_id":{"type":"string","format":"uuid4","title":"Account Id","description":"Unique identifier (UUID) of the account"},"branch_id":{"type":"string","format":"uuid4","title":"Branch Id","description":"Unique identifier (UUID) of the branch"},"org_invoice_number":{"type":"integer","title":"Org Invoice Number","description":"Organization-specific invoice number"},"description":{"type":"string","nullable":true,"description":"Description of the invoice"},"total_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Amount","description":"Total invoice amount after discounts (in invoice currency)"},"original_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Original Amount","description":"Original invoice amount before discounts (in invoice currency)"},"item_level_discounted_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Item Level Discounted Amount","description":"Total amount discounted at the item level"},"total_vat_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Total VAT amount calculated from products"},"total_price_excluding_vat":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Total price excluding VAT"},"coupon_calculation_metadata":{"$ref":"#/components/schemas/CouponCalculationMetadataDto","nullable":true,"description":"Metadata about how coupons were applied to the invoice"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency code for the invoice (e.g., SAR, USD, EUR)","default":"SAR"},"home_currency_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Total in home currency (SAR) for reporting. Equals total_amount for SAR invoices."},"home_currency_amount_actual":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Actual settled amount in home currency (SAR) after payment processing."},"exchange_rate_at_creation":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Exchange rate used at invoice creation time (for audit). 1 for SAR invoices."},"consumer_message":{"type":"string","nullable":true,"description":"Message to display to the consumer"},"status":{"$ref":"#/components/schemas/InvoiceStatusEnum","description":"Current status of the invoice"},"payment_method":{"$ref":"#/components/schemas/PaymentMethodEnum","description":"Payment method for the invoice"},"allowed_payment_flow":{"$ref":"#/components/schemas/PaymentFlow","description":"Allowed payment flow for the invoice"},"current_payment_flow":{"$ref":"#/components/schemas/PaymentFlow","nullable":true,"description":"Current payment flow being used"},"period_start":{"type":"string","format":"date-time","nullable":true,"description":"Start date and time of the billing period"},"period_end":{"type":"string","format":"date-time","nullable":true,"description":"End date and time of the billing period"},"recurring_interval":{"$ref":"#/components/schemas/RecurringInterval","nullable":true,"description":"Billing cycle interval if this is a recurring invoice"},"recurring_interval_count":{"type":"integer","nullable":true,"description":"Number of intervals per billing cycle for recurring invoices"},"type":{"$ref":"#/components/schemas/InvoiceType","nullable":true,"description":"Type of invoice"},"no_of_payments":{"type":"integer","nullable":true,"description":"Number of payment rows on the invoice (updated when payments are added or split)"},"installments_start_date":{"type":"string","format":"date-time","nullable":true,"description":"Anchor date for installment plan after payment"},"installment_rule_override_id":{"type":"string","format":"uuid4","nullable":true,"description":"Override installment rule offered on this invoice instead of the amount-based default"},"accounting_external_id":{"type":"string","nullable":true,"description":"The accounting system's own record id this invoice is reconciled against, if any"},"total_amount_in_smallest_unit":{"type":"integer","title":"Total Amount In Smallest Unit","description":"Total invoice amount in smallest currency unit (e.g. halala for SAR).","readOnly":true},"original_amount_in_smallest_unit":{"type":"integer","title":"Original Amount In Smallest Unit","description":"Original invoice amount (before discounts) in smallest currency unit.","readOnly":true}},"type":"object","title":"InvoiceBase","description":"Base invoice response DTO.\n\nMulti-Currency Support:\n- `currency`: The currency code for the invoice (e.g., SAR, USD, EUR)\n- `home_currency_amount`: Total amount converted to home currency (SAR) for reporting\n- `home_currency_amount_actual`: Actual settled amount in home currency after payment\n- `exchange_rate_at_creation`: Exchange rate used at invoice creation time (for audit)\n\nFor SAR invoices, `home_currency_amount` equals `total_amount` and `exchange_rate_at_creation` is 1."},"InvoiceCreate":{"properties":{"notify_consumer":{"type":"boolean","title":"Notify Consumer","description":"Whether to send a notification to the consumer about the invoice","default":true},"description":{"type":"string","maxLength":512,"minLength":1,"nullable":true,"description":"Invoice description or notes"},"items":{"items":{"$ref":"#/components/schemas/InvoiceItemCreateDto"},"type":"array","minItems":1,"title":"Items","description":"List of products or services to include in the invoice"},"payment_methods":{"$ref":"#/components/schemas/InvoicePaymentMethodDto","description":"Payment methods allowed for this invoice"},"coupons":{"items":{"type":"string","format":"uuid4"},"type":"array","nullable":true,"description":"List of coupon UUIDs to apply for discounts"},"organization_consumer_id":{"type":"string","format":"uuid4","title":"Organization Consumer Id","description":"UUID of the consumer who will pay this invoice"},"organization_consumer_beneficiaries":{"items":{"type":"string","format":"uuid4"},"type":"array","nullable":true,"description":"UUID of the beneficiaries to the consumer who will pay this invoice"},"scheduled_on":{"type":"string","format":"date-time","title":"Scheduled On","description":"Invoice due date"},"installment_rule_override_id":{"type":"string","format":"uuid4","nullable":true,"description":"ID of the installment rule to use as an override for this invoice. If null, the default rule is used. Cannot be changed once the invoice is split into installments."},"installments_start_date":{"type":"string","format":"date-time","nullable":true,"description":"When the invoice is split into installments, this date anchors the due dates of subsequent installments.\n\nExample: for a monthly plan split into 3 installments, with scheduled_on set to Jan 1:\n\nIf installments_start_date is null, the subsequent installments are due on Feb 1 and Mar 1.\n\nIf installments_start_date is Feb 4, they are due on Feb 4 and Mar 4."},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency for the invoice. Defaults to SAR for backward compatibility.","default":"SAR"},"accounting_external_id":{"type":"string","maxLength":512,"nullable":true,"description":"The accounting system's own record id (e.g. Zoho invoice_id) for a pre-existing invoice this invoice should be reconciled against instead of creating a new document."}},"type":"object","required":["items","payment_methods","organization_consumer_id","scheduled_on"],"title":"InvoiceCreate","description":"DTO for creating a new invoice.\n\nMulti-Currency Support:\n- The `currency` field is optional and defaults to 'SAR' for backward compatibility.\n- When a currency is specified, products must have a price in that currency.\n- If no ProductPrice exists for the currency, falls back to product.price (legacy)."},"InvoiceDetailed":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the invoice"},"payment_link_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the payment link if invoice was created from one"},"metered_subscription_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the metered subscription billed by this invoice"},"user_id":{"type":"string","format":"uuid4","title":"User Id","description":"Unique identifier (UUID) of the user who created the invoice"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"organization_consumer_id":{"type":"string","format":"uuid4","title":"Organization Consumer Id","description":"Unique identifier (UUID) of the organization consumer"},"account_id":{"type":"string","format":"uuid4","title":"Account Id","description":"Unique identifier (UUID) of the account"},"branch_id":{"type":"string","format":"uuid4","title":"Branch Id","description":"Unique identifier (UUID) of the branch"},"org_invoice_number":{"type":"integer","title":"Org Invoice Number","description":"Organization-specific invoice number"},"description":{"type":"string","nullable":true,"description":"Description of the invoice"},"total_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Amount","description":"Total invoice amount after discounts (in invoice currency)"},"original_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Original Amount","description":"Original invoice amount before discounts (in invoice currency)"},"item_level_discounted_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Item Level Discounted Amount","description":"Total amount discounted at the item level"},"total_vat_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Total VAT amount calculated from products"},"total_price_excluding_vat":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Total price excluding VAT"},"coupon_calculation_metadata":{"$ref":"#/components/schemas/CouponCalculationMetadataDto","nullable":true,"description":"Metadata about how coupons were applied to the invoice"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency code for the invoice (e.g., SAR, USD, EUR)","default":"SAR"},"home_currency_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Total in home currency (SAR) for reporting. Equals total_amount for SAR invoices."},"home_currency_amount_actual":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Actual settled amount in home currency (SAR) after payment processing."},"exchange_rate_at_creation":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Exchange rate used at invoice creation time (for audit). 1 for SAR invoices."},"consumer_message":{"type":"string","nullable":true,"description":"Message to display to the consumer"},"status":{"$ref":"#/components/schemas/InvoiceStatusEnum","description":"Current status of the invoice"},"payment_method":{"$ref":"#/components/schemas/PaymentMethodEnum","description":"Payment method for the invoice"},"allowed_payment_flow":{"$ref":"#/components/schemas/PaymentFlow","description":"Allowed payment flow for the invoice"},"current_payment_flow":{"$ref":"#/components/schemas/PaymentFlow","nullable":true,"description":"Current payment flow being used"},"period_start":{"type":"string","format":"date-time","nullable":true,"description":"Start date and time of the billing period"},"period_end":{"type":"string","format":"date-time","nullable":true,"description":"End date and time of the billing period"},"recurring_interval":{"$ref":"#/components/schemas/RecurringInterval","nullable":true,"description":"Billing cycle interval if this is a recurring invoice"},"recurring_interval_count":{"type":"integer","nullable":true,"description":"Number of intervals per billing cycle for recurring invoices"},"type":{"$ref":"#/components/schemas/InvoiceType","nullable":true,"description":"Type of invoice"},"no_of_payments":{"type":"integer","nullable":true,"description":"Number of payment rows on the invoice (updated when payments are added or split)"},"installments_start_date":{"type":"string","format":"date-time","nullable":true,"description":"Anchor date for installment plan after payment"},"installment_rule_override_id":{"type":"string","format":"uuid4","nullable":true,"description":"Override installment rule offered on this invoice instead of the amount-based default"},"accounting_external_id":{"type":"string","nullable":true,"description":"The accounting system's own record id this invoice is reconciled against, if any"},"invoice_number":{"type":"integer","title":"Invoice Number","description":"Global unique invoice number"},"remaining_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Remaining Amount","description":"Remaining amount to be paid"},"paid_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Paid Amount","description":"Total amount already paid"},"organization_consumer":{"$ref":"#/components/schemas/app__common__dtos__shared__OrganizationConsumer","description":"Consumer information for this invoice"},"items":{"items":{"$ref":"#/components/schemas/InvoiceItemDto"},"type":"array","title":"Items","description":"List of items included in the invoice"},"branch":{"$ref":"#/components/schemas/BranchDto","nullable":true,"description":"Branch information for this invoice"},"payments":{"items":{"$ref":"#/components/schemas/PaymentDto"},"type":"array","title":"Payments","description":"List of payments associated with this invoice"},"subscription_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the subscription if this invoice is part of a subscription"},"subscription":{"$ref":"#/components/schemas/SubscriptionDetailed","nullable":true,"description":"Subscription details if this invoice is part of a subscription"},"payment_methods":{"$ref":"#/components/schemas/InvoicePaymentMethodDto","nullable":true,"description":"Payment methods available for this invoice"},"bnpl_eligibility":{"$ref":"#/components/schemas/BnplEligibilityDto","nullable":true,"description":"Latest BNPL eligibility for this invoice (provider display name + help message)"},"recurrence_pattern":{"$ref":"#/components/schemas/RecurrencePattern","nullable":true,"description":"Recurrence pattern for recurring invoices"},"parent_id":{"type":"string","format":"uuid4","nullable":true,"description":"Parent invoice ID for recurring invoices"},"url":{"type":"string","title":"Url","description":"URL to access the invoice"},"beneficiaries":{"items":{"$ref":"#/components/schemas/BeneficiaryLink"},"type":"array","nullable":true,"description":"Beneficiaries linked to this invoice"},"adjustments":{"items":{"$ref":"#/components/schemas/InvoiceAdjustmentDto"},"type":"array","title":"Adjustments","description":"Credit, debit, and amendment history for this invoice"},"total_credited":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Credited","description":"Sum of credit adjustment amounts (absolute value of negative net changes)","default":"0"},"total_debited":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Debited","description":"Sum of debit adjustment amounts","default":"0"},"total_refunded":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Refunded","description":"Sum of payment refunds on this invoice","default":"0"},"net_received":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Net Received","description":"Sum of paid payment amounts minus total_refunded","default":"0"},"total_amount_in_smallest_unit":{"type":"integer","title":"Total Amount In Smallest Unit","description":"Total invoice amount in smallest currency unit (e.g. halala for SAR).","readOnly":true},"original_amount_in_smallest_unit":{"type":"integer","title":"Original Amount In Smallest Unit","description":"Original invoice amount (before discounts) in smallest currency unit.","readOnly":true},"remaining_amount_in_smallest_unit":{"type":"integer","title":"Remaining Amount In Smallest Unit","description":"Remaining amount in smallest currency unit.","readOnly":true},"paid_amount_in_smallest_unit":{"type":"integer","title":"Paid Amount In Smallest Unit","description":"Paid amount in smallest currency unit.","readOnly":true}},"type":"object","title":"InvoiceDetailed"},"InvoiceInPlaceUpdate":{"properties":{"scheduled_on":{"type":"string","format":"date-time","nullable":true,"description":"The scheduled payment date for the invoice. After this date, the invoice will be considered overdue. Cannot be earlier than the current scheduled date."},"installment_rule_override_id":{"type":"string","format":"uuid4","nullable":true,"description":"ID of the installment rule to use as an override for this invoice. If null, the default rule is used. Cannot be changed once the invoice is split into installments."},"installments_start_date":{"type":"string","format":"date-time","nullable":true,"description":"When the invoice is split into installments, this date anchors the due dates of subsequent installments.\n\nExample: for a monthly plan split into 3 installments, with scheduled_on set to Jan 1:\n\nIf installments_start_date is null, the subsequent installments are due on Feb 1 and Mar 1.\n\nIf installments_start_date is Feb 4, they are due on Feb 4 and Mar 4."},"description":{"type":"string","maxLength":512,"minLength":1,"nullable":true,"description":"Description of the invoice. Provides additional context or details about the invoice. Must be between 1 and 512 characters if provided."},"accounting_external_id":{"type":"string","maxLength":512,"nullable":true,"description":"The accounting system's own record id for a pre-existing invoice. Only takes effect when set for the first time (was previously empty); later changes are ignored here."}},"type":"object","title":"InvoiceInPlaceUpdate","description":"DTO for partial in-place updates to invoice fields.\n\nThis DTO allows updating specific fields of an invoice without requiring all fields.\nOnly the fields provided will be updated. All fields are optional.\n\nNote: This endpoint performs in-place updates. Use this for simple field updates."},"InvoiceItemCreateDto":{"properties":{"product_id":{"type":"string","format":"uuid4","title":"Product Id","description":"UUID of the product to include"},"quantity":{"type":"integer","exclusiveMinimum":0.0,"title":"Quantity","description":"Quantity of the product"},"coupons":{"items":{"type":"string","format":"uuid4"},"type":"array","nullable":true,"description":"List of coupon UUIDs to apply for discounts on this specific item"}},"type":"object","required":["product_id","quantity"],"title":"InvoiceItemCreateDto"},"InvoiceItemDto":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the invoice item"},"product_id":{"type":"string","format":"uuid4","title":"Product Id","description":"Unique identifier (UUID) of the product"},"product":{"$ref":"#/components/schemas/ProductDto","description":"Product details for this invoice item"},"quantity":{"type":"integer","title":"Quantity","description":"Quantity of the product in this invoice item"},"original_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Original Amount","description":"Original amount before discounts"},"discounted_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discounted Amount","description":"Amount after discounts are applied"},"coupon_calculation_metadata":{"$ref":"#/components/schemas/CouponCalculationMetadataDto","nullable":true,"description":"Metadata about how coupons were applied to this item"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency code for this item (e.g., SAR, USD)","default":"SAR"},"unit_price":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Snapshotted unit price at invoice creation (for historical accuracy)"},"product_price_id":{"type":"string","format":"uuid4","nullable":true,"description":"Reference to the ProductPrice used for this item (for traceability)"},"original_amount_in_smallest_unit":{"type":"integer","title":"Original Amount In Smallest Unit","description":"Original item amount in smallest currency unit.","readOnly":true},"discounted_amount_in_smallest_unit":{"type":"integer","title":"Discounted Amount In Smallest Unit","description":"Discounted item amount in smallest currency unit.","readOnly":true}},"type":"object","title":"InvoiceItemDto","description":"Invoice item response DTO.\n\nMulti-Currency Support:\n- `currency`: The currency code for this item (e.g., SAR, USD)\n- `unit_price`: Snapshotted price at invoice creation (for historical accuracy)\n- `product_price_id`: Reference to the ProductPrice used (for traceability)"},"InvoiceListItem":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the invoice"},"payment_link_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the payment link if invoice was created from one"},"metered_subscription_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the metered subscription billed by this invoice"},"user_id":{"type":"string","format":"uuid4","title":"User Id","description":"Unique identifier (UUID) of the user who created the invoice"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"organization_consumer_id":{"type":"string","format":"uuid4","title":"Organization Consumer Id","description":"Unique identifier (UUID) of the organization consumer"},"account_id":{"type":"string","format":"uuid4","title":"Account Id","description":"Unique identifier (UUID) of the account"},"branch_id":{"type":"string","format":"uuid4","title":"Branch Id","description":"Unique identifier (UUID) of the branch"},"org_invoice_number":{"type":"integer","title":"Org Invoice Number","description":"Organization-specific invoice number"},"description":{"type":"string","nullable":true,"description":"Description of the invoice"},"total_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Amount","description":"Total invoice amount after discounts (in invoice currency)"},"original_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Original Amount","description":"Original invoice amount before discounts (in invoice currency)"},"item_level_discounted_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Item Level Discounted Amount","description":"Total amount discounted at the item level"},"total_vat_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Total VAT amount calculated from products"},"total_price_excluding_vat":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Total price excluding VAT"},"coupon_calculation_metadata":{"$ref":"#/components/schemas/CouponCalculationMetadataDto","nullable":true,"description":"Metadata about how coupons were applied to the invoice"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency code for the invoice (e.g., SAR, USD, EUR)","default":"SAR"},"home_currency_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Total in home currency (SAR) for reporting. Equals total_amount for SAR invoices."},"home_currency_amount_actual":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Actual settled amount in home currency (SAR) after payment processing."},"exchange_rate_at_creation":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Exchange rate used at invoice creation time (for audit). 1 for SAR invoices."},"consumer_message":{"type":"string","nullable":true,"description":"Message to display to the consumer"},"status":{"$ref":"#/components/schemas/InvoiceStatusEnum","description":"Current status of the invoice"},"payment_method":{"$ref":"#/components/schemas/PaymentMethodEnum","description":"Payment method for the invoice"},"allowed_payment_flow":{"$ref":"#/components/schemas/PaymentFlow","description":"Allowed payment flow for the invoice"},"current_payment_flow":{"$ref":"#/components/schemas/PaymentFlow","nullable":true,"description":"Current payment flow being used"},"period_start":{"type":"string","format":"date-time","nullable":true,"description":"Start date and time of the billing period"},"period_end":{"type":"string","format":"date-time","nullable":true,"description":"End date and time of the billing period"},"recurring_interval":{"$ref":"#/components/schemas/RecurringInterval","nullable":true,"description":"Billing cycle interval if this is a recurring invoice"},"recurring_interval_count":{"type":"integer","nullable":true,"description":"Number of intervals per billing cycle for recurring invoices"},"type":{"$ref":"#/components/schemas/InvoiceType","nullable":true,"description":"Type of invoice"},"no_of_payments":{"type":"integer","nullable":true,"description":"Number of payment rows on the invoice (updated when payments are added or split)"},"installments_start_date":{"type":"string","format":"date-time","nullable":true,"description":"Anchor date for installment plan after payment"},"installment_rule_override_id":{"type":"string","format":"uuid4","nullable":true,"description":"Override installment rule offered on this invoice instead of the amount-based default"},"accounting_external_id":{"type":"string","nullable":true,"description":"The accounting system's own record id this invoice is reconciled against, if any"},"remaining_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Remaining amount to be paid"},"paid_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Paid Amount","description":"Total amount already paid"},"organization_consumer":{"$ref":"#/components/schemas/app__common__dtos__shared__OrganizationConsumer","description":"Consumer information for this invoice"},"subscription":{"$ref":"#/components/schemas/InvoiceListSubscrptionDto","nullable":true,"description":"Subscription information if this invoice is part of a subscription"},"payments":{"items":{"$ref":"#/components/schemas/PaymentDto"},"type":"array","nullable":true,"description":"List of payments associated with this invoice"},"total_number_of_payments":{"type":"integer","title":"Total Number Of Payments","description":"Total number of payments for this invoice"},"last_payment_paid_at":{"type":"string","format":"date-time","nullable":true,"description":"The date when the last payment was paid"},"total_amount_in_smallest_unit":{"type":"integer","title":"Total Amount In Smallest Unit","description":"Total invoice amount in smallest currency unit (e.g. halala for SAR).","readOnly":true},"original_amount_in_smallest_unit":{"type":"integer","title":"Original Amount In Smallest Unit","description":"Original invoice amount (before discounts) in smallest currency unit.","readOnly":true},"remaining_amount_in_smallest_unit":{"type":"integer","nullable":true,"description":"Remaining amount in smallest currency unit."},"paid_amount_in_smallest_unit":{"type":"integer","title":"Paid Amount In Smallest Unit","description":"Paid amount in smallest currency unit.","readOnly":true}},"type":"object","title":"InvoiceListItem"},"InvoiceListSubscrptionDto":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the subscription"},"recurring_interval":{"$ref":"#/components/schemas/SubscriptionRecurringInterval","description":"Billing cycle interval"},"recurring_interval_count":{"type":"integer","title":"Recurring Interval Count","description":"Number of intervals per billing cycle"},"status":{"$ref":"#/components/schemas/SubscriptionStatus","description":"Current status of the subscription"},"current_period_start":{"type":"string","format":"date-time","title":"Current Period Start","description":"Start date and time of the current billing period"},"current_period_end":{"type":"string","format":"date-time","nullable":true,"description":"End date and time of the current billing period"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","description":"Whether the subscription will be canceled at the end of the current period"}},"type":"object","title":"InvoiceListSubscrptionDto"},"InvoicePaymentMethodDto":{"properties":{"mada":{"type":"boolean","title":"Mada","description":"Enable Mada payment method"},"visa":{"type":"boolean","title":"Visa","description":"Enable Visa payment method"},"mastercard":{"type":"boolean","title":"Mastercard","description":"Enable Mastercard payment method"},"amex":{"type":"boolean","title":"Amex","description":"Enable American Express payment method"},"bank_transfer":{"type":"boolean","title":"Bank Transfer","description":"Enable bank transfer payment method"},"installment":{"type":"boolean","title":"Installment","description":"Enable installment payment option"},"qurrah":{"type":"boolean","title":"Qurrah","description":"Enable Qurrah payment method","default":false},"bnpl":{"type":"boolean","title":"Bnpl","description":"Enable BNPL (e.g. Tamara) for this invoice","default":false}},"type":"object","required":["mada","visa","mastercard","amex","bank_transfer","installment"],"title":"InvoicePaymentMethodDto"},"InvoiceStatusEnum":{"type":"string","enum":["DRAFT","CREATED","SENT","ACCEPTED","REJECTED","COMPLETED","CANCELED","EXPIRED"],"title":"InvoiceStatusEnum","description":"Invoice status enum representing the lifecycle/state of an invoice.\n\nStatus describes the current stage of an invoice in its lifecycle\n(DRAFT → CREATED → ACCEPTED → COMPLETED).\nThis changes over time as the invoice progresses. Different from InvoiceType which describes the payment structure."},"InvoiceType":{"type":"string","enum":["ONE_OFF","ONE_OFF_FUTURE","RECURRING","INSTALLMENTS","PRORATION"],"title":"InvoiceType","description":"Invoice type enum representing the payment structure/pattern of an invoice.\n\nType describes how the invoice is structured for payments (ONE_OFF, RECURRING, INSTALLMENTS, etc.).\nThis is determined at invoice creation and typically doesn't change. Different from InvoiceStatusEnum\nwhich describes the current lifecycle state of the invoice."},"JsonValue":{},"Language":{"type":"string","enum":["AR","EN"],"title":"Language"},"LastInvoiceActivity":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the invoice"},"org_invoice_number":{"type":"integer","title":"Org Invoice Number","description":"Organization-specific invoice number"},"subcription_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the subscription if applicable"}},"type":"object","title":"LastInvoiceActivity"},"ListResource_ConsumerResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ConsumerResponse"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","title":"ListResource[ConsumerResponse]"},"ListResource_CouponDetailed_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CouponDetailed"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","title":"ListResource[CouponDetailed]"},"ListResource_FreezeSubscriptionBase_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/FreezeSubscriptionBase"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","title":"ListResource[FreezeSubscriptionBase]"},"ListResource_InvoiceListItem_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/InvoiceListItem"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","title":"ListResource[InvoiceListItem]"},"ListResource_MeteredSubscriptionListItemResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MeteredSubscriptionListItemResponse"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","title":"ListResource[MeteredSubscriptionListItemResponse]"},"ListResource_PaymentLinkDetailed_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PaymentLinkDetailed"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","title":"ListResource[PaymentLinkDetailed]"},"ListResource_PaymentResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PaymentResponse"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","title":"ListResource[PaymentResponse]"},"ListResource_ProductDto_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ProductDto"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","title":"ListResource[ProductDto]"},"ListResource_SubscriptionDetailed_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SubscriptionDetailed"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","title":"ListResource[SubscriptionDetailed]"},"MeOrganizationInfo":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"name_en":{"type":"string","nullable":true},"sandbox":{"type":"boolean","title":"Sandbox"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"currency_config":{"$ref":"#/components/schemas/OrganizationCurrencyConfigDTO"}},"type":"object","title":"MeOrganizationInfo","description":"Organization information for /me endpoint."},"MeResponse":{"properties":{"user":{"$ref":"#/components/schemas/MeUserInfo"},"organization":{"$ref":"#/components/schemas/MeOrganizationInfo"}},"type":"object","title":"MeResponse","description":"Response for /me endpoint."},"MeUserInfo":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"en_first_name":{"type":"string","nullable":true},"en_last_name":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","title":"MeUserInfo","description":"User information for /me endpoint."},"MeterUsageBulkRequest":{"properties":{"records":{"items":{"$ref":"#/components/schemas/MeterUsageRecordRequest"},"type":"array","maxItems":1000,"minItems":1,"title":"Records","description":"List of usage records to record"}},"type":"object","required":["records"],"title":"MeterUsageBulkRequest","description":"Request to record multiple usage events in bulk."},"MeterUsageRecordRequest":{"properties":{"product_id":{"type":"string","format":"uuid","title":"Product Id","description":"METERED product ID"},"organization_consumer_id":{"type":"string","format":"uuid","title":"Organization Consumer Id","description":"Organization consumer ID"},"usage_amount":{"type":"integer","maximum":9999999999.0,"exclusiveMinimum":0.0,"title":"Usage Amount","description":"Usage quantity in whole units"},"source_event_id":{"type":"string","title":"Source Event Id","description":"Stable source event ID used to prevent duplicate usage records"}},"type":"object","required":["product_id","organization_consumer_id","usage_amount","source_event_id"],"title":"MeterUsageRecordRequest","description":"Request to record a single usage event.\n\nUsage timestamp is automatically set to the current time when the record is processed."},"MeteredSubscriptionCreateRequest":{"properties":{"product_id":{"type":"string","format":"uuid","title":"Product Id","description":"METERED product ID (product.price is the price per unit)"},"organization_consumer_id":{"type":"string","format":"uuid","title":"Organization Consumer Id","description":"Organization consumer ID"},"starts_at":{"type":"string","format":"date-time","nullable":true,"description":"When subscription becomes effective (defaults to now)"},"ends_at":{"type":"string","format":"date-time","nullable":true,"description":"When subscription expires (null = no expiry)"}},"type":"object","required":["product_id","organization_consumer_id"],"title":"MeteredSubscriptionCreateRequest","description":"Request to create a metered subscription.\n\nPrice per unit comes from product.price (currently FIXED_PER_UNIT)."},"MeteredSubscriptionListItemResponse":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"id":{"type":"string","format":"uuid","title":"Id"},"product_id":{"type":"string","format":"uuid","title":"Product Id"},"organization_consumer_id":{"type":"string","format":"uuid","title":"Organization Consumer Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"starts_at":{"type":"string","format":"date-time","title":"Starts At"},"ends_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","nullable":true},"product":{"$ref":"#/components/schemas/ProductDto","description":"Product details"},"organization_consumer":{"$ref":"#/components/schemas/app__subscription__v2__dtos__OrganizationConsumer","description":"Organization consumer details"},"current_period_start":{"type":"string","format":"date-time","title":"Current Period Start","description":"Start of the current billing period"},"current_period_end":{"type":"string","format":"date-time","title":"Current Period End","description":"End of the current billing period"},"current_usage":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Current usage amount for the active billing period. Omitted unless include_usage=true."}},"type":"object","title":"MeteredSubscriptionListItemResponse","description":"Response item for listing metered subscriptions."},"MeteredSubscriptionResponse":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"id":{"type":"string","format":"uuid","title":"Id"},"product_id":{"type":"string","format":"uuid","title":"Product Id"},"organization_consumer_id":{"type":"string","format":"uuid","title":"Organization Consumer Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"starts_at":{"type":"string","format":"date-time","title":"Starts At"},"ends_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","nullable":true}},"type":"object","title":"MeteredSubscriptionResponse","description":"Response for metered subscription."},"MultiplePaymentsInTransactionErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/StreamError","nullable":true},"payment_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Payment Ids","description":"List of payment IDs that were paid in the same transaction"},"total_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Amount","description":"Total amount of all payments in the transaction"}},"type":"object","title":"MultiplePaymentsInTransactionErrorResponse","description":"Error response for payment refund operations when multiple payments are in a single transaction."},"NextInvoicePreview":{"properties":{"period_start":{"type":"string","format":"date-time","title":"Period Start","description":"Period start of the next invoice"},"period_end":{"type":"string","format":"date-time","title":"Period End","description":"Period end of the next invoice"},"issue_at":{"type":"string","format":"date-time","title":"Issue At","description":"When the next invoice will be issued (notification time)"},"due_at":{"type":"string","format":"date-time","title":"Due At","description":"When the next invoice will be due"},"subtotal":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Subtotal","description":"Subtotal before discounts"},"discount_total":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discount Total","description":"Sum of all discounts"},"total_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Amount","description":"Total amount payable"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency of the next invoice"}},"type":"object","title":"NextInvoicePreview","description":"The first invoice that will be issued under the new plan, fully precomputed."},"OrganizationConsumerType":{"type":"string","enum":["INDIVIDUAL","BUSINESS"],"title":"OrganizationConsumerType"},"OrganizationCurrencyConfigDTO":{"properties":{"home_currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Settlement/reporting currency. Always SAR for Moyasar settlements.","default":"SAR"},"default_currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Default currency for new invoices and products.","default":"SAR"},"enabled_currencies":{"items":{"$ref":"#/components/schemas/CurrencyCode"},"type":"array","minItems":1,"title":"Enabled Currencies","description":"List of currencies enabled for billing. Must include at least one.","default":["SAR"]}},"type":"object","title":"OrganizationCurrencyConfigDTO","description":"DTO for organization currency configuration."},"OrganizationInviteCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Email address of the user to invite. May already be registered; rejected only if they are already a member of this organization."},"bindings":{"items":{"$ref":"#/components/schemas/BindingInput"},"type":"array","minItems":1,"title":"Bindings"}},"type":"object","required":["email","bindings"],"title":"OrganizationInviteCreate"},"OrganizationInviteResponse":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","format":"email","title":"Email"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"expire_at":{"type":"string","format":"date-time","title":"Expire At"},"created_by":{"type":"string","format":"uuid","title":"Created By"},"bindings":{"items":{"$ref":"#/components/schemas/BindingInput"},"type":"array","title":"Bindings"}},"type":"object","title":"OrganizationInviteResponse"},"Pagination":{"properties":{"total_count":{"type":"integer","title":"Total Count"},"max_page":{"type":"integer","title":"Max Page"},"current_page":{"type":"integer","title":"Current Page"},"limit":{"type":"integer","title":"Limit"},"has_next_page":{"type":"boolean","title":"Has Next Page"},"has_previous_page":{"type":"boolean","title":"Has Previous Page"}},"type":"object","title":"Pagination"},"PaymentDto":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the payment"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount","description":"Payment amount"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency code for the payment (e.g., SAR, USD)"},"scheduled_on":{"type":"string","format":"date-time","title":"Scheduled On","description":"Scheduled date and time for the payment"},"invoice_payment_number":{"type":"integer","title":"Invoice Payment Number","description":"Payment number within the invoice"},"type":{"$ref":"#/components/schemas/PaymentTypeEnum","description":"Type of payment"},"payment_method":{"$ref":"#/components/schemas/PaymentMethod","nullable":true,"description":"Payment method used"},"pos_transaction_id":{"type":"string","nullable":true,"description":"Transaction/network reference ID for card/POS payments"},"current_status":{"$ref":"#/components/schemas/PaymentStatusEnum","description":"Current status of the payment"},"payed_at":{"type":"string","format":"date-time","nullable":true,"description":"Date and time when the payment was completed"},"settled_at":{"type":"string","format":"date-time","nullable":true,"description":"Date and time when the payment was settled"},"refunded_at":{"type":"string","format":"date-time","nullable":true,"description":"Date and time when the payment was refunded"},"amount_refunded":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Refunded","description":"Sum of all refund rows for this payment","default":"0"},"refunds":{"items":{"$ref":"#/components/schemas/PaymentRefundResponse"},"type":"array","title":"Refunds","description":"Refund history for this payment"},"pdf_link":{"type":"string","nullable":true,"description":"URL to the payment PDF document"},"paid_to_account_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the account the payment was made to"},"amount_in_smallest_unit":{"type":"integer","title":"Amount In Smallest Unit","description":"Payment amount in smallest currency unit (e.g. halala for SAR).","readOnly":true}},"type":"object","title":"PaymentDto"},"PaymentFlow":{"type":"string","enum":["ALL","AUTO","MANUAL"],"title":"PaymentFlow"},"PaymentLinkDetailed":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the payment link"},"name":{"type":"string","title":"Name","description":"Name of the payment link"},"description":{"type":"string","nullable":true,"description":"Description of the payment link"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount","description":"Total payment link amount after discounts"},"original_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Original Amount","description":"Original payment link amount before discounts"},"item_level_discounted_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Item Level Discounted Amount","description":"Total amount discounted at the item level"},"coupon_calculation_metadata":{"$ref":"#/components/schemas/CouponCalculationMetadataDto","nullable":true,"description":"Metadata about how coupons were applied to the payment link"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency code for the payment link (e.g., SAR, USD)"},"home_currency_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Amount in home currency (SAR) at creation; for SAR links or when converted from other currencies."},"exchange_rate_at_creation":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Exchange rate from link currency to home currency (SAR) at creation time"},"max_number_of_payments":{"type":"integer","nullable":true,"description":"Maximum number of times this payment link can be used"},"valid_until":{"type":"string","format":"date-time","nullable":true,"description":"UTC datetime after which the payment link is no longer valid"},"created_resource_effective_at":{"type":"string","format":"date-time","nullable":true,"description":"UTC datetime when the resource created from this payment link becomes effective"},"confirmation_message":{"type":"string","nullable":true,"description":"Message to display to the payer after successful payment"},"recurring_interval":{"$ref":"#/components/schemas/SubscriptionRecurringInterval","nullable":true,"description":"Billing cycle interval if this payment link creates a subscription"},"recurring_interval_count":{"type":"integer","nullable":true,"description":"Number of intervals per billing cycle for recurring payments"},"trial_period_days":{"type":"integer","nullable":true,"description":"Free trial duration (in days) for subscriptions created from this link. Only meaningful for recurring (subscription) products. When set, each consumer who subscribes via this link gets a free trial of this length, after which the first real billing period begins. Must be between 1 and 365."},"status":{"$ref":"#/components/schemas/PaymentLinkStatus","description":"Current status of the payment link"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"user_id":{"type":"string","format":"uuid4","title":"User Id","description":"Unique identifier (UUID) of the user who created the payment link"},"organization_consumer_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the organization consumer if linked to a specific consumer"},"deactivate_message":{"type":"string","nullable":true,"description":"Message to display when the payment link is deactivated"},"custom_fields":{"type":"object","title":"properties","description":"Custom fields schema for collecting additional information","example":{"properties":{"child_name":{"title":"Child Name","type":"string"},"parent_email":{"title":"Parent Email","type":"string"}},"required":["child_name"],"type":"object"},"nullable":true},"success_redirect_url":{"type":"string","nullable":true,"description":"URL to redirect the payer to after a successful payment"},"failure_redirect_url":{"type":"string","nullable":true,"description":"URL to redirect the payer to after a failed payment"},"custom_metadata":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object","nullable":true,"description":"The key-value metadata dictionary passed during creation."},"contact_information_type":{"$ref":"#/components/schemas/ContactInformationType","nullable":true,"description":"Type of contact information required for payment collection"},"items":{"items":{"$ref":"#/components/schemas/PaymentLinkItemDto"},"type":"array","title":"Items","description":"List of products included in the payment link"},"coupons":{"items":{"$ref":"#/components/schemas/CouponDto"},"type":"array","title":"Coupons","description":"List of coupons applied to the payment link"},"override_payment_methods":{"$ref":"#/components/schemas/PaymentMethodDto","nullable":true,"description":"Payment methods override for this payment link"},"installment_rule_override_id":{"type":"string","format":"uuid4","nullable":true,"description":"ID of the installment rule used as an override at checkout instead of the default"},"installments_start_date":{"type":"string","format":"date-time","nullable":true,"description":"Date used to anchor subsequent installment due dates at checkout"},"url":{"type":"string","title":"Url","description":"Public URL of the payment link for sharing with payers"},"amount_collected":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Collected","description":"Total amount collected from payments"},"documents":{"items":{"$ref":"#/components/schemas/PaymentLinkDocumentDto"},"type":"array","title":"Documents","description":"Documents attached to the payment link"},"form":{"$ref":"#/components/schemas/FormNestedDto","nullable":true,"description":"Custom form attached to the payment link, if any"},"amount_in_smallest_unit":{"type":"integer","title":"Amount In Smallest Unit","description":"Payment link amount in smallest currency unit (e.g. halala for SAR).","readOnly":true},"original_amount_in_smallest_unit":{"type":"integer","title":"Original Amount In Smallest Unit","description":"Original payment link amount (before discounts) in smallest currency unit.","readOnly":true},"amount_collected_in_smallest_unit":{"type":"integer","title":"Amount Collected In Smallest Unit","description":"Total amount collected in smallest currency unit.","readOnly":true}},"type":"object","title":"PaymentLinkDetailed"},"PaymentLinkDocumentDto":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the document"},"name":{"type":"string","title":"Name","description":"Original filename of the uploaded document"},"file_url":{"type":"string","title":"File Url","description":"Public URL of the uploaded document"},"content_type":{"type":"string","title":"Content Type","description":"MIME type of the document"},"size_bytes":{"type":"integer","title":"Size Bytes","description":"Size of the document in bytes"}},"type":"object","title":"PaymentLinkDocumentDto"},"PaymentLinkItemDto":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the payment link item"},"product_id":{"type":"string","format":"uuid4","title":"Product Id","description":"Unique identifier (UUID) of the product"},"quantity":{"type":"integer","title":"Quantity","description":"Quantity of the product in this payment link item"},"original_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Original Amount","description":"Original amount before discounts"},"discounted_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discounted Amount","description":"Amount after discounts are applied"},"coupon_calculation_metadata":{"$ref":"#/components/schemas/CouponCalculationMetadataDto","nullable":true,"description":"Metadata about how coupons were applied to this item"},"product":{"$ref":"#/components/schemas/ProductDto","description":"Product details for this payment link item"},"allow_custom_quantity":{"type":"boolean","title":"Allow Custom Quantity","description":"Whether customers can select custom quantity for this item","default":false},"min_quantity":{"type":"integer","nullable":true,"description":"Minimum quantity allowed if allow_custom_quantity is True"},"max_quantity":{"type":"integer","nullable":true,"description":"Maximum quantity allowed if allow_custom_quantity is True"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency code for this item (e.g., SAR, USD)"},"product_price_id":{"type":"string","format":"uuid4","nullable":true,"description":"Reference to the ProductPrice used for this item, if any"},"original_amount_in_smallest_unit":{"type":"integer","title":"Original Amount In Smallest Unit","description":"Original item amount in smallest currency unit.","readOnly":true},"discounted_amount_in_smallest_unit":{"type":"integer","title":"Discounted Amount In Smallest Unit","description":"Discounted item amount in smallest currency unit.","readOnly":true}},"type":"object","title":"PaymentLinkItemDto"},"PaymentLinkStatus":{"type":"string","enum":["INACTIVE","ACTIVE","COMPLETED"],"title":"PaymentLinkStatus"},"PaymentMarkPaidRequest":{"properties":{"payment_method":{"$ref":"#/components/schemas/PaymentMethod","description":"Manual payment method used. Automated payment methods (e.g., MADA, VISA, MASTERCARD) are not allowed."},"note":{"type":"string","maxLength":512,"nullable":true,"description":"Optional note or reference number for the payment (e.g., transaction ID, receipt number)"},"pos_transaction_id":{"type":"string","maxLength":512,"nullable":true,"description":"Optional transaction/network reference ID. Only allowed when payment_method is CARD."},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount","description":"Amount paid now. Omit or set equal to payment.amount for a full mark-as-paid. If less than payment.amount, the payment is split: this amount becomes SUCCEEDED and a new PENDING SPLIT_REMAINDER payment is created for the remainder (remainder must be greater than 1 in the payment currency). Partial mark-as-paid is not allowed while the payment is UNDER_REVIEW."}},"type":"object","required":["payment_method"],"title":"PaymentMarkPaidRequest"},"PaymentMarkPaidResponse":{"properties":{},"type":"object","title":"PaymentMarkPaidResponse"},"PaymentMethod":{"type":"string","enum":["MADA","MASTERCARD","VISA","APPLE_PAY","SAMSUNG_PAY","AMEX","CASH","PGW_CARD_UNSPECIFIED","BANK_TRANSFER","CARD","QURRAH","BNPL"],"title":"PaymentMethod"},"PaymentMethodDto":{"properties":{"visa":{"type":"boolean","title":"Visa","description":"visa is enabled","default":false},"mastercard":{"type":"boolean","title":"Mastercard","description":"mastercard is enabled","default":false},"amex":{"type":"boolean","title":"Amex","description":"amex is enabled","default":false},"bank_transfer":{"type":"boolean","title":"Bank Transfer","description":"bank_transfer is enabled","default":false},"installment":{"type":"boolean","title":"Installment","description":"installment is enabled","default":false},"bnpl":{"type":"boolean","title":"Bnpl","description":"Enable BNPL (e.g. Tamara) for this payment link","default":false}},"type":"object","title":"PaymentMethodDto"},"PaymentMethodEnum":{"type":"string","enum":["OPENBANKING","PAYMENTGATEWAY"],"title":"PaymentMethodEnum"},"PaymentRefundReason":{"type":"string","enum":["REQUESTED_BY_CUSTOMER","DUPLICATE","FRAUDULENT","OTHER"],"title":"PaymentRefundReason"},"PaymentRefundRequest":{"properties":{"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount","description":"Amount to refund. Omit for full remaining refundable balance (payment.amount - sum of existing refunds). Must be > 0 and not exceed remaining."},"refund_reason":{"$ref":"#/components/schemas/PaymentRefundReason","description":"Reason for the refund"},"refund_note":{"type":"string","maxLength":512,"nullable":true,"description":"Optional note explaining the refund reason"},"payment_is_part_of_related_set":{"type":"boolean","title":"Payment Is Part Of Related Set","description":"Set to true when this payment belongs to a related payment set and the refund should be applied across that set in order.","default":false}},"type":"object","required":["refund_reason"],"title":"PaymentRefundRequest"},"PaymentRefundResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Unique identifier of the refund row"},"amount_refunded":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Refunded","description":"Amount refunded in this refund"},"refunded_at":{"type":"string","format":"date-time","title":"Refunded At","description":"When this refund was recorded"},"refund_reason":{"$ref":"#/components/schemas/PaymentRefundReason","nullable":true,"description":"Reason for the refund if applicable"},"refund_note":{"type":"string","nullable":true,"description":"Note explaining the refund if applicable"}},"type":"object","title":"PaymentRefundResponse"},"PaymentResponse":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"id":{"type":"string","format":"uuid","title":"Id","description":"Unique identifier (UUID) of the payment"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount","description":"Payment amount"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency code for the payment (e.g., SAR, USD)","default":"SAR"},"scheduled_on":{"type":"string","title":"Scheduled On","description":"Scheduled date and time for the payment"},"type":{"$ref":"#/components/schemas/PaymentTypeEnum","description":"Type of payment"},"payment_method":{"$ref":"#/components/schemas/PaymentMethod","nullable":true,"description":"Payment method used"},"current_status":{"$ref":"#/components/schemas/PaymentStatusEnum","description":"Current status of the payment"},"payed_at":{"type":"string","format":"date-time","nullable":true,"description":"Date and time when the payment was completed"},"refunded_at":{"type":"string","format":"date-time","nullable":true,"description":"Date and time of the most recent refund"},"refund_reason":{"$ref":"#/components/schemas/PaymentRefundReason","nullable":true,"description":"Reason for the most recent refund if set"},"refund_note":{"type":"string","nullable":true,"description":"Note for the most recent refund if set"},"amount_refunded":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Refunded","description":"Sum of all refund rows for this payment","default":"0"},"refunds":{"items":{"$ref":"#/components/schemas/PaymentRefundResponse"},"type":"array","title":"Refunds","description":"Refund history for this payment"},"latest_pgw_message":{"type":"string","nullable":true,"description":"Latest payment gateway message for this payment"},"pos_transaction_id":{"type":"string","nullable":true,"description":"Transaction/network reference ID for card/POS payments"},"amount_in_smallest_unit":{"type":"integer","title":"Amount In Smallest Unit","description":"Payment amount in smallest currency unit (e.g. halala for SAR).","readOnly":true}},"type":"object","title":"PaymentResponse"},"PaymentStatusEnum":{"type":"string","enum":["PENDING","PROCESSING","FAILED_INITIATION","SUCCEEDED","FAILED","CANCELED","UNDER_REVIEW","EXPIRED","SETTLED","REFUNDED","PARTIALLY_REFUNDED"],"title":"PaymentStatusEnum"},"PaymentTypeEnum":{"type":"string","enum":["INITIAL","INSTALLMENT","SPLIT_PREPAID","SPLIT_REMAINDER"],"title":"PaymentTypeEnum"},"PendingPlanChange":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"Pending change identifier"},"effective_at":{"type":"string","format":"date-time","title":"Effective At","description":"When this change will take effect (subscription period end)"},"invoice_was_reissued":{"type":"boolean","title":"Invoice Was Reissued","description":"True if the next-cycle invoice had to be cancelled and recreated to reflect this change"},"target_items":{"items":{"$ref":"#/components/schemas/PendingPlanChangeItemPreview"},"type":"array","title":"Target Items","description":"Items the subscription will have after the change is applied"},"target_subscription_coupon_ids":{"items":{"type":"string","format":"uuid4"},"type":"array","title":"Target Subscription Coupon Ids","description":"Subscription-level coupons that will be active after the change"},"target_recurring_interval":{"$ref":"#/components/schemas/SubscriptionRecurringInterval","description":"Billing interval after the change"},"target_recurring_interval_count":{"type":"integer","title":"Target Recurring Interval Count","description":"Billing interval multiplier after the change"},"target_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Target Amount","description":"Total amount per cycle under the new plan"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency of all monetary fields here"},"current_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Current Amount","description":"Subscription's current per-cycle amount"},"delta_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Delta Amount","description":"target_amount - current_amount"},"delta_amount_per_month":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"target_amount - current_amount, normalised to a monthly rate. Useful for displaying interval flips in like-for-like terms."},"changes":{"items":{"$ref":"#/components/schemas/PendingPlanChangeDiffEntry"},"type":"array","title":"Changes","description":"Human-renderable, server-computed list of changes"},"next_invoice_preview":{"$ref":"#/components/schemas/NextInvoicePreview","description":"Fully precomputed next invoice that will be billed under the new plan"}},"type":"object","title":"PendingPlanChange","description":"Server-computed snapshot of a deferred plan change for client display."},"PendingPlanChangeDiffEntry":{"properties":{"kind":{"$ref":"#/components/schemas/PendingPlanChangeDiffKind","description":"Classification of this diff entry"},"label":{"type":"string","title":"Label","description":"Pre-formatted, locale-neutral label suitable for display"},"product_id":{"type":"string","format":"uuid4","nullable":true,"description":"Affected product, if applicable"},"from_value":{"type":"string","nullable":true,"description":"Pre-change value, if applicable"},"to_value":{"type":"string","nullable":true,"description":"Post-change value, if applicable"}},"type":"object","title":"PendingPlanChangeDiffEntry","description":"A single human-renderable diff row, computed server-side."},"PendingPlanChangeDiffKind":{"type":"string","enum":["PRODUCT_ADDED","PRODUCT_REMOVED","PRODUCT_REPLACED","QUANTITY_DECREASED","QUANTITY_INCREASED","COUPON_ADDED","COUPON_REMOVED","INTERVAL_CHANGED"],"title":"PendingPlanChangeDiffKind","description":"Server-classified diff entry kinds for a pending plan change."},"PendingPlanChangeItemPreview":{"properties":{"product_id":{"type":"string","format":"uuid4","title":"Product Id","description":"Product UUID"},"product_name":{"type":"string","title":"Product Name","description":"Product display name"},"quantity":{"type":"integer","title":"Quantity","description":"Quantity that will be billed under the new plan"},"original_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Original Amount","description":"Per-item original amount in subscription currency"},"discounted_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discounted Amount","description":"Per-item amount after item-level discounts"}},"type":"object","title":"PendingPlanChangeItemPreview"},"PortalSessionResponse":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","title":"PortalSessionResponse"},"ProductCreate":{"properties":{"name":{"type":"string","maxLength":160,"minLength":1,"title":"Name","description":"Name of the product."},"description":{"type":"string","maxLength":512,"minLength":1,"nullable":true,"description":"Description of the product."},"price":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Price","description":"[DEPRECATED] Price of the product. Use 'prices' array for multi-currency support.","deprecated":true},"prices":{"items":{"$ref":"#/components/schemas/ProductPriceInlineCreate"},"type":"array","nullable":true,"description":"Prices for the product in different currencies. At least one price is required."},"is_one_time":{"type":"boolean","title":"Is One Time","description":"Will this product be used only one time in one invoice?","default":false},"type":{"$ref":"#/components/schemas/ProductType","description":"the type of product: one off or recurring"},"recurring_interval":{"$ref":"#/components/schemas/RecurringInterval","nullable":true,"description":"Represents the billing cycle interval if product is recurring. Required for cyclic products. For ONE_OFF, value is ignored."},"recurring_interval_count":{"type":"integer","minimum":1.0,"title":"Recurring Interval Count","description":"The billing cycle multiple if the product is recurring","default":1},"is_price_exempt_from_vat":{"type":"boolean","title":"Is Price Exempt From Vat","description":"Is the price exempt from VAT?","default":false},"is_price_inclusive_of_vat":{"type":"boolean","title":"Is Price Inclusive Of Vat","description":"[DEPRECATED] This field will be removed; non-exempt prices will be assumed inclusive.","default":true,"deprecated":true},"external_metadata":{"$ref":"#/components/schemas/ExternalMetadataStorage","description":"Flat key-value external metadata. Keys: ASCII letters/digits/underscore/hyphen, start with a letter, max 64 chars. Values: strings up to 128 chars in any language (no nested objects)."},"accounting_external_id":{"type":"string","maxLength":512,"nullable":true,"description":"The accounting system's own item id (e.g. Zoho item_id) for a pre-existing product this product should be linked to instead of creating a new one."}},"type":"object","required":["name","type"],"title":"ProductCreate"},"ProductDto":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the product"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"name":{"type":"string","maxLength":160,"minLength":1,"title":"Name","description":"Name of the product."},"description":{"type":"string","maxLength":512,"nullable":true,"description":"Description of the product."},"type":{"$ref":"#/components/schemas/ProductType","description":"the type of product: one off or recurring"},"recurring_interval":{"$ref":"#/components/schemas/RecurringInterval","nullable":true,"description":"Represents the billing cycle interval if product is recurring"},"recurring_interval_count":{"type":"integer","title":"Recurring Interval Count","description":"The billing cycle multiple if the product is recurring"},"price":{"type":"string","title":"Price","description":"Total price including VAT (default currency)."},"currency":{"type":"string","enum":["AED","AFN","ALL","AMD","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAD","XAF","XCD","XCG","XOF","XPF","XSU","XUA","YER","ZAR","ZMW","ZWG"],"maxLength":3,"minLength":3,"title":"Currency","description":"Default price currency of the product.","default":"SAR"},"is_price_exempt_from_vat":{"type":"boolean","title":"Is Price Exempt From Vat","description":"Is the default price exempt from VAT?"},"is_price_inclusive_of_vat":{"type":"boolean","title":"Is Price Inclusive Of Vat","description":"[DEPRECATED] This field will be removed; non-exempt prices will be assumed inclusive.","deprecated":true},"price_excluding_vat":{"type":"string","title":"Price Excluding Vat","description":"[DEPRECATED] Default price excluding VAT. VAT will be calculated on invoice.","deprecated":true},"vat_amount":{"type":"string","title":"Vat Amount","description":"[DEPRECATED] VAT amount for default price. VAT will be calculated on invoice.","deprecated":true},"prices":{"items":{"$ref":"#/components/schemas/ProductPriceInlineDto"},"type":"array","title":"Prices","description":"All active prices for this product across different currencies."},"is_active":{"type":"boolean","title":"Is Active","description":"Can this product be used in invoices or subscriptions?"},"is_one_time":{"type":"boolean","title":"Is One Time","description":"Shows if the product was created to be used once, and not to be added to product cataloge"},"is_used_in_finalized_invoice":{"type":"boolean","title":"Is Used In Finalized Invoice","description":"Is the product used in a finalized invoice?","default":false},"external_metadata":{"$ref":"#/components/schemas/ExternalMetadataStorage","description":"Flat key-value external metadata. Keys: ASCII letters/digits/underscore/hyphen, start with a letter, max 64 chars. Values: strings up to 128 chars in any language (no nested objects)."},"accounting_external_id":{"type":"string","nullable":true,"description":"The accounting system's own item id this product is linked to, if any"}},"type":"object","title":"ProductDto","description":"Product response DTO.\n\nThis DTO includes both legacy single-price fields and new multi-currency `prices` array\nfor backward compatibility with existing API consumers.\n\nLegacy fields (`price`, `currency`, `vat_amount`, etc.) represent the default price\nand are kept for backward compatibility. New integrations should use the `prices` array."},"ProductPriceCreate":{"properties":{"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"ISO 4217 currency code"},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount","description":"Price amount (must be >= 1 for non-metered products; metered products can use up to 12 decimal places)"},"is_price_inclusive_of_vat":{"type":"boolean","title":"Is Price Inclusive Of Vat","description":"[DEPRECATED] This field will be removed; non-exempt prices will be assumed inclusive.","default":true,"deprecated":true},"is_price_exempt_from_vat":{"type":"boolean","title":"Is Price Exempt From Vat","description":"If True, no VAT applies to this price","default":false}},"type":"object","required":["currency","amount"],"title":"ProductPriceCreate","description":"DTO for creating a new product price."},"ProductPriceDto":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"amount":{"type":"string","title":"Amount"},"is_active":{"type":"boolean","title":"Is Active"},"is_price_inclusive_of_vat":{"type":"boolean","title":"Is Price Inclusive Of Vat","description":"[DEPRECATED] This field will be removed; non-exempt prices will be assumed inclusive.","deprecated":true},"is_price_exempt_from_vat":{"type":"boolean","title":"Is Price Exempt From Vat"},"price_excluding_vat":{"type":"string","title":"Price Excluding Vat","description":"[DEPRECATED] Net amount excluding VAT. VAT will be calculated on invoice.","deprecated":true},"vat_amount":{"type":"string","title":"Vat Amount","description":"[DEPRECATED] VAT amount. VAT will be calculated on invoice.","deprecated":true},"amount_in_smallest_unit":{"type":"integer","title":"Amount In Smallest Unit","description":"Price amount in smallest currency unit (e.g. halala for SAR).","readOnly":true}},"type":"object","title":"ProductPriceDto","description":"DTO for product price response."},"ProductPriceInlineCreate":{"properties":{"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"ISO 4217 currency code"},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount","description":"Price amount (must be >= 1 for non-metered products; metered products can use up to 12 decimal places)"},"is_price_inclusive_of_vat":{"type":"boolean","title":"Is Price Inclusive Of Vat","description":"[DEPRECATED] This field will be removed; non-exempt prices will be assumed inclusive.","default":true,"deprecated":true},"is_price_exempt_from_vat":{"type":"boolean","title":"Is Price Exempt From Vat","description":"If True, no VAT applies to this price","default":false}},"type":"object","required":["currency","amount"],"title":"ProductPriceInlineCreate","description":"Inline price creation for product create/update endpoints."},"ProductPriceInlineDto":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"amount":{"type":"string","title":"Amount"},"is_active":{"type":"boolean","title":"Is Active"},"is_price_inclusive_of_vat":{"type":"boolean","title":"Is Price Inclusive Of Vat","description":"[DEPRECATED] This field will be removed; non-exempt prices will be assumed inclusive.","deprecated":true},"is_price_exempt_from_vat":{"type":"boolean","title":"Is Price Exempt From Vat"},"price_excluding_vat":{"type":"string","title":"Price Excluding Vat","description":"[DEPRECATED] Net amount excluding VAT. VAT will be calculated on invoice.","deprecated":true},"vat_amount":{"type":"string","title":"Vat Amount","description":"[DEPRECATED] VAT amount. VAT will be calculated on invoice.","deprecated":true}},"type":"object","title":"ProductPriceInlineDto","description":"Inline price DTO for product responses."},"ProductPriceUpdate":{"properties":{"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount","description":"Price amount (must be >= 1 for non-metered products; metered products can use up to 12 decimal places)"},"is_price_inclusive_of_vat":{"type":"boolean","nullable":true,"description":"[DEPRECATED] This field will be removed; non-exempt prices will be assumed inclusive."},"is_price_exempt_from_vat":{"type":"boolean","nullable":true,"description":"If True, no VAT applies to this price"}},"type":"object","title":"ProductPriceUpdate","description":"DTO for updating a product price."},"ProductType":{"type":"string","enum":["RECURRING","ONE_OFF","METERED"],"title":"ProductType"},"ProductUpdate":{"properties":{"name":{"type":"string","maxLength":160,"minLength":1,"nullable":true,"description":"Name of the product."},"description":{"type":"string","maxLength":512,"minLength":1,"nullable":true,"description":"Description of the product."},"price":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Price","description":"[DEPRECATED] Price of the product. Use 'prices' array for multi-currency support.","deprecated":true},"prices":{"items":{"$ref":"#/components/schemas/ProductPriceInlineCreate"},"type":"array","nullable":true,"description":"Prices for the product in different currencies."},"is_active":{"type":"boolean","nullable":true,"description":"Whether the product is active. If `true`, the product won't be available for purchase anymore. Existing customers will still have access to the product details in the invoice, and subscriptions will continue normally."},"type":{"$ref":"#/components/schemas/ProductType","nullable":true,"description":"the type of product: one off or recurring"},"recurring_interval":{"$ref":"#/components/schemas/RecurringInterval","nullable":true,"description":"Represents the billing cycle interval if product is recurring. Required for cyclic products"},"recurring_interval_count":{"type":"integer","minimum":1.0,"nullable":true,"description":"The billing cycle multiple if the product is recurring"},"is_price_exempt_from_vat":{"type":"boolean","title":"Is Price Exempt From Vat","description":"Is the price exempt from VAT?","default":false},"is_price_inclusive_of_vat":{"type":"boolean","title":"Is Price Inclusive Of Vat","description":"[DEPRECATED] This field will be removed; non-exempt prices will be assumed inclusive.","default":true,"deprecated":true},"external_metadata":{"$ref":"#/components/schemas/ExternalMetadataStorage","description":"Overwrites existing external metadata entirely. To merge values, send the full desired external metadata object."},"accounting_external_id":{"type":"string","maxLength":512,"nullable":true,"description":"The accounting system's own item id for a pre-existing product. Only takes effect when set for the first time (was previously empty); later changes are ignored."}},"type":"object","title":"ProductUpdate"},"RecurrencePattern":{"type":"string","enum":["Hour","Day","Week","Fortnight","Month","Quarter","Half-Year","Year"],"title":"RecurrencePattern"},"RecurringInterval":{"type":"string","enum":["WEEK","MONTH","SEMESTER","YEAR"],"title":"RecurringInterval"},"StreamError":{"properties":{"code":{"$ref":"#/components/schemas/StreamErrorCodes"},"message":{"type":"string","title":"Message"},"additional_info":{"type":"string","nullable":true}},"type":"object","title":"StreamError"},"StreamErrorCodes":{"type":"string","enum":["STREAM_ERROR","STREAM_UNKNOWN_ERROR","PHONE_ALREADY_REGISTERED","MFA_VERIFICATION_SESSION_IN_PROGRESS","MFA_ATTEMPTS_EXHAUSTED","MFA_INVALID","MFA_SESSION_EXPIRED","MFA_CHANNEL_COOLDOWN","RECAPTCHA_INVALID","SAUDI_ID_ALREADY_REGISTERED","USER_INFO_NOT_VERIFIED","COMPANY_NOT_FOUND","ORGANIZATION_ALREADY_CREATED","USER_NOT_REGISTERED","OAUTH_ONLY_ACCOUNT","CONNECTED_APP_TOKEN_INVALID","INVALID_PARAMETERS","INVITATION_EXPIRED","USER_ALREADY_REGISTERED","DISPOSABLE_EMAIL_NOT_ALLOWED","PAYMENT_FLOW_NOT_ALLOWED","INVOICE_PAYMENT_COUNT_NOT_MATCHED","INVOICE_FINALISED","INVOICE_NOT_EXPIRABLE","INVOICE_EXPIRY_CONFLICT","INVOICE_SEND_CONFLICT","INVOICE_ROW_LOCKED","PAYMENT_SUCCESS_CONFLICT","PAYMENT_CLAIM_CONFLICT","INVOICE_CANCEL_CONFLICT","INVOICE_REACTIVATION_CONFLICT","INVOICE_REACTIVATION_BLOCKED","PAYMENT_REFUND_CONFLICT","PAYMENT_REFUND_NOT_RECORDED","PAYMENT_REFUND_BEFORE_SUCCESS","INVOICE_INVALID_STATUS","INVOICE_TOTAL_MISMATCH_PAYMENT_AMOUNT_SUM","INVOICE_CONSENT_CONSUMED","INVOICE_CONSENT_EXPIRED","INVOICE_EXPIRED","PAYMENT_IN_PROGRESS","PAYMENT_FINALIZED","PAYMEND_UNPAID","PAYMENT_REFUNDED_ALREADY","PAYMENT_REFUNDED_FAILED","PAYMENT_REFUND_INSUFFICIENT_BALANCE","PAYMENT_REFUND_WINDOW_EXPIRED","POS_TRANSACTION_ID_REQUIRES_CARD","INVALID_STATUS","ACCOUNT_ONE_DEFAULT_REQUIRED","DUPLICATE_CONSUMER","DUPLICATE_PAYMENT","DUPLICATE_CARD_TOKEN","CONSUMER_HAS_ONGOING_INVOICES","CONSUMER_HAS_ONGOING_SUBSCRIPTIONS","CONSUMER_HAS_ACTIVE_PAYMENT_LINKS","MOYASAR_BAD_REQUEST","NOTIFICATION_TEMPLATE_DOES_NOT_EXIST","FEATURE_DISABLED","INSUFFICIENT_FUNDS","PAYMENT_GATEWAY_DECLINED","MANUAL_INVOICE_CARD_ID","ONE_OFF_INVALID_PAYMENT_FLOW","ONE_OFF_CARD_ID","AUTO_INVOICE_MISSING_CARD_ID","MOYASAR_INVALID_CARD_TOKEN","MOYASAR_UNAUTHORIZED","MOYASAR_FORBIDDEN","MOYASAR_NOT_FOUND","MOYASAR_METHOD_NOT_ALLOWED","MOYASAR_TOO_MANY_REQUESTS","MOYASAR_INTERNAL_SERVER_ERROR","MOYASAR_SERVICE_UNAVAILABLE","MOYASAR_PAYMENT_INFO_MISMATCH","MOYASAR_TIMEOUT","PDF_LINK_EXISTS","BRANCH_NOT_FOUND","BRANCH_ACCESS_DENIED","PERMISSION_FORBIDDEN","PRODUCT_USED_IN_FINALIZED_INVOICE","RESOURCE_ALREADY_EXISTS","COUPON_USED_IN_FINALIZED_INVOICE","COUPON_USED_IN_ACTIVE_PAYMENT_LINK","CONSUMER_CONTACT_INFO_CHANGE_NOT_ALLOWED","WEBHOOK_AUTO_DISABLED","INSTALLMENT_OVERLAPPING_MIN_MAX_RANGES","INSTALLMENT_GLOBAL_CANNOT_SET_BOUNDS","INSTALLMENT_GLOBAL_CANNOT_DISABLE","INSTALLMENT_GLOBAL_CANNOT_DELETE","INSTALLMENT_CUSTOM_REQUIRES_BOUNDS","INSTALLMENT_RULE_MINIMUM_BELOW_SETTINGS_FLOOR","INSTALLMENT_OPTIONS_REQUIRED","INSTALLMENT_INVALID_PERCENTAGE_WEIGHTS","INSTALLMENT_SMALLEST_SHARE_BELOW_MIN","INSTALLMENT_SPLIT_AMOUNT_BELOW_MIN","INSTALLMENT_INSTALLMENTS_NOT_AVAILABLE","INSTALLMENT_SELECTION_NOT_AVAILABLE","INSTALLMENT_OVERRIDE_RULE_NOT_AVAILABLE","INSTALLMENT_TRIAL_VERIFICATION_NOT_ALLOWED","INSTALLMENT_WEIGHTS_REQUIRED","INSTALLMENT_SPLIT_AMOUNT_REQUIRED","INSTALLMENT_UNABLE_TO_COMPUTE_AMOUNT_SPLITS","INSTALLMENT_MAX_INSTALLMENTS_EXCEEDED","SANDBOX_CUSTOMER_CREATION_RESTRICTED","ACCOUNTING_OAUTH_STATE_INVALID","ACCOUNTING_TEST_CONNECTION_FAILED","ACCOUNTING_REFRESH_REQUIRED","ACCOUNTING_CONNECTION_INACTIVE","ACCOUNTING_OAUTH_EXCHANGE_FAILED","ACCOUNTING_ENUM_OPTIONS_MISSING","ACCOUNTING_FIELD_OPTIONS_FETCH_FAILED","ACCOUNTING_ORG_CONFIG_INCOMPLETE","ACCOUNTING_FIELD_INVALID","ACCOUNTING_CONFIG_FIELD_NOT_SEEDED","ACCOUNTING_BRANCHES_NOT_SUPPORTED","ACCOUNTING_BRANCH_PLUGIN_NOT_ENABLED","ACCOUNTING_DOCUMENT_SYNC_FAILED","ACCOUNTING_ANOTHER_PROVIDER_ACTIVE","ACCOUNTING_PARENT_NOT_SYNCED","ACCOUNTING_GATEWAY_RECEIVABLES_AUTOMATIC_POSTING_REQUIRED","ACCOUNTING_GATEWAY_RECEIVABLES_NO_ACTIVE_PROVIDER","ACCOUNTING_GATEWAY_RECEIVABLES_FIELDS_MISSING","ACCOUNTING_GATEWAY_RECEIVABLES_FIELD_REQUIRED","ACCOUNTING_GATEWAY_RECEIVABLES_RECONNECT_REQUIRED","ACCOUNTING_SETTLEMENT_CONNECTION_INACTIVE","ACCOUNTING_SETTLEMENT_CURRENCY_MISMATCH","ACCOUNTING_SETTLEMENT_TOTALS_MISMATCH","ACCOUNTING_SETTLEMENT_UNSUPPORTED_LINE_TYPE","ACCOUNTING_SETTLEMENT_PERIOD_LOCKED","INVOICE_SYNCED_TO_ANOTHER_ACC_PLATFORM","ZATCA_ONBOARDING_IN_PROGRESS","ZATCA_ALREADY_ONBOARDED","ZATCA_CUSTOMER_ADDRESS_INCOMPLETE","ZATCA_NOT_ELIGIBLE","DISCOUNT_RULE_PRODUCT_ALREADY_ASSIGNED","DISCOUNT_RULE_COUPON_PERCENTAGE_TOO_HIGH","DISCOUNT_RULE_COUPON_FIXED_AMOUNT_INVALID","DISCOUNT_RULE_COUPON_CURRENCY_UNAVAILABLE_FOR_PRODUCT","DISCOUNT_RULE_COUPON_INELIGIBLE_AFTER_UPDATE","DISCOUNT_RULE_APPLICABLE_COUPON_MISSING"],"title":"StreamErrorCodes"},"SubscriptionCancel":{"properties":{"cancel_related_invoices":{"type":"boolean","title":"Cancel Related Invoices","description":"Whether or not to cancel all the related invoices to this subscription. If False, only the subscription will be canceled but the related invoices will remain untouched.","default":false}},"type":"object","title":"SubscriptionCancel"},"SubscriptionCreate":{"properties":{"notify_consumer":{"type":"boolean","title":"Notify Consumer","description":"Whether to send a notification to the consumer about the subscription's first invoice","default":true},"description":{"type":"string","maxLength":512,"minLength":1,"nullable":true,"description":"Subscription description or notes"},"items":{"items":{"$ref":"#/components/schemas/SubscriptionItemCreateDto"},"type":"array","minItems":1,"title":"Items","description":"List of products or services to include in the subscription"},"coupons":{"items":{"type":"string","format":"uuid4"},"type":"array","nullable":true,"description":"List of coupon UUIDs to apply for discounts on subscription invoices"},"organization_consumer_id":{"type":"string","format":"uuid4","title":"Organization Consumer Id","description":"UUID of the consumer who will subscribe"},"organization_consumer_beneficiaries":{"items":{"type":"string","format":"uuid4"},"type":"array","nullable":true,"description":"UUID of the beneficiaries to the consumer who will subscribe"},"period_start":{"type":"string","format":"date-time","title":"Period Start","description":"Start date of the first billing cycle. For trial subscriptions, this must be a future date — the trial runs from now until this date."},"until_cycle_number":{"type":"integer","minimum":1.0,"nullable":true,"description":"Number of billing cycles before the subscription automatically cancels. If not specified, the subscription continues indefinitely until manually canceled."},"override_payment_methods":{"$ref":"#/components/schemas/SubscriptionPaymentMethodDto","nullable":true,"description":"Override payment methods for invoices generated by this subscription. Set any field to null to use the organization's global settings for that payment method."},"currency":{"$ref":"#/components/schemas/CurrencyCode","maxLength":3,"minLength":3,"description":"Currency code (e.g., SAR, USD). Must match coupon currency for fixed-amount coupons.","default":"SAR"},"trial":{"type":"boolean","title":"Trial","description":"Whether this is a free trial subscription. If true, the trial starts now and billing begins at period_start.","default":false}},"type":"object","required":["items","organization_consumer_id","period_start"],"title":"SubscriptionCreate"},"SubscriptionDetailed":{"properties":{"created_by_type":{"$ref":"#/components/schemas/CreatedByType","description":"How the object was created: USER (dashboard), API_KEY, CONNECTED_APP, CUSTOMER (payer), ADMIN_PANEL, OPS, SYSTEM (Stream itself), or UNKNOWN (created before this was tracked).","default":"UNKNOWN"},"created_by_id":{"type":"string","format":"uuid","nullable":true,"description":"Unique identifier (UUID) of the user who created the object. For API_KEY it is the key's owner, for CONNECTED_APP the user who connected the app; a placeholder user for CUSTOMER, ADMIN_PANEL, OPS and SYSTEM; null when UNKNOWN."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the subscription"},"organization_id":{"type":"string","format":"uuid4","title":"Organization Id","description":"Unique identifier (UUID) of the organization"},"description":{"type":"string","nullable":true,"description":"Description of the subscription"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount","description":"Total subscription amount after discounts"},"original_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Original Amount","description":"Original subscription amount before discounts"},"item_level_discounted_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Item Level Discounted Amount","description":"Total amount discounted at the item level"},"coupon_calculation_metadata":{"$ref":"#/components/schemas/CouponCalculationMetadataDto","nullable":true,"description":"Metadata about how coupons were applied to the subscription"},"remaining_days":{"type":"integer","title":"Remaining Days","description":"Number of days remaining in the current billing period"},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency code for the subscription (e.g., SAR, USD)"},"home_currency_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Amount in home currency (SAR) at creation"},"exchange_rate_at_creation":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","nullable":true,"description":"Exchange rate used at subscription creation"},"recurring_interval":{"$ref":"#/components/schemas/SubscriptionRecurringInterval","description":"Billing cycle interval"},"recurring_interval_count":{"type":"integer","title":"Recurring Interval Count","description":"Number of intervals per billing cycle (e.g., 2 for bi-monthly)"},"status":{"$ref":"#/components/schemas/SubscriptionStatus","description":"Current status of the subscription"},"current_period_start":{"type":"string","format":"date-time","title":"Current Period Start","description":"Start date and time of the current billing period"},"current_period_end":{"type":"string","format":"date-time","title":"Current Period End","description":"End date and time of the current billing period"},"current_cycle_number":{"type":"integer","title":"Current Cycle Number","description":"Current cycle number of the subscription"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","description":"Whether the subscription will be canceled at the end of the current period"},"cancel_at_cycle_number":{"type":"integer","nullable":true,"description":"Cycle number at which the subscription will be automatically canceled"},"started_at":{"type":"string","format":"date-time","nullable":true,"description":"Date and time when the subscription started"},"ended_at":{"type":"string","format":"date-time","nullable":true,"description":"Date and time when the subscription ended"},"user_id":{"type":"string","format":"uuid4","title":"User Id","description":"Unique identifier (UUID) of the user who created the subscription"},"organization_consumer_id":{"type":"string","format":"uuid4","title":"Organization Consumer Id","description":"Unique identifier (UUID) of the organization consumer"},"latest_invoice_id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the most recent invoice for this subscription"},"trial_period_days":{"type":"integer","nullable":true,"description":"Number of days for the free trial period"},"trial_end":{"type":"string","format":"date-time","nullable":true,"description":"Date and time when the trial period ends"},"organization_consumer":{"$ref":"#/components/schemas/app__subscription__v2__dtos__OrganizationConsumer","nullable":true,"description":"Consumer information for this subscription"},"items":{"items":{"$ref":"#/components/schemas/SubscriptionItemDto"},"type":"array","nullable":true,"description":"List of items included in the subscription"},"latest_invoice":{"$ref":"#/components/schemas/InvoiceBase","nullable":true,"description":"Most recent invoice generated for this subscription"},"latest_freeze":{"$ref":"#/components/schemas/FreezeSubscriptionBase","nullable":true,"description":"Most recent freeze period applied to this subscription"},"override_payment_methods":{"$ref":"#/components/schemas/SubscriptionPaymentMethodDto","nullable":true,"description":"Payment methods override for this subscription"},"pending_change":{"$ref":"#/components/schemas/PendingPlanChange","nullable":true,"description":"A scheduled deferred change that will be applied at current_period_end, if any"},"beneficiaries":{"items":{"$ref":"#/components/schemas/BeneficiaryLink"},"type":"array","nullable":true,"description":"Beneficiaries linked to this subscription"},"amount_in_smallest_unit":{"type":"integer","title":"Amount In Smallest Unit","description":"Subscription amount in smallest currency unit (e.g. halala for SAR).","readOnly":true},"original_amount_in_smallest_unit":{"type":"integer","title":"Original Amount In Smallest Unit","description":"Original subscription amount (before discounts) in smallest currency unit.","readOnly":true}},"type":"object","title":"SubscriptionDetailed"},"SubscriptionItemCreateDto":{"properties":{"product_id":{"type":"string","format":"uuid4","title":"Product Id","description":"UUID of the product to include"},"quantity":{"type":"integer","exclusiveMinimum":0.0,"title":"Quantity","description":"Quantity of the product"},"coupons":{"items":{"type":"string","format":"uuid4"},"type":"array","nullable":true,"description":"List of coupon UUIDs to apply for discounts on this specific item"}},"type":"object","required":["product_id","quantity"],"title":"SubscriptionItemCreateDto"},"SubscriptionItemDto":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp of the object."},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Last modification timestamp of the object."},"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the subscription item"},"product_id":{"type":"string","format":"uuid4","title":"Product Id","description":"Unique identifier (UUID) of the product"},"subscription_id":{"type":"string","format":"uuid4","title":"Subscription Id","description":"Unique identifier (UUID) of the subscription"},"quantity":{"type":"integer","title":"Quantity","description":"Quantity of the product in this subscription item"},"original_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Original Amount","description":"Original amount before discounts"},"discounted_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discounted Amount","description":"Amount after discounts are applied"},"coupon_calculation_metadata":{"$ref":"#/components/schemas/CouponCalculationMetadataDto","nullable":true,"description":"Metadata about how coupons were applied to this item"},"product":{"$ref":"#/components/schemas/ProductDto","description":"Product details for this subscription item"}},"type":"object","title":"SubscriptionItemDto"},"SubscriptionPaymentMethodDto":{"properties":{"visa":{"type":"boolean","nullable":true,"description":"override visa from global settings"},"mastercard":{"type":"boolean","nullable":true,"description":"override mastercard from global settings"},"amex":{"type":"boolean","nullable":true,"description":"override amex from global settings"},"bank_transfer":{"type":"boolean","nullable":true,"description":"override bank_transfer from global settings"},"installment":{"type":"boolean","nullable":true,"description":"override installment from global settings"},"qurrah":{"type":"boolean","nullable":true,"description":"override qurrah from global settings"},"subscription_auto_renewal":{"type":"boolean","nullable":true,"description":"Override organization's subscription auto renewal setting. If True, subscription will auto-renew at the end of each period. If False, subscription will be canceled at the end of the current period. If None (default), uses organization's subscription_auto_renewal setting."}},"type":"object","title":"SubscriptionPaymentMethodDto"},"SubscriptionRecurringInterval":{"type":"string","enum":["WEEK","MONTH","QUARTER","YEAR"],"title":"SubscriptionRecurringInterval"},"SubscriptionStatus":{"type":"string","enum":["INACTIVE","ACTIVE","EXPIRED","CANCELED","FROZEN","TRIALING","TRIAL_PENDING"],"title":"SubscriptionStatus"},"SubscriptionUpdate":{"properties":{"description":{"type":"string","maxLength":512,"nullable":true,"description":"Description of the subscription."},"items":{"items":{"$ref":"#/components/schemas/SubscriptionItemCreateDto"},"type":"array","minItems":1,"title":"Items","description":"products to purchaseIf you want to keep existing items, include them in the list."},"coupons":{"items":{"type":"string","format":"uuid4"},"type":"array","minItems":0,"title":"Coupons","description":"coupons to apply to the subscription for discounts.If you want to keep existing coupons, include them in the list."},"until_cycle_number":{"type":"integer","minimum":1.0,"nullable":true,"description":"Number of billing cycles the subscription should run before it auto-cancels. If set to the current cycle, cancellation is scheduled at period end. If set to null, subscription will continue indefinitely until manually canceled."},"override_payment_methods":{"$ref":"#/components/schemas/SubscriptionPaymentMethodDto","nullable":true,"description":"overriden payment methods for generated invoices for the payer - sending 'null' for any value means we should follow organization global settings for that method"},"recurring_interval":{"$ref":"#/components/schemas/SubscriptionRecurringInterval","nullable":true,"description":"Optional new billing interval. If omitted, the current interval is preserved. Use this to flip monthly <-> yearly without re-checkout. Interval changes always take effect at the next cycle (deferred)."},"recurring_interval_count":{"type":"integer","minimum":1.0,"nullable":true,"description":"Optional new interval multiplier. Defaults to the current value if omitted. Same deferral behavior as ``recurring_interval``."}},"type":"object","required":["items","coupons"],"title":"SubscriptionUpdate"},"UpdateBranchRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"New name for the branch. Must be unique within the organization."}},"type":"object","required":["name"],"title":"UpdateBranchRequest"},"UpdatePaymentLinkCouponItemDto":{"properties":{"payment_link_item_id":{"type":"string","format":"uuid4","title":"Payment Link Item Id","description":"Id of an existing payment link item"},"coupons":{"items":{"type":"string","format":"uuid4"},"type":"array","title":"Coupons","description":"Item-level coupons for this item (replaces existing). Omit or [] clears item-level coupons on this item."}},"type":"object","required":["payment_link_item_id"],"title":"UpdatePaymentLinkCouponItemDto"},"UpdatePaymentLinkCouponsDto":{"properties":{"coupons":{"items":{"type":"string","format":"uuid4"},"type":"array","title":"Coupons","description":"Link-level coupons (replaces existing). Omit or [] clears link-level coupons."},"items":{"items":{"$ref":"#/components/schemas/UpdatePaymentLinkCouponItemDto"},"type":"array","title":"Items","description":"Item-level coupons per item listed; omitted items assume no coupons."}},"type":"object","title":"UpdatePaymentLinkCouponsDto"},"UpdatePaymentLinkStatusDto":{"properties":{"status":{"$ref":"#/components/schemas/PaymentLinkStatus","description":"New status for the payment link"},"deactivate_message":{"type":"string","maxLength":512,"nullable":true,"description":"Optional message to display when the payment link is deactivated"}},"type":"object","required":["status"],"title":"UpdatePaymentLinkStatusDto"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","title":"ValidationError"},"app__common__dtos__shared__Consumer":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id"},"phone_number":{"type":"string","format":"phone","nullable":true},"email":{"type":"string","format":"email","nullable":true},"preferred_language":{"$ref":"#/components/schemas/Language"}},"type":"object","title":"Consumer"},"app__common__dtos__shared__OrganizationConsumer":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id"},"name":{"type":"string","title":"Name"},"alias":{"type":"string","nullable":true},"email":{"type":"string","format":"email","nullable":true},"phone_number":{"type":"string","format":"phone","nullable":true},"preferred_language":{"$ref":"#/components/schemas/Language"},"consumer_type":{"$ref":"#/components/schemas/OrganizationConsumerType","default":"INDIVIDUAL"},"address":{"$ref":"#/components/schemas/AddressResponse","nullable":true},"vat_number":{"type":"string","nullable":true},"commercial_registration":{"type":"string","nullable":true},"consumer":{"$ref":"#/components/schemas/app__common__dtos__shared__Consumer","nullable":true},"is_deleted":{"type":"boolean","nullable":true},"communication_methods":{"items":{"$ref":"#/components/schemas/ConsumerCommunicationMethod"},"type":"array","nullable":true}},"type":"object","title":"OrganizationConsumer"},"app__consumer__v2__dtos__Consumer":{"properties":{"id":{"type":"string","format":"uuid4","nullable":true,"description":"Unique identifier (UUID) of the consumer"},"phone_number":{"type":"string","format":"phone","nullable":true,"description":"Phone number of the consumer"},"preferred_language":{"$ref":"#/components/schemas/Language","nullable":true,"description":"Preferred language of the consumer"}},"type":"object","title":"Consumer"},"app__subscription__v2__dtos__OrganizationConsumer":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"Unique identifier (UUID) of the organization consumer"},"name":{"type":"string","title":"Name","description":"Name of the consumer"},"alias":{"type":"string","nullable":true,"description":"Alias of the consumer"},"email":{"type":"string","nullable":true,"description":"Email address of the consumer"},"phone_number":{"type":"string","nullable":true,"description":"Phone number of the consumer"},"preferred_language":{"$ref":"#/components/schemas/Language","nullable":true,"description":"Preferred language of the consumer"},"consumer_type":{"$ref":"#/components/schemas/OrganizationConsumerType","description":"Consumer type (individual or business)","default":"INDIVIDUAL"},"address":{"$ref":"#/components/schemas/AddressResponse","nullable":true,"description":"Business address for business consumers"},"vat_number":{"type":"string","nullable":true,"description":"VAT number for business consumers"},"commercial_registration":{"type":"string","nullable":true,"description":"Commercial registration for business consumers"}},"type":"object","title":"OrganizationConsumer"}},"securitySchemes":{"JWTBearer":{"type":"http","scheme":"bearer"},"APIKey":{"type":"apiKey","in":"header","name":"x-api-key"}}}}