Skip to main content

Update product

Overview

Use the updateProduct method to update the configuration of a subscription plan/product you already configured for your account. 

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

Product

Required (object)

 

Use this object to configure your subscription plans/products.

 

You can update/edit all parameters, except the following:

  • AvangateID
  • ProductType

Exceptions

When updating a subscription plan/product, you also update its PricingConfigurations. However, you cannot modify:

  • The pricing configuration CODE.
  • The PricingSchema from DYNAMIC to FLAT or vice versa.  

Request

<?php

require ('PATH_TO_AUTH');

$ProductCode = 'NewProdCodeAPI12345';

try {
$myProduct = $client->getProductByCode($sessionID, $ProductCode);
}

catch (SoapFault $e) {
    echo "myProduct: " . $e->getMessage();
    exit;
}

$myProduct->ProductName = 'Edited_From_API_Again';

var_dump ($myProduct);

try {
    $NewSubscriptionPlan = $client->updateProduct($sessionID, $myProduct);
}

catch (SoapFault $e) {
    echo "UpdatedProductInfo: " . $e->getMessage();
    exit;
}

var_dump("UpdatedProductInfo", $NewSubscriptionPlan);

?>

Response

bool(true)

 

Pricing configuration

Overview

This object is returned directly or within a successful response from the following API requests:

Pricing configuration object

Parameters Type/Description
Name String
  Pricing configuration name.
Code String
  System-generated identifier. Read-only.
Default Boolean
  True for the default pricing configuration
BillingCountries Array of strings
 

ISO codes of the countries assigned to the pricing configuration.

Empty unless a pricing configuration has specific countries assigned.

PricingSchema String
 

DYNAMIC – With a base price

FLAT – Without a base price

PriceType String
 

Possible values:

• NET

• GROSS

DefaultCurrency String
  The ISO code of the default currency for the pricing configuration.
Prices Object
  Details below.
  Regular Array of objects
    Details below.
    Amount Int
      The price of the product. Use -1 to delete it.
    Currency String
      ISO code of the currency for the product price.
    MinQuantity Int
      The minimum quantity of volume discounts. Default is 1.
    MaxQuantity Int
      The maximum quantity of volume discounts. Default is 99999.
    OptionCodes Array of objects
      Details below.
      Code String
        System generated pricing options group code (you can also configure it) that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.
      Options StringArray
        The pricing options group option code you configured that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.
  Renewal Array of objects
    Details below.
    Amount Int
      The price of the product. Use -1 to delete it.
    Currency String
      ISO code of the currency for the product price.
    MinQuantity Int
      The minimum quantity of volume discounts. Default is 1.
    MaxQuantity Int
      The maximum quantity of volume discounts. Default is 99999.
    OptionCodes Array of objects
      Details below.
PriceOptions Array of objects
  Details below.
  Code String
    System generated pricing options group code (you can also configure it) that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.
  Required Boolean
   

true – you set the price options group as required during the purchase process.

false - you did not set the price options group as required during the purchase process.

 

 

Next renewal price

Overview

Use the methods below to set or retrieve information related to the next renewal price to be charged on a customer's subscription.

 

Generate SKU Schema

Overview

Stock keeping unit or SKU is a number assigned to a particular product by a digital or physical retail store for easy identification and inventory tracking purposes. The SKU number is a string of alphanumeric characters that uniquely identify details such as price, product options, and manufacturer of a particular product or service. SKUs are used in order notifications, electronic delivery, export files, etc.

SKU Management

For companies that manage large product catalogs with defined SKUs and that make regular changes to their prices and products (new versions, new options), the manual process performed in the Merchant Control Panel needs to be supported by an automatic solution as well. By using an automated flow, merchants decrease the time needed for this process, and also reduce the risk of human errors associated with the manual process.

