Fetch Product
Get a single product on your Terraswitch account
GET {{ BASE_URL }}/v1/corporate/product/{code}Url Parameters
Property
Data Type
Description
Example
Required
code
string
The product code
"TSDMYPROPLASTXD"
Yes
import Axios from 'axios';
// set the api url
const API_URL = `${BASE_URL}/v1/corporate/product/${code}`;
// make request using axios
Axios({
method: "GET",
url: `${API_URL}`,
headers: {
lg: 'en',
ch: 'web'
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
}
}).then((resp) => {
console.log(resp)
}).catch((err) => {
console.log(err)
}){
"error": false,
"errors": [],
"data": {
"avatar": "",
"code": "VPDMYPROPLASTXD",
"description": "This is a new platsic product",
"isEnabled": true,
"name": "Plastic Chair",
"price": 5000,
"slug": "plastic-chair",
"inflow": {
"value": 0,
"count": 0
},
"createdAt": "2024-01-10T13:43:06.899Z",
"updatedAt": "2024-01-10T13:52:01.552Z"
},
"message": "successful",
"status": 200
}Last updated