# Products

## Create Product

> A product can be a single-pay product or a subscription-based service.

```json
{"openapi":"3.1.0","info":{"title":"BagelPay-SDK","version":"1.0.0"},"tags":[{"name":"Products"}],"servers":[{"url":"https://test.bagelpay.io","description":"Development env"}],"security":[],"paths":{"/api/products/create":{"post":{"summary":"Create Product","deprecated":false,"description":"A product can be a single-pay product or a subscription-based service.","tags":["Products"],"parameters":[{"name":"x-api-key","in":"header","description":"Your API Keys","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of product"},"description":{"type":"string","description":"Description of product"},"price":{"type":"number"},"currency":{"type":"string","enum":["USD"]},"billing_type":{"type":"string","enum":["single_payment","subscription"]},"tax_inclusive":{"type":"boolean","default":false},"tax_category":{"type":"string","enum":["digital_products","saas_services","ebooks"]},"recurring_interval":{"type":"string","enum":["daily","weekly","monthly","3months","6months","yearly"]},"trial_days":{"type":"integer","minimum":0,"maximum":365,"description":"Setting trial_days to 0 signifies no free trial, while trial_days between 1 and 365 specifies a defined duration for the free trial period."}},"required":["name","description","price","currency","billing_type","tax_inclusive","tax_category","recurring_interval","trial_days"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"},"code":{"type":"integer"},"data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"currency":{"type":"string"},"object":{"type":"string"},"mode":{"type":"string"},"product_id":{"type":"string"},"store_id":{"type":"string"},"product_url":{"type":"string"},"billing_type":{"type":"string"},"billing_period":{"type":"string"},"tax_category":{"type":"string"},"tax_inclusive":{"type":"boolean"},"is_archive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"trial_days":{"type":"integer"},"recurring_interval":{"type":"string"}},"required":["name","description","price","currency","object","mode","product_id","store_id","product_url","billing_type","billing_period","tax_category","tax_inclusive","is_archive","created_at","updated_at","trial_days","recurring_interval"]}},"required":["msg","code","data"]}}},"headers":{}}}}}}}
```

## GET /api/products/list

> List Products

```json
{"openapi":"3.1.0","info":{"title":"BagelPay-SDK","version":"1.0.0"},"tags":[{"name":"Products"}],"servers":[{"url":"https://test.bagelpay.io","description":"Development env"}],"security":[],"paths":{"/api/products/list":{"get":{"summary":"List Products","deprecated":false,"description":"","tags":["Products"],"parameters":[{"name":"pageNum","in":"query","description":"The page number","required":false,"schema":{"type":"integer","minimum":1}},{"name":"pageSize","in":"query","description":"The page size\n\n","required":false,"schema":{"type":"integer","minimum":1}},{"name":"x-api-key","in":"header","description":"Your API Keys","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"currency":{"type":"string"},"object":{"type":"string"},"mode":{"type":"string"},"remark":{"type":["string","null"]},"product_id":{"type":"string"},"store_id":{"type":"string"},"product_url":{"type":"string"},"billing_type":{"type":"string"},"billing_period":{"type":"string"},"tax_category":{"type":"string"},"tax_inclusive":{"type":"boolean"},"is_archive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"trial_days":{"type":"integer"},"recurring_interval":{"type":["string","null"]}}}},"code":{"type":"integer"},"msg":{"type":"string"}},"required":["total","items","code","msg"]}}},"headers":{}}}}}}}
```

## GET /api/products/{product\_id}

> Get Product Detail

```json
{"openapi":"3.1.0","info":{"title":"BagelPay-SDK","version":"1.0.0"},"tags":[{"name":"Products"}],"servers":[{"url":"https://test.bagelpay.io","description":"Development env"}],"security":[],"paths":{"/api/products/{product_id}":{"get":{"summary":"Get Product Detail","deprecated":false,"description":"","tags":["Products"],"parameters":[{"name":"product_id","in":"path","description":"","required":true,"schema":{"type":"string"}},{"name":"x-api-key","in":"header","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"},"code":{"type":"integer"},"data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"currency":{"type":"string"},"object":{"type":"string"},"mode":{"type":"string"},"product_id":{"type":"string"},"store_id":{"type":"string"},"product_url":{"type":"string"},"billing_type":{"type":"string"},"billing_period":{"type":"string"},"tax_category":{"type":"string"},"tax_inclusive":{"type":"boolean"},"is_archive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"trial_days":{"type":"integer"},"recurring_interval":{"type":"string"}},"required":["name","description","price","currency","object","mode","product_id","store_id","product_url","billing_type","billing_period","tax_category","tax_inclusive","is_archive","created_at","updated_at","trial_days","recurring_interval"]}},"required":["msg","code","data"]}}},"headers":{}}}}}}}
```