In the 2Checkout platform, SKUs can be associated with a unique combination made up of:

  • Product identification element
  • Pricing configuration
  • Plus minimum one of the following:
    • Currency – defined as applicable to all currencies or only to specific ones
    • Volume Discounts – defined as specific quantity or intervals (applicable only according to the volume discounts that are defined at pricing configuration level)
    • Purchase Types – possible values: new purchase, renewal, upgrade, and trial
    • Pricing Options – will be available considering the pricing option groups assigned to the selected pricing configuration

 

 

Reseller

Overview

Structure

Reseller Object
ResellerCode String
  Unique, system generated reseller identifier. Can be NULL.
Company String
  Reseller company name. Can be NULL.
FirstName String
  Reseller first name. Can be NULL.
LastName String
  Reseller last name. Can be NULL.
Email String
  Reseller email. Can be NULL.
Phone String
  Reseller phone. Can be NULL.
Fax String
  Reseller fax. Can be NULL.
Country String
  Reseller country ISO language code (ISO 639-1 two-letter code). Can be NULL.
State String
  Reseller state. For example, "Alabama","Alaska","Arizona". Can be NULL.
City String
  Reseller city. Can be NULL.
Address String
  Reseller address. Can be NULL.
PostalCode String
  Reseller ZIP code. Can be NULL.

 

Purchase order status change

Use the variables in the list below to customize the Purchase order status change shopper email according to your needs. Check the 'Mandatory' column to see the variables that are required in your customized version of the e-mail.

Variable name Description Test Value Mandatory

ALLOW_MYACCOUNT_PROMO

Include or exclude myAccount information in the email body

1 No
AVANGATE_LOGO Avangate logo URL https://secure.avangate.com/images/e...endor_logo.png Yes

BANKACCOUNT

Avangate bank account

[NLXXABNAXXXXXXXXXX (IBAN)] No

BANKNAME

Avangate bank name

ABN AMRO Bank Amsterdam No

BANKSWIFT

Avangate bank swift code

ABNANL2XXX No

BASE_URL

Merchant's full host

https://secure.avangate.com No

BUSINESS_COMPANY

Avangate company name

Avangate Yes

BUSINESS_HOTLINE

Avangate support phone

0 No

BUSINESS_HOTLINEUS

Avangate US hotline number

0 No

BUSINESS_OPEMAIL

Avangate operational email address

0 No

BUSINESS_OPFAX

Avangate operational fax number

0 No

BUSINESS_SUPEMAIL

Avangate support email address

0 No

COMMERCIALNAME

Merchant's commercial name

0 Yes

CURRENCY_ORIGINAL

Original order currency (applicable to refunds)

0 No

DELIVERABILITY

Order delivery status

0 No

ENCRYPTED_MERCHANT_CODE

Encrypted merchant code

0 No

EXTRA_INFO

0

0 No

FIRSTNAME

Shopper's first name used on the delivery information

John No
GATEWAY_ERROR_CODE Gateway error code GW_PROCESSING_ERROR

See the full
list of Possible Values
No
GATEWAY_ERROR_MESSAGE Reason why the transaction failed. (e.g. Invalid card, insufficient funds) Error processing the card transaction. The card account has not been debited. Card data is invalid or incomplete. No

HAS_RENEWAL_PRODUCTS

Flag that indicates whether at least one product has renewal settings

0 No

HOTLINE_NUMBERS

0

0 No

HOTLINE_NUMBERS.NG_PHONE[index1].HotlineName

Countries where Avangate support information is available

0 No

HOTLINE_NUMBERS.NG_PHONE[index1].HotlineValue

Avangate phone number(s) for shopper support

0 No

IS_RENEWAL

Flag that indicates whether at least one product has renewal settings

0 No

LANGUAGE

Order language (abbreviated) selected by shopper

en No

LASTNAME

Shopper's last name used on the delivery information

Doe No

NAMES_OF_PRODUCTS

Names of all products in the order, comma separated

0 No

ORDERDATE

Order placement date

10/9/2019 No

ORDER_AMOUNT_ORIGINAL

Original order value (applicable to refunds)

10/9/2019 No

ORDER_DATE_STANDARD_FORMAT

