API Samples

API Samples

SDK Samples Reference

Last Updated: March 3, 2026


Overview

The UltraCart SDK Samples repository contains working code examples for every UltraCart REST API v2 endpoint, organized by API category and available in 8 languages: C#, Java, JavaScript, PHP, Python, Ruby, TypeScript, and cURL.

This is a living repository. If you need a sample that doesn't exist yet, email support and we'll add it.

API Reference: https://www.ultracart.com/api/


SDK Repositories and Packages

Source Code

Package Managers


Getting Started

Each API category folder contains an introduction file that demonstrates SDK initialization and authentication for that API. If the API supports multiple authentication methods, you'll find introduction_2, introduction_3, and introduction_4 variants.

For a complete walkthrough, start with the gift_certificate samples — it's the most fully documented API category and serves as the best reference for structuring your own integrations.

Base URL for all sample links:

https://github.com/UltraCart/sdk_samples/tree/master/{language}/{category}

Java samples live under java/src/{category}/ rather than java/{category}/.


Samples by API Category

Affiliate

Retrieve affiliate click and ledger data.

Language

Browse All Samples

Available methods: getClicksByQuery, getLedgersByQuery


Auto Order

Manage recurring/subscription auto orders — query, create, update, pause, consolidate, and batch operations.

Language

Browse All Samples

Available methods: consolidateAutoOrders, establishAutoOrderByReferenceOrderId, getAutoOrder, getAutoOrderByCode, getAutoOrderByReferenceOrderId, getAutoOrders, getAutoOrdersBatch, getAutoOrdersByQuery, pauseAutoOrder, updateAutoOrder, updateAutoOrdersBatch


Channel Partner

Import, cancel, and refund channel partner orders; manage ship-to preferences.

Available methods: cancelOrderByChannelPartnerOrderId, cancelOrderByUltraCartOrderId, deleteChannelPartnerShipToPreference, estimateShippingForChannelPartnerOrder, estimateTaxForChannelPartnerOrder, getChannelPartnerOrder, getChannelPartnerOrderByChannelPartnerOrderId, getChannelPartnerReasonCodes, getChannelPartnerShipToPreference, getChannelPartnerShipToPreferences, getChannelPartners, importChannelPartnerOrder, insertChannelPartnerShipToPreference, refundChannelPartnerOrder, refundChannelPartnerOrderPartially, updateChannelPartnerShipToPreference


Chargeback

Manage chargeback disputes — insert, update, delete, and retrieve dispute details.

Language

Browse All Samples

Available methods: deleteChargeback, getChargebackDispute, getChargebackDisputes, insertChargeback, updateChargeback


Checkout

Server-side and browser-key checkout — cart management, validation, finalization, and related items.

Language

Browse All Samples

Available methods: cityState, finalizeOrder, getAffirmCheckout, getAllowedCountries, getCart, getCartByCartId, getCartByReturnCode, getCartByReturnToken, getStateProvincesForCountry, handoffCart, login, logout, register, registerAffiliateClick, relatedItemsForCart, relatedItemsForItem, setupBrowserKey, updateCart, validateCart

See also: Responsive Checkout, Two Page Trial


Configuration

Manage payment gateways, rotating transaction gateways, Stripe Connect, and WePay enrollment.

Available methods: delayAutoOrders, deleteRotatingTransactionGateway, getPaymentsConfiguration, getPaymentsRotatingGateway, getPaymentsRotatingGatewayByCode, getPaymentsRotatingTransactionGateways, getPaymentsRtgSummaries, getPaymentsTransactionGateways, insertRotatingTransactionGateway, migrateToRotatingTransactionGateway, stripeConnect, updatePaymentsConfiguration, updatePaymentsTransactionGateway, updateRotatingTransactionGateway, wepayEnroll


Conversation

PBX phone system, webchat, canned messages, departments, engagements, multimedia, and agent management. This is the largest API surface.

Key method groups:

  • PBX: getPbxAgent, getPbxAgents, getPbxMenus, getPbxPhoneNumbers, getPbxQueues, getPbxTimeBased, getPbxTimeRanges, getPbxVoicemailMailboxes, insertPbxAgent, updatePbxAgent, deletePbxAgent (and similar CRUD for all PBX entities)

  • Conversations: getConversation, getConversations, startConversation, joinConversation, leaveConversation, searchConversations

  • Canned Messages: getCannedMessages, insertCannedMessage, updateCannedMessage, deleteCannedMessage

  • Webchat/Engagements: getConversationEngagement, getConversationWebchatQueueStatuses

  • Agent Management: getAgentKeepAlive, getAgentProfile, getAgentWebsocketAuthorization


Coupon

Create, update, delete, query, and generate codes for coupons.

Language

Browse All Samples

Available methods: deleteCoupon, deleteCouponsByCode, deleteCouponsByOid, doesCouponCodeExist, generateCouponCodes, generateOneTimeCodesByMerchantCode, getAutoApply, getCoupon, getCouponByMerchantCode, getCoupons, getCouponsByQuery, getEditorValues, insertCoupon, insertCoupons, searchItems, updateAutoApply, updateCoupon, updateCoupons, uploadCouponCodes


Customer

Customer CRUD, email lists, wish lists, store credit, merge, magic links, and profile search.

Language

Browse All Samples

Language

Browse All Samples

C#

csharp/customer

Java