Developers
Checkout, digital delivery and store APIs.
Integration Guides
WordPress / WooCommerce
Post the WooCommerce cart server-side and redirect the customer to the returned hosted payment URL.
// functions.php
add_action('wp_ajax_create_checkout', function() {
$response = wp_remote_post(
'https://creativemark.co/api/v1/stores/your-store/checkout/external-cart/',
[
'headers' => [
'Authorization' => 'Bearer ' . EPAY_API_KEY,
'Content-Type' => 'application/json',
'X-Idempotency-Key' => wc()->cart->get_cart_hash(),
],
'body' => json_encode([
'customer' => [
'email' => wp_get_current_user()->user_email,
'name' => wp_get_current_user()->display_name,
],
'items' => array_map(function($item) {
$product = $item['data'];
return [
'sku' => $product->get_sku(),
'name' => $product->get_name(),
'quantity' => $item['quantity'],
'unit_price_minor' => (int) round($product->get_price() * 100),
];
}, wc()->cart->get_cart()),
'currency' => 'GBP',
]),
]
);
wp_send_json(json_decode(wp_remote_retrieve_body($response)));
});
Custom CMS / SPA
Server-side: create a hosted checkout order from your cart payload. Client-side: redirect to the returned URL.
// Node.js / Express
app.post('/buy', async (req, res) => {
const resp = await fetch(
'https://creativemark.co/api/v1/stores/your-store/checkout/external-cart/',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
'X-Idempotency-Key': req.body.cartId,
},
body: JSON.stringify({
customer: req.body.customer,
items: req.body.items,
currency: 'GBP',
presentation: 'embedded',
}),
}
);
const { payment_url } = await resp.json();
res.redirect(payment_url);
});
Direct Links (No API)
For simple integrations, use direct add-to-cart links with no server-side code required:
<!-- Single product --> <a href="https://creativemark.co/s/your-store/cart/?add=SKU-001¤cy=GBP"> Buy Now </a> <!-- Multiple products --> <a href="https://creativemark.co/s/your-store/cart/?items=SKU1:1,SKU2:2¤cy=GBP"> Buy Bundle </a>
Webhooks
Configure webhook endpoints for real-time order, payment, and fulfillment event notifications. Webhook signatures are included for verification.