Standard format used for the order placement date

0 No

ORDER_FLOW

Purchase flow used to place the order

0 No

ORDER_STATUS

Order status

0 No

PAYABLE_TO

Payee name (applicable to wire transfer)

0 No

PAYMENT_TYPE_INFO

English payment method name. Includes last four card digits (if applicable).

0 No

PO_STATUS

Status of the Purchase Order

0 Yes

PRODUCTS

0

0 No

PRODUCTS[index1].LICENSE_TYPE

Type of purchased subscription

0 No

PRODUCTS[index1].PNAME

Product name

0 No

PRODUCTS[index1].SHORT_DESCRIPTION

Short product description

0 No

PRODUCTS_DATA[index1].IdProduct

Product ID number

0 No

PRODUCTS_DATA[index1].PRODUCT_SHORT_DESCRIPTION

Short product description

0 No

PRODUCTS_NO

Number of products in cart

0 No

REFNO

Order reference number

9xxxxxx Yes

RETRYLINK

Payment retry link

0 No

RETRY_LINK

Payment retry link

0 No

SHOPPER_REFERENCE_NUMBER

Shopper  reference number

PO12345 No

UPLOADLINK

File upload link

0 No

UPLOAD_LINK

File upload link

0 No

USER_EMAIL

Email address used by shopper to login/signup to myAccount

example@customer-email.com No

USER_TOKEN

Shopper token for Avangate myAccount access

0 No

WEBSITE

Website where the shopper placed the order

http://www.software-company-website.com Yes

Product Delivery Information (Sample)

Overview

Depending on your product type, the delivery policy can differ. Below you can find a few policy samples and you can choose to use the one that applies to your product type.

Delivery Policy for Tangible/Physical Products (Sample)

All orders are subject to product availability.

Shipping 

If an item in your order is unavailable, we will ship you the part of your order that is available. When that item becomes available, we will ship you the rest of your order. Shipping costs for your order are non-refundable and are based on the weight of the items you order and your location. The date of delivery for your order may vary due to carrier shipping practices, delivery location, method of delivery, and the number of items ordered, and in addition, your order may be delivered in separate shipments.

Additional taxes and charges 

Additional shipping charges may apply depending on your location and the size of your order. You are responsible for all taxes applicable to the delivery of your order, including sales tax, value-added tax, customs duties, and excise duties. If there is any damage to the items that you ordered on delivery, you must contact us within 5 days from receipt of your order.

Delivery Policy for Downloadable Digital Products (Sample)

Upon receipt of your order, you will either be prompted to begin your download immediately or you will receive an e-mail from us with instructions to complete your download. If you are prompted to begin your download immediately, your completion of the download will constitute delivery to you of the item(s) you purchased.

If you receive an e-mail from us with instructions to complete your download, the receipt by you of the e-mail will constitute delivery by us to you of the item(s) you purchased.

In case you are unable to download the item(s) you purchase or you do not receive an e-mail from us with instructions to complete your download, you must contact us within 5 days from the date of your order. If you do not contact us within 5 days from the date of your order, the item(s) you purchased will be considered received, downloaded, and delivered to you.

Delivery Policy for Services (Sample)

Upon receipt of your order, the services will be performed to you in accordance with the terms applicable to the services that you purchased. The nature of the services you purchased and the date of your purchase may impact the timing of the performance of the services. The services will be deemed to be successfully delivered to you upon the performance of the services

Enable/Disable product

Overview

Use the setProductStatus method to enable/disable products for your account. 

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

productCode

Required (string)

 

Use this object to configure your subscription plan/products.

 

You can set all Product parameters except 2CheckoutID. The 2Checkout system sets the unique product ID. The 2CheckoutID is not editable.

Status

Required (Boolean)

 

True or False, depending on whether you want to enable or disable a subscription plan/product.

Request Example

<?php

require ('PATH_TO_AUTH');

$ProductCode = "YourProductCode";

