{"openapi":"3.0.0","info":{"title":"1buy.io API","version":"1.0.0"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/TECHIEDEV09_1/1buy/1.0.0"},{"url":"https://api.1buy.io","description":"Production"},{"url":"https://api-dev.1buy.io","description":"Development"}],"paths":{"/api/business/transactions/data":{"post":{"summary":"Retrieve transaction details","description":"Retrieve detailed information about a specific transaction.","operationId":"getTransactionDetails","parameters":[{"name":"api-key","in":"header","description":"Your API key for authentication.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionsDataPayload"}}}},"responses":{"200":{"description":"Transaction details retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionDetail"}}}},"400":{"description":"Invalid request parameter."}}}},"/api/business/transactions/user_subscription":{"post":{"summary":"Retrieve subscription details","description":"Retrieve subscription details for a specific user or product.","operationId":"getSubscriptionDetails","parameters":[{"name":"api-key","in":"header","description":"Your API key for authentication.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionDataPayload"}}}},"responses":{"200":{"description":"Subscription details retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionDetail"}}}},"400":{"description":"Invalid request parameter."}}}},"/api/business/product/hash_widget_url":{"post":{"summary":"Generate hash for widget URL","description":"Securely generate a hash for the widget URL to ensure one-time access or trackable usage.","operationId":"generateHashWidgetUrl","parameters":[{"name":"api-key","in":"header","description":"Your API key for authentication.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HashWidgetPayload"}}}},"responses":{"200":{"description":"Hash for widget URL generated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HashWidgetResponse"}}}},"400":{"description":"Invalid request parameter."}}}},"/api/invoice/list":{"get":{"tags":["Invoices"],"summary":"Retrieve a list of invoices","description":"Retrieves a comprehensive list of all invoices.","operationId":"listInvoices","parameters":[{"name":"api-key","in":"header","description":"Your API key for authentication.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of invoices retrieved successfully.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceDetail"}}}}},"400":{"description":"Invalid request parameter."}}}},"/api/invoice":{"get":{"tags":["Invoices"],"summary":"Retrieve specific invoice details","description":"Retrieves details of an invoice specified by an invoice code.","operationId":"getInvoiceDetails","parameters":[{"name":"api-key","in":"header","description":"Your API key for authentication.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"invoice_code","in":"query","description":"The unique code of the invoice to retrieve details for.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Invoice details retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetail"}}}},"400":{"description":"Invalid request due to missing or incorrect parameters."},"404":{"description":"Invoice not found."}}}},"/api/invoice/simple":{"post":{"tags":["Invoices"],"summary":"Create a simple invoice","description":"Creates a new invoice with a basic structure.","operationId":"createSimpleInvoice","parameters":[{"name":"api-key","in":"header","description":"Your API key for authentication.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","amount"],"properties":{"title":{"type":"string","description":"Title of the invoice."},"amount":{"type":"number","description":"Amount to be invoiced."},"receive_in":{"type":"string","description":"The currency type in which to receive payment. Default is the primary account currency.","enum":["crypto","fiat"]}}}}}},"responses":{"200":{"description":"Invoice created successfully."},"400":{"description":"Invalid request due to missing or incorrect parameters."}}}},"/api/invoice/full":{"post":{"tags":["Invoices"],"summary":"Create a detailed invoice","description":"Creates a comprehensive invoice with multiple items, specifying who pays transaction fees and the preferred currency for receiving payment.","operationId":"createFullInvoice","parameters":[{"name":"api-key","in":"header","description":"Your API key for authentication.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","pay_fee","items"],"properties":{"title":{"type":"string","description":"Title of the invoice."},"pay_fee":{"type":"string","description":"Indicates who will pay the transaction fees ('you_pay', 'customer_pays').","enum":["you_pay","customer_pays"]},"items":{"type":"array","description":"List of items included in the invoice.","items":{"type":"object","required":["itemTitle","quantity","price","description"],"properties":{"itemTitle":{"type":"string","description":"Title of the item."},"quantity":{"type":"integer","description":"Number of items."},"price":{"type":"number","description":"Price per item."},"description":{"type":"string","description":"Description of the item."}}}},"receive_in":{"type":"string","description":"The currency type in which to receive payment. Default is the primary account currency.","enum":["fiat","crypto"]}}}}}},"responses":{"200":{"description":"Invoice created successfully."},"400":{"description":"Invalid request due to missing or incorrect parameters."}}}}},"components":{"schemas":{"TransactionDetail":{"type":"object","properties":{"id":{"type":"string","description":"Order ID."},"custom_id":{"type":"string","description":"Your custom identifier to track your customers."},"user_id":{"type":"string","description":"User ID associated with the transaction."},"product_id":{"type":"string","description":"Product ID of the associated product."},"type":{"type":"string","description":"Order status (e.g., `payment_started`, `order_complete`, `order_failed`, etc.)."},"base":{"type":"string","description":"Cryptocurrency used for the transaction."},"base_amount":{"type":"string","description":"Amount of cryptocurrency used."},"quote":{"type":"string","description":"Fiat currency used for the transaction."},"quote_amount":{"type":"string","description":"Amount of fiat currency used."},"address":{"type":"string","description":"Wallet address used for the transaction."},"transaction_id":{"type":"string","description":"Blockchain transaction ID."},"partner_data":{"type":"object","description":"Data related to the blueprint address and input."},"full_name":{"type":"string","description":"Full name of the user."},"date_of_birth":{"type":"string","description":"Date of birth of the user.","format":"date"},"phone":{"type":"string","description":"Phone number of the user."},"email":{"type":"string","description":"Email address of the user.","format":"email"},"state":{"type":"string","description":"State of the user."},"country":{"type":"string","description":"Country of the user."},"utm_source":{"type":"string","description":"UTM source for tracking."},"clickID":{"type":"string","description":"Click ID for tracking."},"campaignID":{"type":"string","description":"Campaign ID for tracking."},"fail_reason":{"type":"string","description":"Reason for transaction failure, if applicable."},"redirect_url":{"type":"string","description":"URL to redirect after successful transaction.","format":"uri"},"fail_redirect_url":{"type":"string","description":"URL to redirect after a failed transaction.","format":"uri"},"redirect_page":{"type":"string","description":"Specifies how the redirect happens (`new` or `self`)."},"hash":{"type":"string","description":"Hash of the transaction."}}},"TransactionsDataPayload":{"required":["order_id"],"type":"object","properties":{"order_id":{"type":"string","description":"The unique order ID."},"custom_id":{"type":"string","description":"Your custom ID used to track the transaction."},"hash":{"type":"string","description":"The hash used to track the transaction."}}},"SubscriptionDetail":{"type":"object","properties":{"user_id":{"type":"string","description":"The unique user ID for the subscriber."},"custom_id":{"type":"string","description":"Your custom ID for tracking the subscription."},"business_user_id":{"type":"string","description":"The ID of the business user associated with the subscription."},"product_id":{"type":"string","description":"The product ID of the subscription."},"start_date":{"type":"string","description":"The start date of the subscription.","format":"date"},"last_paid_date":{"type":"string","description":"The last successful payment date.","format":"date"},"next_paid_date":{"type":"string","description":"The next scheduled payment date.","format":"date"},"expire_date":{"type":"string","description":"The expiration date of the subscription.","format":"date"},"status":{"type":"number","description":"The status of the subscription (e.g., active, canceled)."},"failed_to_paid":{"type":"boolean","description":"Whether the last payment attempt failed."},"next_paid":{"type":"boolean","description":"Whether the subscription is set to auto-renew."},"interval_time":{"type":"string","description":"The interval of the subscription (e.g., Monthly, Yearly)."}}},"SubscriptionDataPayload":{"type":"object","properties":{"product_id":{"type":"string","description":"The unique product ID of the subscription."},"custom_id":{"type":"string","description":"Your custom ID used to track the subscription."},"user_id":{"type":"string","description":"The unique user ID for the subscriber."}}},"HashWidgetPayload":{"required":["urlData"],"type":"object","properties":{"urlData":{"type":"string","description":"Represents the query parameters as a single string, starting with `?` and using `&` for key-value pairs."},"is_one_time":{"type":"boolean","description":"Indicates whether the generated URL hash should be for one-time use."}}},"HashWidgetResponse":{"type":"object","properties":{"hash":{"type":"string","description":"Generated hash for the widget URL."}}},"InvoiceDetail":{"type":"object","properties":{"due_at":{"type":"integer","description":"Timestamp when the invoice is due."},"token":{"type":"string","description":"Token used for the transaction."},"items":{"type":"array","description":"List of items included in the invoice.","items":{"type":"object","required":["title","description","price","quantity"],"properties":{"title":{"type":"string","description":"Title of the item."},"description":{"type":"string","description":"Description of the item."},"price":{"type":"number","description":"Price per item."},"quantity":{"type":"integer","description":"Quantity of the item."}}}},"pay_fee":{"type":"string","description":"Specifies who will pay the transaction fees.","enum":["you_pay","customer_pays"]},"user_id":{"type":"string","description":"User ID of the account holder who issued the invoice."},"is_deleted":{"type":"boolean","description":"Indicates whether the invoice has been marked as deleted."},"is_paid":{"type":"boolean","description":"Indicates whether the invoice has been settled."},"short_code":{"type":"string","description":"A short code for the invoice."},"_id":{"type":"string","description":"MongoDB document ID of the invoice."},"title":{"type":"string","description":"Title of the invoice."},"customer":{"type":"string","description":"Customer's blockchain address."},"amount":{"type":"string","description":"Initial amount stated on the invoice."},"invoice_type":{"type":"integer","description":"Type of invoice (e.g., standard, recurring)."},"final_amount":{"type":"string","description":"Adjusted final amount payable."},"final_amount_card":{"type":"string","description":"Final amount payable by card."},"invoice_id":{"type":"string","description":"Unique identifier of the invoice."},"created_at":{"type":"string","format":"date-time","description":"Date and time when the invoice was created."},"updated_at":{"type":"string","format":"date-time","description":"Date and time when the invoice was last updated."},"__v":{"type":"integer","description":"Version number of the MongoDB document."}}}}}}