Skip to main content

Charge

info

This API is under active development and subject to change.

Path: /v1/charge

Send a POST request to this endpoint to charge a user's stored payment method via Truemed.

Request Parameters

interface CreateChargeRequest {
secret_api_key: process.env.TRUE_MEDICINE_SECRET_API_KEY;
payment_token: "xxxx-xxxx-xxxx-xxxx";
line_items: [
{
price_data: {
currency: "usd",
unit_amount_cents: 12399, // $123.99,
product_data: {
name: "Training with Tyler", // required
description: "Two classes with Tyler!", // optional
},
quantity: 1,
},
}
];
}

Response Parameters

interface CreateChargeResponse {
customer: {
name: "George Washington",
email: "[email protected]",
metadata: { ... },
};
}