try {
    $ProductStatus = $client->setProductStatus($sessionID, $ProductCode, true); // TRUE to enable a product - FALSE to disable a product
}

catch (SoapFault $e) {
    echo "ProductStatus: " . $e->getMessage();
    exit;
}

var_dump("ProductStatus", $ProductStatus);

?>

Response Example

bool(true)

 

Add sources

Overview

Use the addPromotionSources method to define new sources for an existing promotion.

Parameters

Parameter Type/Description

sessionID

Required (string)

 

Output of the Login method.

promotionCode

Required (string)

 

The code corresponding to the promotion that you want to add products to.

promotionSources

Required (string array)

 

Array of strings defining the promotion sources.

Response

Parameter Type/Description

promotionSources

String array

 

Array of strings defining the promotion sources.

Request

<?php

require ('PATH_TO_AUTH');

// Promotion code corresponding to the promotion you want to add sources to
$promotionCode = '';

// Sources array with the source values 
$sources = ['source1', 'source2'];

try {
    $updatedPromotion = $client->addPromotionSources($promotionCode,$sources);
}

catch (SoapFault $e) {
    echo "UpdatedPromotion: " . $e->getMessage();
    exit;
}

var_dump("UpdatedPromotion", $updatedPromotion);

Pricing option

Overview

This object is returned directly or within a successful response from the following API requests:

Retrieve a price option group                  Retrieve assigned price option groups                         Retrieve price option groups

Pricing option group

Parameters Type/Description

Name

String

 

Price option group name.

 

Use this parameter when adding a new price options group.

 

To edit the name of a price option group use the Name parameter under the Translations object.

Description

String

 

 

Pricing option group description.

Translations

Array of objects

 

 

Details below.

 

Name

String

 

 

Localized product pricing options group name under PriceOptionGroup.

Localized pricing option child name under Options.

 

Description

String

 

 

Localized product pricing options group description underPriceOptionGroup.

Localized pricing option child description under Options.

 

Language

String

 

 

ISO language code. (ISO 639-1 two-letter code).

Code

String

 

 

Unique code that The 2Checkout system generates or set for each pricing options group.

Type

String

 

 

The type of the pricing options group. Possible values:

· RADIO

· CHECKBOX

· INTERVAL

· COMBO

Options

Array of PriceOption objects

 

 

Details below.

                                                   PriceOption

Object

 

Code

String

 

 

The code you set or that the 2Checkout system generated for each pricing option child inside a pricing options group parent.

 

ScaleMin

Int

 

 

The minimum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

 

ScaleMax

Int

 

 

The maximum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

 

SubscriptionImpact

SubscriptionLifetimeImpact object

 

 

Details below.

 

                    Months

String

 

 

The value in months the 2Checkout system adds or subtracts from the initial billing cycle of a subscription.

 

                     Impact

String

 

 

Possible values:

· ADD

· SUBTRACT

· LIFETIME

 

PriceImpact

Object

 

 

Details below.

 

                  ImpactOn

String

 

 

Possible values:

  • BASE corresponding to impact on base price
  • GLOBAL for impact on calculated sum.
 

                  Impact

String

 

 

Impact on price per unit:

  • ADD
  • SUBTRACT
 

                   Percent

String

 

 

The value of the percentage out of the price per product unit, when you usePERCENT for Method.

 

                    Method

String

 

 

Possible values:

· PERCENT

· FIXED

 

                    Amounts

Array of objects.

 

 

Details below.

 

                             Currency

String

 

 

Currency ISO code - ISO 4217.

 

                              Amount

String

 

 

The amount defined for each specific currency active for your account, when you use FIXED for Method.

 

Default

Boolean

 

 

TRUE for preselected options.

Missing for options that are not preselected.

 

Name

String

 

 

Pricing option child name.

 

Description

String

 

 

Pricing option child description.

 

Translations

Array of objects

 

 

Details below.

Usage  

String.

Defines the type of pricing for scale product options. Can be either regular (tiered pricing) or payperusage (metered billing).

 

 

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo