Documentation

Ucommerce includes full API reference documentation and lots of helpful articles to help you build your e-commerce site as effortlessly as possible.

Topics Payment Providers
v7.18

TransactionLibrary

Ucommerce.Api.ITransactionLibrary

Methods


HasBasket

  • Arguments
    • This method is called without any arguments
  • Return type Boolean

GetBasket

  • Description
    Gets the current basket.
  • Arguments
    • Boolean create = False: If set to true and no basket currently exists, it will return a new basket.
  • Return type Ucommerce.EntitiesV2.PurchaseOrder

NewBasket

  • Description
    Returns a new basket.
  • Arguments
    • string catalogName: Sets the currency of the basket based on the provided catalog.
  • Return type Ucommerce.EntitiesV2.Basket

GetPurchaseOrderByPaymentReference

  • Description
    Returns the PurchaseOrder with the provided payment reference id.
  • Arguments
    • string paymentReferenceId: Id provided by the payment provider.
  • Return type Ucommerce.EntitiesV2.PurchaseOrder

GetPurchaseOrder

  • Description
    Returns the PurchaseOrder with the provided order number.
  • Arguments
    • string orderNumber: The order number (or order Guid in string format) of the PurchaseOrder.
    • Boolean validateForCurrentMember = False: If set to true, it will check if the purchase belongs to the member.
  • Return type Ucommerce.EntitiesV2.PurchaseOrder

GetPurchaseOrder

  • Description
    Gets a purchase order based on Guid.
  • Arguments
    • Guid guid: The Guid of the PurchaseOrder.
  • Return type Ucommerce.EntitiesV2.PurchaseOrder

AddToBasket

  • Description
    Adds an OrderLine to basket.
  • Arguments
    • int quantity: The quantity.
    • Guid productId: The guid of the product.
    • Guid? variantId = null: The guid of the optional variant.
    • Decimal? unitPrice = null: If provided it will overwrite the product's unit price. Adds "HasCustomPrice" property on the order.
    • Guid? priceGroupId = null: If provided it will overwrite the product's price group.
    • Boolean addToExistingLine = True: If set to true [add to existing line].
    • Boolean executeBasketPipeline = True: If set to true [execute basket pipeline].
    • IDictionary<string, Object> properties = null: Order properties to include in the AddToBasket pipeline. These are stored under uCommerce_OrderProperty.
  • Return type Ucommerce.EntitiesV2.OrderLine

AddToBasket

  • Description
    Adds an OrderLine to basket.
  • Arguments
    • int quantity: The quantity.
    • string sku: The sku of the product.
    • string variantSku = null: The sku of the optional variant.
    • Decimal? unitPrice = null: If provided it will overwrite the product's unit price. Adds "HasCustomPrice" property on the order.
    • Guid? priceGroupId = null: If provided it will overwrite the product's price group.
    • Boolean addToExistingLine = True: If set to true [add to existing line].
    • Boolean executeBasketPipeline = True: If set to true [execute basket pipeline].
    • IDictionary<string, Object> properties = null: Order properties to include in the AddToBasket pipeline. These are stored under uCommerce_OrderProperty.
  • Return type Ucommerce.EntitiesV2.OrderLine

UpdateLineItemByOrderLineId

  • Description
    Updates quantity of OrderLine by order line id.
  • Arguments
    • int orderLineId: Id of the OrderLine.
    • int newQuantity: Updated quantity. If set to 0, it will remove the OrderLine.
  • Return type Void

UpdateLineItem

  • Description
    Updates quantity of OrderLine by line item index.
  • Arguments
    • int lineItemIndex: Index of the OrderLine.
    • int newQuantity: Updated quantity. If set to 0, it will remove the OrderLine.
  • Return type Void

DeleteLineItem

  • Description
    Removes the OrderLine from the PurchaseOrder
  • Arguments
    • int lineItemIndex: Index of the OrderLine.
  • Return type Void

ClearBasket

  • Arguments
    • This method is called without any arguments
  • Return type Void

Checkout

  • Arguments
    • This method is called without any arguments
  • Return type Ucommerce.EntitiesV2.PurchaseOrder

AssignOrderNumber

  • Description
    Assigns an order number to the basket.
  • Arguments
    • string orderNumber = null: If order number null, it will auto-set one.
  • Return type string

ExecuteOrderPipeline

  • Description
    Executes the pipeline on the PurchaseOrder.
  • Arguments
    • string pipelineName: Name of the desired pipeline.
  • Return type Void

ExecuteBasketPipeline

  • Arguments
    • This method is called without any arguments
  • Return type Void

SetPurchaseOrderNote

  • Description
    Adds a note to the PurchaseOrder.
  • Arguments
    • string note: Note for the PurchaseOrder.
  • Return type Void

