(store)
Access to Petstore orders
Find out more about our store http://swagger.io
- deleteOrder - Delete purchase order by ID
- getInventory - Returns pet inventories by status
- getOrderById - Find purchase order by ID
- placeOrderForm - Place an order for a pet
- placeOrderJson - Place an order for a pet
- placeOrderRaw - Place an order for a pet
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
import { Test } from "Test";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.store.deleteOrder({
orderId: 127902,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeleteOrderRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.DeleteOrderResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Returns a map of status codes to quantities
import { Test } from "Test";
import { GetInventorySecurity } from "Test/dist/sdk/models/operations";
async function run() {
const sdk = new Test();
const operationSecurity: GetInventorySecurity = {
apiKey: "<YOUR_API_KEY_HERE>",
};
const res = await sdk.store.getInventory(operationSecurity);
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
security |
operations.GetInventorySecurity | ✔️ | The security requirements to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetInventoryResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
import { Test } from "Test";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.store.getOrderById({
orderId: 614993,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetOrderByIdRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetOrderByIdResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Place a new order in the store
import { Test } from "Test";
import { Status } from "Test/dist/sdk/models/shared";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.store.placeOrderForm({
id: 10,
petId: 198772,
quantity: 7,
status: Status.Approved,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
shared.Order | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.PlaceOrderFormResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Place a new order in the store
import { Test } from "Test";
import { Status } from "Test/dist/sdk/models/shared";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.store.placeOrderJson({
id: 10,
petId: 198772,
quantity: 7,
status: Status.Approved,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
shared.Order | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.PlaceOrderJsonResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Place a new order in the store
import { Test } from "Test";
import { Status } from "Test/dist/sdk/models/shared";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.store.placeOrderRaw(new TextEncoder().encode("0xcB9dC14dEe"));
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
Uint8Array | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.PlaceOrderRawResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |