{"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.\nOrganization admins can invite users to any branch, while branch admins can only invite to their own branches.","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 all branches for the organization.\n\nReturns branches based on user role:\n- Organization admins see all branches in the organization\n- Branch admins and branch users see only branches they're assigned to","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 number, alias, or external_id\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}":{"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":"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.\n\nRecord a payment received through manual methods (CASH, BANK_TRANSFER, CARD, or QURRAH).\n\n**Requirements:**\n- Payment must be in unpaid status (PENDING, UNDER_REVIEW, or FAILED)\n- Payment method must be manual (CASH, BANK_TRANSFER, CARD, or QURRAH)\n- For installment invoices, invoice must be in ACCEPTED status\n\nAutomatically completes the invoice if all payments are 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\nSupports full refunds. The refund reason and optional note can be specified in the request.\n\n**Note:** If the customer paid multiple payments in a single transaction, you may receive an error\n(400 Bad Request) indicating multiple payments in the transaction. The error response will include\ndetails about all related payments. In this case, set `allow_refund_multiple_related_payments` to\n`true` to refund all payments that were part of the same transaction.","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 'allow_refund_multiple_related_payments' to true to refund all related payments.","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/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"}}}}}}}},"components":{"schemas":{"AddressCreate":{"properties":{"address_line_1":{"type":"string","title":"Address Line 1","description":"Address line 1 (building number, street name)"},"address_line_2":{"type":"string","nullable":true,"description":"Address line 2 (district)"},"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":["address_line_1","city","country"],"title":"AddressCreate","description":"Address creation model for B2B consumers."},"AddressResponse":{"properties":{"address_line_1":{"type":"string","title":"Address Line 1","description":"Address line 1"},"address_line_2":{"type":"string","nullable":true,"description":"Address line 2"},"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","title":"AddressResponse","description":"Address response model."},"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":{"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"},"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"}},"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"}},"type":"object","title":"Beneficiary"},"BeneficiaryLink":{"properties":{"beneficiary_id":{"type":"string","format":"uuid","title":"Beneficiary Id"},"beneficiary_name":{"type":"string","title":"Beneficiary Name"}},"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"},"delete":{"type":"boolean","title":"Delete","description":"Whether to delete the beneficiary","default":false}},"type":"object","required":["name"],"title":"BeneficiaryUpdate"},"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":{"id":{"type":"string","format":"uuid4","title":"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":{"type":"string"},"type":"array","nullable":true,"description":"List of beneficiaries (optional)"},"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":{"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"},"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"},"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)"},"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_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"},"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_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"},"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","nullable":true,"description":"Maximum number of times this payment link can be used. If null, the payment link can be used unlimited times. 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."},"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)."},"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."}},"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"},"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"},"FreezeSubscriptionBase":{"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"},"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"},"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"},"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"},"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":"Payment due date. After this date, the invoice will be marked as overdue"},"exclude_coupons_if_installments":{"type":"boolean","title":"Exclude Coupons If Installments","description":"If enabled, all coupons (invoice-level and item-level) will be excluded when the payer chooses installments. The payer will need to pay the full amount without discounts when paying by installments.","default":false},"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"Currency for the invoice. Defaults to SAR for backward compatibility.","default":"SAR"}},"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_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"},"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"},"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"},"exclude_coupons_if_installments":{"type":"boolean","title":"Exclude Coupons If Installments","description":"Whether coupons are excluded when paying by installments"},"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"},"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"},"custom_field_answers":{"additionalProperties":true,"type":"object","nullable":true,"description":"Answers to custom fields collected for this invoice"},"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"},"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. Must be a future date."},"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."}},"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, unlike the full update endpoint\nwhich cancels and recreates the invoice. 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_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"},"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"},"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}},"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 (DRAFT → CREATED → SENT → 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_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."},"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. Must not already be registered."},"role":{"$ref":"#/components/schemas/UserRolesEnum","description":"Role to assign to the invited user."},"branches":{"items":{"type":"string","format":"uuid"},"type":"array","minItems":1,"title":"Branches","description":"List of branch IDs where the user will have access."}},"type":"object","required":["email","role","branches"],"title":"OrganizationInviteCreate"},"OrganizationInviteResponse":{"properties":{"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"},"role":{"$ref":"#/components/schemas/UserRolesEnum"},"branches":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Branches"}},"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"},"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"},"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_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"},"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"},"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"},"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"},"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)"}},"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"],"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}},"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":{"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"},"allow_refund_multiple_related_payments":{"type":"boolean","title":"Allow Refund Multiple Related Payments","description":"If true and the customer paid multiple payments at the same time (single transaction), refund all related payments instead of returning an error. Use this when attempting to refund a single payment that was part of a multi-payment transaction.","default":false}},"type":"object","required":["refund_reason"],"title":"PaymentRefundRequest"},"PaymentResponse":{"properties":{"id":{"type":"string","format":"uuid","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)","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 when the payment was refunded"},"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 reason if applicable"},"latest_pgw_message":{"type":"string","nullable":true,"description":"Latest payment gateway message for this payment"},"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"],"title":"PaymentStatusEnum"},"PaymentTypeEnum":{"type":"string","enum":["INITIAL","INSTALLMENT","SPLIT_PREPAID"],"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"},"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","minimum":1.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Price","description":"[DEPRECATED] Price of the product. Use 'prices' array for multi-currency support."},"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","nullable":true,"description":"[DEPRECATED] Is the price exempt from VAT? Use VAT settings in prices[] instead."},"is_price_inclusive_of_vat":{"type":"boolean","nullable":true,"description":"[DEPRECATED] Is the price inclusive of VAT? Use VAT settings in prices[] instead."},"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","type"],"title":"ProductCreate"},"ProductDto":{"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 product"},"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","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Price","description":"Total price including VAT (default currency)."},"currency":{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","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","SLL","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","XAF","XCD","XOF","XPF","XSU","XUA","YER","ZAR","ZMW","ZWL"],"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":"Is the default price inclusive of VAT?"},"price_excluding_vat":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Price Excluding Vat","description":"Default price excluding VAT."},"vat_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Vat Amount","description":"VAT amount for default price."},"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)."}},"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."},"ProductPriceInlineCreate":{"properties":{"currency":{"$ref":"#/components/schemas/CurrencyCode","description":"ISO 4217 currency code"},"amount":{"anyOf":[{"type":"number","minimum":1.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount","description":"Price amount (must be >= 1)"},"is_price_inclusive_of_vat":{"type":"boolean","title":"Is Price Inclusive Of Vat","description":"If True, amount includes VAT","default":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","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount"},"is_active":{"type":"boolean","title":"Is Active"},"is_price_inclusive_of_vat":{"type":"boolean","title":"Is Price Inclusive Of Vat"},"is_price_exempt_from_vat":{"type":"boolean","title":"Is Price Exempt From Vat"},"price_excluding_vat":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Price Excluding Vat"},"vat_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Vat Amount"}},"type":"object","title":"ProductPriceInlineDto","description":"Inline price DTO for product responses."},"ProductType":{"type":"string","enum":["RECURRING","ONE_OFF"],"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","minimum":1.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Price","description":"[DEPRECATED] Price of the product. Use 'prices' array for multi-currency support."},"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","nullable":true,"description":"[DEPRECATED] Is the price exempt from VAT? Use VAT settings in prices[] instead."},"is_price_inclusive_of_vat":{"type":"boolean","nullable":true,"description":"[DEPRECATED] Is the price inclusive of VAT? Use VAT settings in prices[] instead."},"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":"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","INVALID_PARAMETERS","INVITATION_EXPIRED","USER_ALREADY_REGISTERED","PAYMENT_FLOW_NOT_ALLOWED","INVOICE_PAYMENT_COUNT_NOT_MATCHED","INVOICE_FINALISED","INVOICE_INVALID_STATUS","INVOICE_TOTAL_MISMATCH_PAYMENT_AMOUNT_SUM","INVOICE_CONSENT_CONSUMED","INVOICE_CONSENT_EXPIRED","PAYMENT_IN_PROGRESS","PAYMENT_FINALIZED","PAYMEND_UNPAID","PAYMENT_REFUNDED_ALREADY","PAYMENT_REFUNDED_FAILED","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","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_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"],"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."},"exclude_coupons_if_installments":{"type":"boolean","title":"Exclude Coupons If Installments","description":"If enabled, all coupons (subscription-level and item-level) will be excluded when the payer chooses installments. The payer will need to pay the full amount without discounts when paying by installments.","default":false},"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_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"},"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``."},"exclude_coupons_if_installments":{"type":"boolean","nullable":true,"description":"Optional override for the same field on the subscription."}},"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"},"UserRolesEnum":{"type":"string","enum":["organization_admin","branch_admin","branch_user"],"title":"UserRolesEnum"},"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"}}}}