SetOrderProperty

  • Description
    Sets an OrderProperty on the OrderLine.
  • Arguments
    • int lineItemIndex: Index of the OrderLine.
    • string key: Key of the property.
    • string value: Value of the property.
  • Return type Void

SetOrderProperty

  • Description
    Sets an OrderProperty on the basket.
  • Arguments
    • string key: Key of the property.
    • string value: Value of the property.
  • Return type Void

EditBillingInformation

  • Description
    Creates or updates the billing OrderAddress.
  • Arguments
    • string firstName: Billing first name.
    • string lastName: Billing last name.
    • string emailAddress: Billing email address.
    • string phoneNumber: Billing phone number.
    • string mobilePhoneNumber: Billing mobile number.
    • string company: Billing company.
    • string line1: Billing line 1.
    • string line2: Billing line 2.
    • string postalCode: Billing postal code.
    • string city: Billing city.
    • string state: Billing state.
    • string attention: Billing attention.
    • int countryId: Billing country id.
  • Return type Void

EditShippingInformation

  • Description
    Creates or updates the shipping OrderAddress with default address name.
  • Arguments
    • string firstName: Shipping first name.
    • string lastName: Shipping last name.
    • string emailAddress: Shipping email address.
    • string phoneNumber: Shipping phone number.
    • string mobilePhoneNumber: Shipping mobile number.
    • string company: Shipping company.
    • string line1: Shipping line 1.
    • string line2: Shipping line 2.
    • string postalCode: Shipping postal code.
    • string city: Shipping city.
    • string state: Shipping state.
    • string attention: Shipping attention.
    • int countryId: Shipping country id.
  • Return type Void

EditShipmentInformation

  • Description
    Creates or updates the shipping OrderAddress.
  • Arguments
    • string addressName: Shipping address name.
    • string firstName: Shipping first name.
    • string lastName: Shipping last name.
    • string emailAddress: Shipping email address.
    • string phoneNumber: Shipping phone number.
    • string mobilePhoneNumber: Shipping mobile number.
    • string company: Shipping company.
    • string line1: Shipping line 1.
    • string line2: Shipping line 2.
    • string postalCode: Shipping postal code.
    • string city: Shipping city.
    • string state: Shipping state.
    • string attention: Shipping attention.
    • int countryId: Shipping country id.
  • Return type Void

EditCustomerAddress

  • Description
    Creates or updates the customer OrderAddress.
  • Arguments
    • string addressName: Customer address name.
    • string firstName: Customer first name.
    • string lastName: Customer last name.
    • string emailAddress: Customer email address.
    • string phoneNumber: Customer phone number.
    • string mobilePhoneNumber: Customer mobile number.
    • string company: Customer company.
    • string line1: Customer line 1.
    • string line2: Customer line 2.
    • string postalCode: Customer postal code.
    • string city: Customer city.
    • string state: Customer state.
    • string attention: Customer attention.
    • int countryId: Customer country id.
  • Return type Void

EditOrderAddress

  • Description
    Creates or updates an OrderAddress based on the address name.
  • Arguments
    • string addressName: Address name.
    • string firstName: First name.
    • string lastName: Last name.
    • string emailAddress: Email address.
    • string phoneNumber: Phone number.
    • string mobilePhoneNumber: Mobile number.
    • string company: Company.
    • string line1: Line 1.
    • string line2: Line 2.
    • string postalCode: Postal code.
    • string city: City.
    • string state: State.
    • string attention: Attention.
    • int countryId: Country id.
  • Return type Void

GetPaymentMethods

  • Description
    Gets the payment methods.
  • Arguments
    • string shippingAddressName = null: Name of the shipping address.
  • Return type ICollection<Ucommerce.EntitiesV2.PaymentMethod>

GetPaymentMethods

  • Description
    Gets the payment methods.
  • Arguments
    • Ucommerce.EntitiesV2.Country country: The country.
  • Return type ICollection<Ucommerce.EntitiesV2.PaymentMethod>

GetPaymentMethods

  • Description
    Gets the payment methods.
  • Arguments
    • Ucommerce.Search.Models.ProductCatalogGroup productCatalogGroup: The product catalog group.
    • Ucommerce.EntitiesV2.Country country: The country.
  • Return type ICollection<Ucommerce.EntitiesV2.PaymentMethod>

CreatePayment

  • Description
    Creates the payment on the customer's basket. If basket already has a payment, it will be overwritten.
  • Arguments
    • int paymentMethodId: The payment method id.
  • Return type Ucommerce.EntitiesV2.Payment

CreatePayment

  • Description
    Creates the payment on the customer's basket. If basket already has a payment, it will be overwritten.
  • Arguments
    • int paymentMethodId: The payment method id.
    • Decimal amount: The amount.
  • Return type Ucommerce.EntitiesV2.Payment