## Archive Product

> Archive a product associated with your account.

```json
{"openapi":"3.1.0","info":{"title":"BagelPay-SDK","version":"1.0.0"},"tags":[{"name":"Products"}],"servers":[{"url":"https://test.bagelpay.io","description":"Development env"}],"security":[],"paths":{"/api/products/{product_id}/archive":{"post":{"summary":"Archive Product","deprecated":false,"description":"Archive a product associated with your account.","tags":["Products"],"parameters":[{"name":"product_id","in":"path","description":"","required":true,"schema":{"type":"string"}},{"name":"x-api-key","in":"header","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"},"code":{"type":"integer"},"data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"currency":{"type":"string"},"object":{"type":"string"},"mode":{"type":"string"},"product_id":{"type":"string"},"store_id":{"type":"string"},"product_url":{"type":"string"},"billing_type":{"type":"string"},"billing_period":{"type":"string"},"tax_category":{"type":"string"},"tax_inclusive":{"type":"boolean"},"is_archive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"trial_days":{"type":"integer"},"recurring_interval":{"type":"string"}},"required":["name","description","price","currency","object","mode","product_id","store_id","product_url","billing_type","billing_period","tax_category","tax_inclusive","is_archive","created_at","updated_at","trial_days","recurring_interval"]}},"required":["msg","code","data"]}}},"headers":{}}}}}}}
```

## Unarchive Product

> Unarchive a product associated with your account.

```json
{"openapi":"3.1.0","info":{"title":"BagelPay-SDK","version":"1.0.0"},"tags":[{"name":"Products"}],"servers":[{"url":"https://test.bagelpay.io","description":"Development env"}],"security":[],"paths":{"/api/products/{product_id}/unarchive":{"post":{"summary":"Unarchive Product","deprecated":false,"description":"Unarchive a product associated with your account.","tags":["Products"],"parameters":[{"name":"product_id","in":"path","description":"","required":true,"schema":{"type":"string"}},{"name":"x-api-key","in":"header","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"},"code":{"type":"integer"},"data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"currency":{"type":"string"},"object":{"type":"string"},"mode":{"type":"string"},"product_id":{"type":"string"},"store_id":{"type":"string"},"product_url":{"type":"string"},"billing_type":{"type":"string"},"billing_period":{"type":"string"},"tax_category":{"type":"string"},"tax_inclusive":{"type":"boolean"},"is_archive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"trial_days":{"type":"integer"},"recurring_interval":{"type":"string"}},"required":["name","description","price","currency","object","mode","product_id","store_id","product_url","billing_type","billing_period","tax_category","tax_inclusive","is_archive","created_at","updated_at","trial_days","recurring_interval"]}},"required":["msg","code","data"]}}},"headers":{}}}}}}}
```

## POST /api/products/update

> Update Product

```json
{"openapi":"3.1.0","info":{"title":"BagelPay-SDK","version":"1.0.0"},"tags":[{"name":"Products"}],"servers":[{"url":"https://test.bagelpay.io","description":"Development env"}],"security":[],"paths":{"/api/products/update":{"post":{"summary":"Update Product","deprecated":false,"description":"","tags":["Products"],"parameters":[{"name":"x-api-key","in":"header","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"currency":{"type":"string"},"tax_inclusive":{"type":"boolean"},"tax_category":{"type":"string","enum":["digital_products","saas_services","ebooks"]},"recurring_interval":{"type":"string","enum":["daily","weekly","monthly","3months","6months","yearly"]},"trial_days":{"type":"integer","minimum":0,"maximum":365}},"required":["product_id","name","description","price","currency","tax_inclusive","tax_category","recurring_interval","trial_days"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"},"code":{"type":"integer"},"data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"currency":{"type":"string"},"object":{"type":"string"},"mode":{"type":"string"},"product_id":{"type":"string"},"store_id":{"type":"string"},"product_url":{"type":"string"},"billing_type":{"type":"string"},"billing_period":{"type":"string"},"tax_category":{"type":"string"},"tax_inclusive":{"type":"boolean"},"is_archive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"trial_days":{"type":"integer"},"recurring_interval":{"type":"string"}},"required":["name","description","price","currency","object","mode","product_id","store_id","product_url","billing_type","billing_period","tax_category","tax_inclusive","is_archive","created_at","updated_at","trial_days","recurring_interval"]}},"required":["msg","code","data"]}}},"headers":{}}}}}}}
```
