This is the next generation UltraCart REST API...
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 2.0.0
- Build package: io.swagger.codegen.languages.PhpClientCodegen For more information, please visit http://www.ultracart.com
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/UltraCart/rest_api_v2_sdk_php.git"
}
],
"require": {
"UltraCart/rest_api_v2_sdk_php": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/vendor/whatever_you_named_your_ultracart_sdk_directory/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php /* docs.ultracart.com sample */ ?>
<?php
// for testing and development only
set_time_limit(3000);
ini_set('max_execution_time', 3000);
ini_set('display_errors', 1);
error_reporting(E_ALL);
?>
<?php
// initialization code
require_once './vendor/autoload.php';
$simple_key = '4256aaf6dfedfa01582fe9a961ab0100216d737b874a4801582fe9a961ab0100';
ultracart\v2\Configuration::getDefaultConfiguration()->setApiKey('x-ultracart-simple-key', $simple_key);
$client = new GuzzleHttp\Client(['verify' => true, 'debug' => false]);
$config = ultracart\v2\Configuration::getDefaultConfiguration();
$headerSelector = new \ultracart\v2\HeaderSelector(/* leave null for version tied to this sdk version */);
$auto_order_api = new ultracart\v2\Api\AutoorderApi($client, $config, $headerSelector);
?>
<html>
<body>
<?php
try {
$auto_order_oid = 2078718; // this is found either by looping through auto orders, or from the back end.
$auto_order_response = $auto_order_api->getAutoOrder($auto_order_oid, "items");
$auto_order = $auto_order_response->getAutoOrder();
$auto_order->getItems()[0]->setArbitraryQuantity(4);
$auto_order_response = $auto_order_api->updateAutoOrder($auto_order, $auto_order_oid);
} catch (\ultracart\v2\ApiException $e) {
error_log($e->getResponseBody());
}
?>
<pre>
<?php echo print_r($auto_order); ?>
<?php echo print_r($auto_order_response); ?>
</pre>
<?php echo 'Finished.'; ?>
</body>
</html>
All URIs are relative to https://secure.ultracart.com/rest/v2
Class | Method | HTTP request | Description |
---|---|---|---|
AffiliateApi | getClicksByQuery | POST /affiliate/clicks/query | Retrieve clicks |
AffiliateApi | getLedgersByQuery | POST /affiliate/ledgers/query | Retrieve ledger entries |
AutoOrderApi | getAutoOrder | GET /auto_order/auto_orders/{auto_order_oid} | Retrieve an auto order |
AutoOrderApi | getAutoOrderByCode | GET /auto_order/auto_orders/code/{auto_order_code} | Retrieve an auto order |
AutoOrderApi | getAutoOrderByReferenceOrderId | GET /auto_order/auto_orders/reference_order_id/{reference_order_id} | Retrieve an auto order |
AutoOrderApi | getAutoOrders | GET /auto_order/auto_orders | Retrieve auto orders |
AutoOrderApi | updateAutoOrder | PUT /auto_order/auto_orders/{auto_order_oid} | Update an auto order |
ChargebackApi | deleteChargeback | DELETE /chargeback/chargebacks/{chargeback_dispute_oid} | Delete a chargeback |
ChargebackApi | getChargebackDispute | GET /chargeback/chargebacks/{chargeback_dispute_oid} | Retrieve a chargeback |
ChargebackApi | getChargebackDisputes | GET /chargeback/chargebacks | Retrieve chargebacks |
ChargebackApi | insertChargeback | POST /chargeback/chargebacks | Insert a chargeback |
ChargebackApi | updateChargeback | PUT /chargeback/chargebacks/{chargeback_dispute_oid} | Update a chargeback |
CheckoutApi | cityState | POST /checkout/city_state | City/State for Zip |
CheckoutApi | finalizeOrder | POST /checkout/cart/finalizeOrder | Finalize Order |
CheckoutApi | getCart | GET /checkout/cart | Get cart |
CheckoutApi | getCartByCartId | GET /checkout/cart/{cart_id} | Get cart (by cart id) |
CheckoutApi | getCartByReturnCode | GET /checkout/return/{return_code} | Get cart (by return code) |
CheckoutApi | handoffCart | POST /checkout/cart/handoff | Handoff cart |
CheckoutApi | login | POST /checkout/cart/profile/login | Profile login |
CheckoutApi | logout | POST /checkout/cart/profile/logout | Profile logout |
CheckoutApi | register | POST /checkout/cart/profile/register | Profile registration |
CheckoutApi | relatedItemsForCart | POST /checkout/related_items | Related items |
CheckoutApi | relatedItemsForItem | POST /checkout/relatedItems/{item_id} | Related items (specific item) |
CheckoutApi | setupBrowserKey | PUT /checkout/browser_key | Setup Browser Application |
CheckoutApi | updateCart | PUT /checkout/cart | Update cart |
CheckoutApi | validateCart | POST /checkout/cart/validate | Validate |
CouponApi | deleteCoupon | DELETE /coupon/coupons/{coupon_oid} | Delete a coupon |
CouponApi | generateCouponCodes | POST /coupon/coupons/{coupon_oid}/generate_codes | Generates one time codes for a coupon |
CouponApi | generateOneTimeCodesByMerchantCode | POST /coupon/coupons/merchant_code/{merchant_code}/generate_codes | Generates one time codes by merchant code |
CouponApi | getCoupon | GET /coupon/coupons/{coupon_oid} | Retrieve a coupon |
CouponApi | getCouponByMerchantCode | GET /coupon/coupons/merchant_code/{merchant_code} | Retrieve a coupon by merchant code |
CouponApi | getCoupons | GET /coupon/coupons | Retrieve coupons |
CouponApi | getCouponsByQuery | GET /coupon/coupons/query | Retrieve coupons by query |
CouponApi | getEditorValues | GET /coupon/editor_values | Retrieve values needed for a coupon editor |
CouponApi | insertCoupon | POST /coupon/coupons | Insert a coupon |
CouponApi | updateCoupon | PUT /coupon/coupons/{coupon_oid} | Update a coupon |
CustomerApi | deleteCustomer | DELETE /customer/customers/{customer_profile_oid} | Delete a customer |
CustomerApi | getCustomer | GET /customer/customers/{customer_profile_oid} | Retrieve a customer |
CustomerApi | getCustomers | GET /customer/customers | Retrieve customers |
CustomerApi | getCustomersByQuery | GET /customer/customers/query | Retrieve customers by query |
CustomerApi | getEditorValues | GET /customer/editor_values | Retrieve values needed for a customer profile editor |
CustomerApi | insertCustomer | POST /customer/customers | Insert a customer |
CustomerApi | updateCustomer | PUT /customer/customers/{customer_profile_oid} | Update a customer |
FulfillmentApi | acknowledgeOrders | PUT /fulfillment/distribution_centers/{distribution_center_code}/acknowledgements | Acknowledge receipt of orders. |
FulfillmentApi | getDistributionCenterOrders | GET /fulfillment/distribution_centers/{distribution_center_code}/orders | Retrieve orders queued up for this distribution center. |
FulfillmentApi | getDistributionCenters | GET /fulfillment/distribution_centers | Retrieve distribution centers |
FulfillmentApi | shipOrders | POST /fulfillment/distribution_centers/{distribution_center_code}/shipments | Mark orders as shipped |
FulfillmentApi | updateInventory | POST /fulfillment/distribution_centers/{distribution_center_code}/inventory | Update inventory |
ItemApi | deleteItem | DELETE /item/items/{merchant_item_oid} | Delete an item |
ItemApi | getItem | GET /item/items/{merchant_item_oid} | Retrieve an item |
ItemApi | getItemByMerchantItemId | GET /item/items/merchant_item_id/{merchant_item_id} | Retrieve an item by item id |
ItemApi | getItems | GET /item/items | Retrieve items |
ItemApi | insertItem | POST /item/items | Create an item |
ItemApi | updateItem | PUT /item/items/{merchant_item_oid} | Update an item |
ItemApi | updateItems | PUT /item/items/batch | Update multiple items |
ItemApi | uploadTemporaryMultimedia | POST /item/temp_multimedia | Upload an image to the temporary multimedia. |
OauthApi | oauthAccessToken | POST /oauth/token | Exchange authorization code for access token. |
OauthApi | oauthRevoke | POST /oauth/revoke | Revoke this OAuth application. |
OrderApi | cancelOrder | POST /order/orders/{order_id}/cancel | Cancel an order |
OrderApi | deleteOrder | DELETE /order/orders/{order_id} | Delete an order |
OrderApi | format | POST /order/orders/{order_id}/format | Format order |
OrderApi | getOrder | GET /order/orders/{order_id} | Retrieve an order |
OrderApi | getOrders | GET /order/orders | Retrieve orders |
OrderApi | getOrdersByQuery | POST /order/orders/query | Retrieve orders |
OrderApi | refundOrder | PUT /order/orders/{order_id}/refund | Refund an order |
OrderApi | resendReceipt | POST /order/orders/{order_id}/resend_receipt | Resend receipt |
OrderApi | resendShipmentConfirmation | POST /order/orders/{order_id}/resend_shipment_confirmation | Resend shipment confirmation |
OrderApi | updateOrder | PUT /order/orders/{order_id} | Update an order |
WebhookApi | deleteWebhook | DELETE /webhook/webhooks/{webhookOid} | Delete a webhook |
WebhookApi | getWebhookLog | GET /webhook/webhooks/{webhookOid}/logs/{requestId} | Retrieve an individual log |
WebhookApi | getWebhookLogSummaries | GET /webhook/webhooks/{webhookOid}/logs | Retrieve the log summaries |
WebhookApi | getWebhooks | GET /webhook/webhooks | Retrieve webhooks |
WebhookApi | insertWebhook | POST /webhook/webhooks | Add a webhook |
WebhookApi | resendEvent | POST /webhook/webhooks/{webhookOid}/reflow/{eventName} | Resend events to the webhook endpoint. |
WebhookApi | updateWebhook | PUT /webhook/webhooks/{webhookOid} | Update a webhook |
- AffiliateClick
- AffiliateClickQuery
- AffiliateClicksResponse
- AffiliateLedger
- AffiliateLedgerQuery
- AffiliateLedgersResponse
- AffiliateLink
- ApiUserApplicationProfile
- AutoOrder
- AutoOrderItem
- AutoOrderItemOption
- AutoOrderResponse
- AutoOrdersResponse
- BaseResponse
- Cart
- CartAffiliate
- CartBilling
- CartBuysafe
- CartCheckout
- CartCoupon
- CartCustomerProfile
- CartCustomerProfileAddress
- CartCustomerProfileCreditCard
- CartFinalizeOrderRequest
- CartFinalizeOrderRequestOptions
- CartFinalizeOrderResponse
- CartGift
- CartGiftCertificate
- CartItem
- CartItemAttribute
- CartItemMultimedia
- CartItemMultimediaThumbnail
- CartItemOption
- CartItemOptionValue
- CartItemPhysical
- CartItemVariationSelection
- CartKitComponentOption
- CartMarketing
- CartPayment
- CartPaymentAmazon
- CartPaymentCheck
- CartPaymentCreditCard
- CartPaymentPurchaseOrder
- CartProfileLoginRequest
- CartProfileLoginResponse
- CartProfileRegisterRequest
- CartProfileRegisterResponse
- CartResponse
- CartSettings
- CartSettingsBilling
- CartSettingsGift
- CartSettingsGiftWrap
- CartSettingsPayment
- CartSettingsPaymentAmazon
- CartSettingsPaymentCreditCard
- CartSettingsPaymentPayPal
- CartSettingsProvince
- CartSettingsShipping
- CartSettingsShippingCalendar
- CartSettingsShippingEstimate
- CartSettingsTaxes
- CartSettingsTerms
- CartShipping
- CartSummary
- CartTaxes
- CartUpsellAfter
- CartValidationRequest
- CartValidationResponse
- ChargebackDispute
- ChargebackDisputeResponse
- ChargebackDisputesResponse
- CheckoutHandoffRequest
- CheckoutHandoffResponse
- CheckoutSetupBrowserKeyRequest
- CheckoutSetupBrowserKeyResponse
- CityStateZip
- Country
- Coupon
- CouponAmountOffItems
- CouponAmountOffShipping
- CouponAmountOffShippingWithItemsPurchase
- CouponAmountOffSubtotal
- CouponAmountOffSubtotalAndShipping
- CouponAmountOffSubtotalFreeShippingWithPurchase
- CouponAmountOffSubtotalWithBlockPurchase
- CouponAmountOffSubtotalWithItemsPurchase
- CouponCodesRequest
- CouponCodesResponse
- CouponDiscountItemWithItemPurchase
- CouponDiscountItems
- CouponEditorValues
- CouponFreeItemAndShippingWithSubtotal
- CouponFreeItemWithItemPurchase
- CouponFreeItemWithSubtotal
- CouponFreeItemsWithItemPurchase
- CouponFreeItemsWithMixMatchPurchase
- CouponFreeShipping
- CouponFreeShippingSpecificItems
- CouponFreeShippingWithItemsPurchase
- CouponFreeShippingWithSubtotal
- CouponMultipleAmountsOffItems
- CouponNoDiscount
- CouponPercentOffItemWithItemsQuantityPurchase
- CouponPercentOffItems
- CouponPercentOffItemsAndFreeShipping
- CouponPercentOffItemsWithItemsPurchase
- CouponPercentOffRetailPriceItems
- CouponPercentOffShipping
- CouponPercentOffSubtotal
- CouponPercentOffSubtotalAndFreeShipping
- CouponPercentOffSubtotalLimit
- CouponPercentOffSubtotalWithItemsPurchase
- CouponPercentOffSubtotalWithSubtotal
- CouponQuery
- CouponResponse
- CouponTierAmount
- CouponTierItemDiscount
- CouponTierPercent
- CouponTierQuantityAmount
- CouponTierQuantityPercent
- CouponTieredAmountOffItem
- CouponTieredAmountOffSubtotal
- CouponTieredPercentOffItems
- CouponTieredPercentOffShipping
- CouponTieredPercentOffSubtotal
- CouponsResponse
- Currency
- Customer
- CustomerAffiliate
- CustomerBilling
- CustomerCard
- CustomerEditorValues
- CustomerEmail
- CustomerPricingTier
- CustomerQuery
- CustomerResponse
- CustomerShipping
- CustomersResponse
- Distance
- DistributionCenter
- DistributionCentersResponse
- Error
- ErrorResponse
- FulfillmentInventory
- FulfillmentShipment
- HTTPHeader
- Item
- ItemAccounting
- ItemAmember
- ItemAutoOrder
- ItemAutoOrderStep
- ItemAutoOrderStepArbitraryUnitCostSchedule
- ItemAutoOrderStepGrandfatherPricing
- ItemCCBill
- ItemChannelPartnerMapping
- ItemChargeback
- ItemChargebackAddendum
- ItemChargebackAdjustmentRequest
- ItemCheckout
- ItemContent
- ItemContentAssignment
- ItemContentAttribute
- ItemContentMultimedia
- ItemContentMultimediaThumbnail
- ItemDigitalDelivery
- ItemDigitalItem
- ItemEbay
- ItemEbayCategorySpecific
- ItemEbayMarketListing
- ItemEbayMarketPlaceAnalysis
- ItemEmailNotifications
- ItemEnrollment123
- ItemGiftCertificate
- ItemGoogleProductSearch
- ItemIdentifiers
- ItemInstantPaymentNotification
- ItemInstantPaymentNotifications
- ItemInternal
- ItemKitComponent
- ItemKitDefinition
- ItemOption
- ItemOptionValue
- ItemOptionValueAdditionalItem
- ItemOptionValueDigitalItem
- ItemPaymentProcessing
- ItemPhysical
- ItemPricing
- ItemPricingTier
- ItemPricingTierDiscount
- ItemPricingTierLimit
- ItemRealtimePricing
- ItemRelated
- ItemRelatedItem
- ItemReporting
- ItemResponse
- ItemRestriction
- ItemRestrictionItem
- ItemRevguard
- ItemReviews
- ItemSalesforce
- ItemShipping
- ItemShippingCase
- ItemShippingDestinationMarkup
- ItemShippingDestinationRestriction
- ItemShippingDistributionCenter
- ItemShippingMethod
- ItemShippingPackageRequirement
- ItemTax
- ItemTaxExemption
- ItemThirdPartyEmailMarketing
- ItemVariantItem
- ItemVariation
- ItemVariationOption
- ItemWishlistMember
- ItemsRequest
- ItemsResponse
- OauthRevokeSuccessResponse
- OauthTokenResponse
- Order
- OrderAffiliate
- OrderAffiliateLedger
- OrderAutoOrder
- OrderBilling
- OrderBuysafe
- OrderChannelPartner
- OrderCheckout
- OrderCoupon
- OrderDigitalItem
- OrderDigitalOrder
- OrderEdi
- OrderFormat
- OrderFormatResponse
- OrderFraudScore
- OrderGift
- OrderGiftCertificate
- OrderInternal
- OrderItem
- OrderItemEdi
- OrderItemEdiIdentification
- OrderItemEdiLot
- OrderItemOption
- OrderItemOptionFileAttachment
- OrderLinkedShipment
- OrderMarketing
- OrderPayment
- OrderPaymentCheck
- OrderPaymentCreditCard
- OrderPaymentECheck
- OrderPaymentPurchaseOrder
- OrderPaymentTransaction
- OrderPaymentTransactionDetail
- OrderQuery
- OrderQuote
- OrderResponse
- OrderSalesforce
- OrderShipping
- OrderSummary
- OrderTaxes
- OrdersResponse
- ResponseMetadata
- ResultSet
- TempMultimedia
- TempMultimediaResponse
- Webhook
- WebhookEventCategory
- WebhookEventSubscription
- WebhookLog
- WebhookLogResponse
- WebhookLogSummariesResponse
- WebhookLogSummary
- WebhookResponse
- WebhookSampleRequest
- WebhookSampleRequestResponse
- WebhooksResponse
- Weight
- Type: API key
- API key parameter name: x-ultracart-browser-key
- Location: HTTP header
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://secure.ultracart.com/rest/v2/oauth/authorize
- Scopes:
- affiliate_read: Allows you to read affiliate information.
- affiliate_write: Allows you to write affiliate information.
- auto_order_read: Allows you to read auto order information.
- auto_order_write: Allows you to write auto order information.
- chargeback_read: Allows you to read chargeback information.
- chargeback_write: Allows you to write chargeback information.
- checkout_read: Allows you to read checkout information.
- checkout_write: Allows you to write checkout information.
- coupon_read: Allows you to read coupon information.
- coupon_write: Allows you to write coupon information.
- customer_read: Allows you to read customer information.
- customer_write: Allows you to write customer information.
- fulfillment_read: Allows you to read fulfillment information.
- fulfillment_write: Allows you to write fulfillment information.
- order_read: Allows you to read order information.
- order_write: Allows you to write order information.
- item_read: Allows you to read item information.
- item_write: Allows you to write item information.
- webhook_read: Allows you to read webhook information.
- webhook_write: Allows you to write webhook information.
- ultrabooks_read: 1 of 2 required to use UltraBooks
- ultrabooks_write: 2 of 2 required to use UltraBooks
- Type: API key
- API key parameter name: x-ultracart-simple-key
- Location: HTTP header