CreatePayment

  • Description
    Creates the payment on the customer's basket. If basket already has a payment, it will be overwritten.
  • Arguments
    • int paymentMethodId: The payment method id.
    • Decimal amount: The amount.
    • Boolean requestPayment: If set to true [request payment].
  • Return type Ucommerce.EntitiesV2.Payment

CreatePayment

  • Description
    Creates the payment on the customer's basket.
  • Arguments
    • int paymentMethodId: The payment method id.
    • Decimal amount: The amount.
    • Boolean requestPayment: If set to true [request payment].
    • Boolean overwriteExisting: If set to true [overwrite existing] payment.
  • Return type Ucommerce.EntitiesV2.Payment

RenderPaymentForm

  • Description
    Renders the payment form.
  • Arguments
    • string paymentIdentifier: The payment identifier.
  • Return type string

RequestPayment

  • Description
    Requests the payment.
  • Arguments
    • int paymentId: The payment id.
  • Return type Void

GetPaymentPageUrl

  • Description
    Returns the external payment URL. This URL redirects the customer to the payment page.
  • Arguments
    • Ucommerce.EntitiesV2.Payment payment: The payment.
  • Return type string

GetCountries

  • Arguments
    • This method is called without any arguments
  • Return type ICollection<Ucommerce.EntitiesV2.Country>

GetShippingMethods

  • Description
    Returns a collection of ShippingMethods available for the country of the shipping address.
  • Arguments
    • string shippingAddressName = null: The shipping address name.
  • Return type ICollection<Ucommerce.EntitiesV2.ShippingMethod>

GetShippingMethod

  • Description
    Returns the ShippingMethod of the first shipment on the basket.
  • Arguments
    • string addressName = null: If null then method returns the first shipping with a default shipping name.
  • Return type Ucommerce.EntitiesV2.ShippingMethod

GetShippingMethods

  • Description
    Returns a collection of ShippingMethod based on country.
  • Arguments
    • Ucommerce.EntitiesV2.Country country: The country.
  • Return type ICollection<Ucommerce.EntitiesV2.ShippingMethod>

GetShippingMethods

  • Description
    Returns a collection of ShippingMethod based on the ProductCatalogGroup and country.
  • Arguments
    • Ucommerce.Search.Models.ProductCatalogGroup productCatalogGroup: The product catalog group.
    • Ucommerce.EntitiesV2.Country country: The country.
  • Return type ICollection<Ucommerce.EntitiesV2.ShippingMethod>

CreateShipment

  • Description
    Creates a shipment on the current basket.
  • Arguments
    • int shippingMethodId: The shipping method id.
    • string addressName: The address name.
    • Boolean overwriteExisting = True: If set to false, [overwrite existing].
  • Return type Void

DeleteShipment

  • Description
    Deletes a shipment from the current basket.
  • Arguments
    • int shipmentId: The shipment id.
  • Return type Void

GetShippingInformation

  • Description
    Returns the current baskets shipping information.
  • Arguments
    • string addressName = null: If null, the method uses default shipping address name.
  • Return type Ucommerce.EntitiesV2.OrderAddress

GetBillingInformation

  • Arguments
    • This method is called without any arguments
  • Return type Ucommerce.EntitiesV2.OrderAddress

GetMemberOrderHistory

  • Description
    Returns a list of orders for the logged in user.
  • Arguments
    • string statusName = null: The status.
    • Boolean allCatalogGroups = False: If false, the method looks in the current catalog group."/>
  • Return type ICollection<Ucommerce.EntitiesV2.PurchaseOrder>

SendEmail

  • Description
    Sends email of selected type to the current user's billing email address.
  • Arguments
    • string emailTypeName: The email type.
    • string orderNumber: The order number.
  • Return type Void

SendEmail

  • Description
    Sends email of selected type to a specified email address.
  • Arguments
    • string receiverEmailAddress: The receiver email address.
    • string emailTypeName: The email type.
    • string orderNumber: The order number.
  • Return type Void

FormatCurrency

  • Description
    Formats the amount to a decimal string based on current culture.
  • Arguments
    • string amount: The amount.
  • Return type string

FormatCurrency

  • Description
    Formats the amount to a decimal string based on current culture.
  • Arguments
    • Decimal? amount: The amount.
  • Return type string

FormatCurrency

  • Description
    Formats the amount to a decimal string based on given culture.
  • Arguments
    • string amount: The amount.
    • string cultureCode: The culture code.
  • Return type string

FormatCurrency

  • Description
    Formats the amount to a decimal string based on given culture.
  • Arguments
    • Decimal? amount: The amount.
    • string cultureCode: The culture code.
  • Return type string