import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.orders.get({
id: "<id>",
});
console.log(result);
}
run();{
"id": "<string>",
"object": "<string>",
"status": "succeeded",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"amount": 123,
"currency": "<string>",
"amount_refunded": 123,
"customer": "<string>",
"checkout": "<string>",
"line_items": [
{
"id": "<string>",
"object": "<string>",
"quantity": 123,
"price_variant": "<string>",
"product": "<string>",
"order": "<string>"
}
]
}Returns a specific order
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.orders.get({
id: "<id>",
});
console.log(result);
}
run();{
"id": "<string>",
"object": "<string>",
"status": "succeeded",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"amount": 123,
"currency": "<string>",
"amount_refunded": 123,
"customer": "<string>",
"checkout": "<string>",
"line_items": [
{
"id": "<string>",
"object": "<string>",
"quantity": 123,
"price_variant": "<string>",
"product": "<string>",
"order": "<string>"
}
]
}API key in the format: Bearer {api_token}
The resource ID (e.g., "prod_abc123") or slug (e.g., "my-product")
Comma-separated relations to expand: customer, line_items
Order details
succeeded, pending, failed, refunded, partially_refunded, disputed ID by default, full object when expanded
Show child attributes
Was this page helpful?