Order information object
Overview
Use this object to retrieve information about orders.
Attributes
Parameters | Type/Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RefNo |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Avangate generates unique reference numbers for all orders (purchases). You can use this parameter to retry authorizations for orders with failed transactions by changing the payment method.
NULL when you place new orders. |
||||||||||||||||||||||||||||||||||||
OrderNo |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The consecutive order number Avangate associates with orders and displays in the Order search area of your account. |
||||||||||||||||||||||||||||||||||||
ExternalReference |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Set external reference identifiers for orders. Enables you to replicate the functionality of the REF parameter included into Buy Links. Maximum 100 characters. If there is a need for longer references, you can apply an md5 hash for any string value, resulting in a 32 characters string. You can verify the hash after the order notification, on the client side. |
||||||||||||||||||||||||||||||||||||
ShopperRefNo |
Optional (string) |
|||||||||||||||||||||||||||||||||||
External shopper identifier. |
||||||||||||||||||||||||||||||||||||
Status |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The status of the order:
|
||||||||||||||||||||||||||||||||||||
ApproveStatus |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The status of the order resulted from the evaluation by the Avangate anti-fraud system or by a member of the anti-fraud department. This status varies for new purchases and for orders requiring customers to make manual payments. Possible values:
|
||||||||||||||||||||||||||||||||||||
VendorApproveStatus |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shows if you approved or not a partner order. Possible values:
|
||||||||||||||||||||||||||||||||||||
Language |
Optional (string) |
|||||||||||||||||||||||||||||||||||
ISO 639-1 two-letter code. Language used for the purchase process. Example: “en.” |
||||||||||||||||||||||||||||||||||||
OrderDate |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Y-m-d H:i:s (2014-05-22 00:12:12) The datetime stamp (in the API time zone defined in cPanel) when customers place their orders. |
||||||||||||||||||||||||||||||||||||
FinishDate |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Y-m-d H:i:s (2014-05-22 00:12:12) The datetime stamp (in the API time zone defined in cPanel) when the order reach the Complete status.
NULL for order that did not reach the Complete/Finished stage. |
||||||||||||||||||||||||||||||||||||
Source |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The link source for the sales. Enables you to replicate the functionality of the SRC (separate link identifier) parameter when included into Buy Links. Use the SRC parameter to track sale sources. Maximum length 255 characters. Cannot be null. |
||||||||||||||||||||||||||||||||||||
AffiliateSource |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The link source for affiliate referred sales. Similar to the functionality of the SRC (separate link identifier) parameter included into Buy Links, but controlled by the AFFSRC parameter. Affiliates use the AFFSRC parameter to track sale sources for their referrals. Maximum length 255 characters. |
||||||||||||||||||||||||||||||||||||
AffiliateId |
Optional (int) |
|||||||||||||||||||||||||||||||||||
Identifier belonging to affiliates who refer orders. |
||||||||||||||||||||||||||||||||||||
AffiliateName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Affiliate name. |
||||||||||||||||||||||||||||||||||||
AffiliateUrl |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Affiliate website URL from the Affiliate Details. |
||||||||||||||||||||||||||||||||||||
RecurringEnabled |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
true or false, depending on whether the shoppers checked the subscription auto-renewal checkbox or not, during the purchase process. |
||||||||||||||||||||||||||||||||||||
HasShipping |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
true or false, depending on whether the order requires shipping. |
||||||||||||||||||||||||||||||||||||
BillingDetails |
Optional (Object) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Person |
Object |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
FirstName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper name. |
||||||||||||||||||||||||||||||||||||
LastName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper surname. |
||||||||||||||||||||||||||||||||||||
CountryCode |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper country. ISO 3166 two-letter code. |
||||||||||||||||||||||||||||||||||||
State |
Optional (string) – Required for US, Brazil, India and Romania |
|||||||||||||||||||||||||||||||||||
The state in the shopper's country. Mandatory when you set the Billing Country to US, Brazil, India and Romania. Use case insensitive utf8 strings for the full name, or just the two letter code. |
||||||||||||||||||||||||||||||||||||
City |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper city. |
||||||||||||||||||||||||||||||||||||
Address1 |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper address. |
||||||||||||||||||||||||||||||||||||
Address2 |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper address. |
||||||||||||||||||||||||||||||||||||
Zip |
Optional (string) |
|||||||||||||||||||||||||||||||||||
ZIP/ Postal code. |
||||||||||||||||||||||||||||||||||||
|
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper email address. |
||||||||||||||||||||||||||||||||||||
Phone |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper phone number. Mandatory when you set Brazil as the Billing Country. Can be NULL. |
||||||||||||||||||||||||||||||||||||
Company |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Company name. Can be null for end users. When present, you also need to provide the FiscalCode. |
||||||||||||||||||||||||||||||||||||
FiscalCode |
Optional (string) – Required for Brazil |
|||||||||||||||||||||||||||||||||||
• For companies, it needs to be the VAT ID. Avangate will validate the value provided and throw an error if the VAT ID is invalid/incorrect when calling setPaymentDetails. When present, you also need to provide the Company name. • Mandatory when the Billing Country is set to Brazil. For Brazilian customers it represents the Fiscal Code (CPF/CNPJ). • Mandatory when the Billing Country is set to India, and purchase is made by a Company. • Can be null for end users. |
||||||||||||||||||||||||||||||||||||
DeliveryDetails |
Optional (Object) Optional. When missing, Avangate uses the same details as for the BillingDetails object. |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Person |
Object |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
FirstName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper name from the delivery details. |
||||||||||||||||||||||||||||||||||||
LastName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper surname from the delivery details. |
||||||||||||||||||||||||||||||||||||
CountryCode |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper country. ISO 3166 two-letter code from the delivery details. |
||||||||||||||||||||||||||||||||||||
State |
Optional (string) – Required for US, Brazil and Romania |
|||||||||||||||||||||||||||||||||||
The state in the shopper's country from the delivery details. Mandatory when you set the Billing Country to US, Brazil and Romania. Use case insensitive utf8 strings for the full name, or just the two letter code. |
||||||||||||||||||||||||||||||||||||
City |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper city from the delivery details. |
||||||||||||||||||||||||||||||||||||
Address1 |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper address from the delivery details. |
||||||||||||||||||||||||||||||||||||
Address2 |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper address from the delivery details. |
||||||||||||||||||||||||||||||||||||
Zip |
Optional (string) |
|||||||||||||||||||||||||||||||||||
ZIP/ Postal code from the delivery details. |
||||||||||||||||||||||||||||||||||||
|
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper email address from the delivery details. |
||||||||||||||||||||||||||||||||||||
Phone |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper phone number from the delivery details. Mandatory when you set Brazil as the Billing Country. Can be NULL. |
||||||||||||||||||||||||||||||||||||
Company |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Company name from the delivery details. Can be null for end users. When present, you also need to provide the FiscalCode. |
||||||||||||||||||||||||||||||||||||
PaymentDetails |
Optional (Object) |
|||||||||||||||||||||||||||||||||||
Adapt this object to the desired payment method. |
||||||||||||||||||||||||||||||||||||
Type |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The payment method:
|
||||||||||||||||||||||||||||||||||||
Currency |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The currency ISO code for the payment - ISO 4217. Example: “usd.” |
||||||||||||||||||||||||||||||||||||
PaymentMethod |
Optional (object) |
|||||||||||||||||||||||||||||||||||
Object structure and parameters differ according to payment method selected and API method (placing orders (POST) vs. retrieving order data (GET)). For payments with credit cards, PalPay Express, previous order reference and purchase order use the objects below.
For payments with check and wire, send only the ‘CHECH’ and ‘WIRE’ strings.
null for 0 value orders for which you’re not requiring customers to enter payment details. |
||||||||||||||||||||||||||||||||||||
PaymentDetailsCard |
Optional (object) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
CardType |
Optional (string) |
|||||||||||||||||||||||||||||||||||
visa, visaelectron, mastercard, maestro, amex, discover, dankort, cartebleue, jcb, hipercard, elo |
||||||||||||||||||||||||||||||||||||
FirstDigits |
Optional (string) |
|||||||||||||||||||||||||||||||||||
First four digits of the credit card. |
||||||||||||||||||||||||||||||||||||
LastDigits |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Last four digits of the credit card. |
||||||||||||||||||||||||||||||||||||
CheckPaymentDetails |
Optional (Object) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Beneficiary |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The beneficiary of the payment. Can be NULL. |
||||||||||||||||||||||||||||||||||||
CheckPostalAddress |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The address of the beneficiary. Can be NULL. |
||||||||||||||||||||||||||||||||||||
Amount |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The total costs incurred by the customer for an order. Can be NULL. |
||||||||||||||||||||||||||||||||||||
Currency |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The currency ISO code of the order/payment - ISO 4217. Can be NULL. |
||||||||||||||||||||||||||||||||||||
PayPalExpress |
Optional (Object) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
|
Optional (string) |
|||||||||||||||||||||||||||||||||||
Email address customers use for their PayPal account. |
||||||||||||||||||||||||||||||||||||
ReturnURL |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The PayPal Express Checkout redirect URL returned by calling the getPayPalExpressCheckoutRedirectURL method. The return URL is the page on your website to which PayPal redirects your buyer's browser after the buyer logs into PayPal and approves the payment. Typically, this is a secure page (https://...) on your site. |
||||||||||||||||||||||||||||||||||||
CancelURL |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The cancel URL is the page on your website to which PayPal redirects your buyer's browser if the buyer does not approve the payment. Typically, this is the secure page (https://...) on your site from which you redirected the buyer to PayPal. |
||||||||||||||||||||||||||||||||||||
WirePaymentDetails |
Optional (Object) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Amount |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The total costs customers incur. Can be NULL. |
||||||||||||||||||||||||||||||||||||
Currency |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The currency ISO code of the order - ISO 4217. Can be NULL. |
||||||||||||||||||||||||||||||||||||
PaymentReference |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Transaction identifier. Can be NULL. |
||||||||||||||||||||||||||||||||||||
RoutingNumber |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Identification number assigned to financial institutions. Can be NULL. |
||||||||||||||||||||||||||||||||||||
BankAccounts |
Optional (Array of objects) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Beneficiary |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The beneficiary of the payment. Can be NULL. |
||||||||||||||||||||||||||||||||||||
BankName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The name of the beneficiary's bank. Can be NULL. |
||||||||||||||||||||||||||||||||||||
BankCountry |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The country of the beneficiary's bank. Can be NULL. |
||||||||||||||||||||||||||||||||||||
BankCity |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The city of the beneficiary's bank. Can be NULL. |
||||||||||||||||||||||||||||||||||||
BankAddress |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The address of the beneficiary's bank. Can be NULL. |
||||||||||||||||||||||||||||||||||||
BankAccount |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The number for the account in which customers transfer the funds. Can be NULL. |
||||||||||||||||||||||||||||||||||||
BankAccountIban |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The IBAN of the beneficiary's bank. Can be NULL. |
||||||||||||||||||||||||||||||||||||
BankAccountSwiftCode |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The Swift Code of the beneficiary's bank. Can be NULL. |
||||||||||||||||||||||||||||||||||||
Currency |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The currency ISO code for the bank account - ISO 4217. Can be NULL. |
||||||||||||||||||||||||||||||||||||
CustomerIP |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Shopper IP. |
||||||||||||||||||||||||||||||||||||
CustomerDetails |
Object Avangate populates the parameters of the customer entity with information from the customer whose AvangateCustomerReference or ExternalCustomerReference you send during the purchase. |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
AvangateCustomerReference |
Optional (Int) |
|||||||||||||||||||||||||||||||||||
System-generated Avangate customer reference. Aggregate subscriptions under the same Customer account if the products they're associated to are purchased by the same shopper by adding the AV_CUSTOMERID (case sensitive) parameter to buy links. The Avangate system generates default customer numerical (integer) IDs (AV_CUSTOMERID) automatically for all orders containing products that feature subscriptions. |
||||||||||||||||||||||||||||||||||||
ExternalCustomerReference |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The external customer reference you control. Aggregate subscriptions under the same Customer account if the products they're associated to are purchased by the same shopper by adding the CUSTOMERID (case sensitive) parameter to buy links. |
||||||||||||||||||||||||||||||||||||
FirstName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's first name. |
||||||||||||||||||||||||||||||||||||
LastName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's last name. |
||||||||||||||||||||||||||||||||||||
CountryCode |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's country code (ISO 3166 two-letter code). |
||||||||||||||||||||||||||||||||||||
State |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's state. For example, "Alabama","Alaska","Arizona". |
||||||||||||||||||||||||||||||||||||
City |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's city. |
||||||||||||||||||||||||||||||||||||
Address1 |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's address. |
||||||||||||||||||||||||||||||||||||
Address2 |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's address. |
||||||||||||||||||||||||||||||||||||
Zip |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Zip code. |
||||||||||||||||||||||||||||||||||||
|
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's email. |
||||||||||||||||||||||||||||||||||||
Phone |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's phone number. |
||||||||||||||||||||||||||||||||||||
Company |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Company name. |
||||||||||||||||||||||||||||||||||||
FiscalCode |
Optional (string) |
|||||||||||||||||||||||||||||||||||
For companies, it needs to be the VAT ID. Avangate validates this values and throws an error if the VAT ID is invalid/incorrect. When present, you need to also provide Company name.
Can be null for end users. |
||||||||||||||||||||||||||||||||||||
Fax |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Customer's fax number. |
||||||||||||||||||||||||||||||||||||
Enabled |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
true or false, depending on whether the customer account is active or inactive. An active customer account features at least one Active or Past due subscription. |
||||||||||||||||||||||||||||||||||||
Trial |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
true or false, depending on whether the customer account features only trials or also paid subscriptions. |
||||||||||||||||||||||||||||||||||||
Language |
Optional (string) |
|||||||||||||||||||||||||||||||||||
ISO 639-1 two-letter code. Example: “en.” |
||||||||||||||||||||||||||||||||||||
ExistingCards |
Optional (Array of objects) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
TransientToken |
Optional (Object) |
|||||||||||||||||||||||||||||||||||
Populated only when you retrieve customer information by SSOToken. |
||||||||||||||||||||||||||||||||||||
Token |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Token for the EXISTING_PAYMENT_DATA flow. Use it to charge customers using cards they used in the past for purchases from your Avangate account. |
||||||||||||||||||||||||||||||||||||
CardType |
Optional (string) |
|||||||||||||||||||||||||||||||||||
visa, visaelectron, mastercard, maestro, amex, discover, dankort, cartebleue, jcb, hipercard, elo |
||||||||||||||||||||||||||||||||||||
LastDigits |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Last four digits of the credit card. |
||||||||||||||||||||||||||||||||||||
ExpirationMonth |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Card expiration month. |
||||||||||||||||||||||||||||||||||||
ExpirationYear |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Card expiration year. |
||||||||||||||||||||||||||||||||||||
NameOnCard |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Card holder name. |
||||||||||||||||||||||||||||||||||||
Origin |
Optional (String) |
|||||||||||||||||||||||||||||||||||
Avangate automatically tracks the source of purchases:
|
||||||||||||||||||||||||||||||||||||
AvangateCommission |
Optional (Int) |
|||||||||||||||||||||||||||||||||||
Avangate's commission for the order. |
||||||||||||||||||||||||||||||||||||
OrderFlow |
Optional (string) |
|||||||||||||||||||||||||||||||||||
PURCHASE_ORDER - Sent only when shoppers used Purchase Orders. REGULAR - Sent in all other cases. |
||||||||||||||||||||||||||||||||||||
GiftDetails |
Optional (object) |
|||||||||||||||||||||||||||||||||||
Contains contact details for the recipient of a gift purchase. |
||||||||||||||||||||||||||||||||||||
FirstName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
First name of gift recipient. |
||||||||||||||||||||||||||||||||||||
LastName |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Last name of gift recipient. |
||||||||||||||||||||||||||||||||||||
|
Optional (string) |
|||||||||||||||||||||||||||||||||||
Email of gift recipient. Avangate uses this email for the delivery/fulfillment process. |
||||||||||||||||||||||||||||||||||||
GiftNote |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Custom text shoppers provide as a message to the gift recipient. |
||||||||||||||||||||||||||||||||||||
PODetails |
Object (optional) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Status |
Optional (string) |
|||||||||||||||||||||||||||||||||||
PO status. Possible values:
|
||||||||||||||||||||||||||||||||||||
AutoApprove |
Optional (Boolean) |
|||||||||||||||||||||||||||||||||||
TRUE or FALSE, depending on whether you set POs to auto-approve or not. |
||||||||||||||||||||||||||||||||||||
ExtraInformation |
Optional (Object) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
|
PaymentLink |
Optional (String) |
||||||||||||||||||||||||||||||||||
|
|
Can be: 1. The PO doc upload link - If you set AutoApprove as FALSE on the original order and before shoppers upload the PO. 2. Payment link for orders with POs. Business customers can use the PaymentLink to finalize payment for orders with POs. If you set AutoApprove as TRUE on the original order and if Avangate and you approve the PO. |
||||||||||||||||||||||||||||||||||
PaymentLink |
Optional (string) |
|||||||||||||||||||||||||||||||||||
In scenarios in which an issue blocks the transaction from finalizing, Avangate provides a retry link where shopper can complete their purchase by providing new payment details. |
||||||||||||||||||||||||||||||||||||
PartnerCode |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Partner code you configured for your partner. NULL for eStore orders. |
||||||||||||||||||||||||||||||||||||
PartnerMargin |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Partner margin you set for the order. NULL for eStore orders. |
||||||||||||||||||||||||||||||||||||
PartnerMarginPercent |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The percentage of the partner margin from the net value of the products ordered, minus the value of any discounts. NULL for eStore orders. |
||||||||||||||||||||||||||||||||||||
ExtraMargin |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Extra margin you offer by editing partner orders. NULL for eStore orders. |
||||||||||||||||||||||||||||||||||||
ExtraMarginPercent |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The percentage of the extra partner margin from the net value of the products ordered, minus the partner margin and the value of any discounts. NULL for eStore orders. |
||||||||||||||||||||||||||||||||||||
ExtraDiscount |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Extra discount you offer by editing partner orders. NULL for eStore orders. |
||||||||||||||||||||||||||||||||||||
ExtraDiscountPercent |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The percentage of the partner margin from the net value of the products ordered, minus the value of any coupon discounts. NULL for eStore orders. |
||||||||||||||||||||||||||||||||||||
LocalTime |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Local shopper time in the following format: Y-m-d H:i:s. This parameter can impact the fraud score of an order when it's missing, NULL or incorrectly formatted. |
||||||||||||||||||||||||||||||||||||
TestOrder |
Optional (Boolean) |
|||||||||||||||||||||||||||||||||||
True for test orders. False of regular orders. |
||||||||||||||||||||||||||||||||||||
Errors |
Optional (StringArray) |
|||||||||||||||||||||||||||||||||||
Payment gateway processing errors. |
||||||||||||||||||||||||||||||||||||
Items |
Array of objects |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
ProductDetails |
Object |
|||||||||||||||||||||||||||||||||||
Name |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Product name. |
||||||||||||||||||||||||||||||||||||
ExtraInfo |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The text entered in the Additional information field when generating Buy links, or via the INFO[PRODUCT_ID] parameter used in Buy links. |
||||||||||||||||||||||||||||||||||||
RenewalStatus |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
Subscriptions |
Object |
|||||||||||||||||||||||||||||||||||
SubscriptionReference |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Unique, system-generated subscription identifier. |
||||||||||||||||||||||||||||||||||||
PurchaseDate |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The date time stamp when shoppers acquired their subscriptions corresponding to the moment when the Avangate system marks the purchase as finished. Format (YYYY-MM-DD HH:mm:ss). Default GMT+02:00.
e.g. 2015-08-11 15:18:52 |
||||||||||||||||||||||||||||||||||||
SubscriptionStartDate |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Example: 2015-09-29 17:57:59 |
||||||||||||||||||||||||||||||||||||
ExpirationDate |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The date time stamp of upcoming renewal/expiration for subscriptions not taking into account grace period settings.
Format (YYYY-MM-DD HH:mm:ss). Default GMT+02:00.
e.g. 2015-09-11 15:18:52 |
||||||||||||||||||||||||||||||||||||
Lifetime |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
Trial |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
Enabled |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
RecurringEnabled |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
|
PriceOptions |
Optional (array of strings) |
||||||||||||||||||||||||||||||||||
Array of price option codes. |
||||||||||||||||||||||||||||||||||||
Code |
Optional (strings) |
|||||||||||||||||||||||||||||||||||
Unique code that the Avangate system generates or that you set for each pricing options group. |
||||||||||||||||||||||||||||||||||||
Required |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
Options |
Optional (array of strings) |
|||||||||||||||||||||||||||||||||||
The code you set or that the Avangate system generates for each price option child inside a pricing options group parent. |
||||||||||||||||||||||||||||||||||||
Price |
Object |
|||||||||||||||||||||||||||||||||||
This object returns the price per unit at order line level.
In the case of trials, the object returns the costs for the trial to full subscription conversion. |
||||||||||||||||||||||||||||||||||||
UnitNetPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The value per product unit, excluding sales tax/VAT expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
UnitGrossPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Total value per product unit, including sales tax/VAT expressed in the payment currency. UnitGrossPrice does not reflect any discounts. |
||||||||||||||||||||||||||||||||||||
UnitVAT |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Sales tax/VAT per product unit expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
UnitDiscount |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Value of the discount per product unit expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
UnitNetDiscountedPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The value per product unit, expressed in the payment currency, excluding sales tax/VAT, from which Avangate deducts the unit discount. |
||||||||||||||||||||||||||||||||||||
UnitGrossDiscountedPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Total costs shoppers incur per product unit, expressed in the payment currency. This value includes sales tax/VAT, Avangate and affiliate commissions, but Avangate deducts the value of any discounts. |
||||||||||||||||||||||||||||||||||||
UnitAffiliateCommission |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Value of the affiliate commission per product unit calculated expressed in the payment currency.
Avangate deducts discounts from the costs incurred by shoppers before calculating affiliate commissions.
Avangate does not take into account shipping costs when calculating affiliate commissions.
NULL when Avangate does not apply an affiliate commission. |
||||||||||||||||||||||||||||||||||||
Currency |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The currency ISO code for the payment - ISO 4217. Example: usd. |
||||||||||||||||||||||||||||||||||||
NetPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The value per order line, excluding sales tax/VAT expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
GrossPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Total value per order line, including sales tax/VAT expressed in the payment currency. UnitGrossPrice does not reflect any discounts. |
||||||||||||||||||||||||||||||||||||
NetDiscountedPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The NetPrice value per order line (in the payment currency), excluding sales tax/VAT, from which Avangate deducts discounts. |
||||||||||||||||||||||||||||||||||||
GrossDiscountedPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Total costs shoppers incur per order line, expressed in the payment currency. This value includes sales tax/VAT, Avangate and affiliate commissions, but Avangate deducts the value of any discounts.
Example:
|
||||||||||||||||||||||||||||||||||||
Discount |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Value of the discounts per order line expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
VAT |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Value of sales tax/VAT per order line expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
AffiliateCommission |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Value of the affiliate commission per order line, calculated from the NetDiscountedPrice expressed in the payment currency. Or NULL. Avangate does not take into account shipping costs when calculating affiliate commissions. |
||||||||||||||||||||||||||||||||||||
Code |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Unique product identifier your control. Max length 256 characters. |
||||||||||||||||||||||||||||||||||||
Quantity |
Optional (integer) |
|||||||||||||||||||||||||||||||||||
Number of units |
||||||||||||||||||||||||||||||||||||
SKU |
Optional (string) |
|||||||||||||||||||||||||||||||||||
SKU identifier. |
||||||||||||||||||||||||||||||||||||
CrossSell |
Optional (Object) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
ParentCode |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The product code of the master product you set to trigger the campaign. |
||||||||||||||||||||||||||||||||||||
CampaignCode |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Unique, system-generated identifier for cross-sell campaigns. |
||||||||||||||||||||||||||||||||||||
Trial |
Optional (Object) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Period |
Optional (integer) |
|||||||||||||||||||||||||||||||||||
The length of the trial subscription lifetime in days. |
||||||||||||||||||||||||||||||||||||
GrossPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Total trial price in the payment currency before Avangate deducts any taxes, discounts, etc. |
||||||||||||||||||||||||||||||||||||
VAT |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The total value of taxes for the trial in the payment currency, before Avangate deducts any discounts. |
||||||||||||||||||||||||||||||||||||
NetPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Total trial price in the payment currency, not including taxes, before Avangate deducts any discounts. |
||||||||||||||||||||||||||||||||||||
AdditionalFields |
Optional (array of objects) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Code |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The alpha-numeric characters, underscores and dashes that are set as the field identifier. |
||||||||||||||||||||||||||||||||||||
Text |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Field text visible to shoppers in the cart. |
||||||||||||||||||||||||||||||||||||
Value |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Selected field value. |
||||||||||||||||||||||||||||||||||||
Promotion |
Optional (object) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Name |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Promotion name. |
||||||||||||||||||||||||||||||||||||
Description |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Promotion description. |
||||||||||||||||||||||||||||||||||||
StartDate |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The date when you set the promotion to start. NULL for promotions that start immediately after you create them. |
||||||||||||||||||||||||||||||||||||
EndDate |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The date when you set the promotion to end. NULL for promotions you want active indefinitely. |
||||||||||||||||||||||||||||||||||||
MaximumOrdersNumber |
Optional (integer) |
|||||||||||||||||||||||||||||||||||
Avangate only applies the promotion to a maximum number of orders you define.
Can be NULL if you want the promotion to apply to an unlimited number of orders. |
||||||||||||||||||||||||||||||||||||
MaximumQuantity |
Optional (integer) |
|||||||||||||||||||||||||||||||||||
Discount only applies to a maximum number of units purchased through a single order, smaller than the quantity you defined. Shoppers purchase any extra units at full price. Can be NULL if you want the promotion to apply to an unlimited number units. |
||||||||||||||||||||||||||||||||||||
InstantDiscount |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
The instant discount option auto-applies the discount for ALL selected products, without the need for shoppers to enter a discount coupon. |
||||||||||||||||||||||||||||||||||||
Coupon |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Promotion coupon/voucher. |
||||||||||||||||||||||||||||||||||||
DiscountLabel |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Discounts can be set as a percentage from the product price or as a fixed amount in the chosen currency. |
||||||||||||||||||||||||||||||||||||
Enabled |
Optional (string) |
|||||||||||||||||||||||||||||||||||
true or false, depending on whether a promotion is active or disabled. |
||||||||||||||||||||||||||||||||||||
Type |
Optional (string) |
|||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
Promotions |
Optional (Array of objects) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Name |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Promotion name. |
||||||||||||||||||||||||||||||||||||
Description |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Promotion description. |
||||||||||||||||||||||||||||||||||||
StartDate |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The date when you set the promotion to start. NULL for promotions that start immediately after you create them. |
||||||||||||||||||||||||||||||||||||
EndDate |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The date when you set the promotion to end. NULL for promotions you want active indefinitely. |
||||||||||||||||||||||||||||||||||||
MaximumOrdersNumber |
Optional (integer) |
|||||||||||||||||||||||||||||||||||
Avangate only applies the promotion to a maximum number of orders you define.
Can be NULL if you want the promotion to apply to an unlimited number of orders. |
||||||||||||||||||||||||||||||||||||
MaximumQuantity |
Optional (integer) |
|||||||||||||||||||||||||||||||||||
Discount only applies to a specific number of units purchased at once, smaller than the maximum quantity you defined. Shoppers purchase any extra units at full price. Can be NULL if you want the promotion to apply to an unlimited number units. |
||||||||||||||||||||||||||||||||||||
InstantDiscount |
Optional (boolean) |
|||||||||||||||||||||||||||||||||||
The instant discount option auto-applies the discount for ALL selected products, without the need for shoppers to enter a discount coupon. |
||||||||||||||||||||||||||||||||||||
Coupon |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Promotion coupon/voucher. |
||||||||||||||||||||||||||||||||||||
DiscountLabel |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Discounts can be set as a percentage from the product price or as a fixed amount in the payment currency. |
||||||||||||||||||||||||||||||||||||
Enabled |
Optional (string) |
|||||||||||||||||||||||||||||||||||
true or false, depending on whether a promotion is active or disabled. |
||||||||||||||||||||||||||||||||||||
Type |
Optional (string) |
|||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
AdditionalFields |
Optional (array of objects) |
|||||||||||||||||||||||||||||||||||
Details below. |
||||||||||||||||||||||||||||||||||||
Code |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The alpha-numeric characters, underscores and dashes that are set as the field identifier. |
||||||||||||||||||||||||||||||||||||
Text |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Field text visible to shoppers in the cart. |
||||||||||||||||||||||||||||||||||||
Value |
Optional (string) |
|||||||||||||||||||||||||||||||||||
Selected field value. |
||||||||||||||||||||||||||||||||||||
Currency |
Optional (string) |
|||||||||||||||||||||||||||||||||||
The currency ISO code for the payment - ISO 4217. Example: usd. |
||||||||||||||||||||||||||||||||||||
NetPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Order value excluding sales tax/VAT expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
GrossPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Total order value, including sales tax/VAT expressed in the payment currency. GrossPrice does not reflect any discounts. |
||||||||||||||||||||||||||||||||||||
NetDiscountedPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
The NetPrice order value excluding sales tax/VAT, from which Avangate deducts discounts. NetDiscountedPrice is expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
GrossDiscountedPrice |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Total costs shoppers incur, expressed in the payment currency. This value includes sales tax/VAT, Avangate and affiliate commissions, but Avangate deducts the value of any discounts.
For example:
|
||||||||||||||||||||||||||||||||||||
Discount |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Value of the discounts for an order expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
VAT |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Value of sales tax/VAT expressed in the payment currency. |
||||||||||||||||||||||||||||||||||||
AffiliateCommission |
Optional (double) |
|||||||||||||||||||||||||||||||||||
Value of the affiliate commission for the order calculated from the NetDiscountedPrice expressed in the payment currency. Or NULL. Avangate does not take into account shipping costs when calculating affiliate commissions. |
||||||||||||||||||||||||||||||||||||
FxMarkup | Optional (double) | |||||||||||||||||||||||||||||||||||
Exchange rate markup for the order. | ||||||||||||||||||||||||||||||||||||
FxRate | Optional (double) | |||||||||||||||||||||||||||||||||||
Exchange rate Avangate used for the order. | ||||||||||||||||||||||||||||||||||||
PayoutCurrency | Optional (string) | |||||||||||||||||||||||||||||||||||
The ISO code of your account's payout currency - ISO 4217. |
Customer
Overview
The object below is returned directly or within a successful response from the following API requests:
Retrieve a customer
Customer object
Parameters | Type/Description | ||
---|---|---|---|
AvangateCustomerReference |
Int |
||
|
System-generated 2Checkout customer reference.
null when you create a new customer. The 2Checkout system generates default customer numerical (integer) IDs (AV_CUSTOMERID) automatically for all orders containing products that feature subscriptions.
Aggregate subscriptions under the same Customer account by adding the AV_CUSTOMERID (case sensitive) parameter to Buy links. |
||
ExternalCustomerReference |
String |
||
|
Unique customer alphanumeric (string) identifiers you control. Aggregate subscriptions under the same Customer account by adding the CUSTOMERID (case sensitive) parameter to Buy links. |
||
FirstName |
String |
||
|
Customer's first name. |
||
LastName |
String |
||
|
Customer's last name. |
||
Company |
String |
||
|
Company name. |
||
FiscalCode |
String |
||
|
Can be null for end users. For companies, it needs to be the VAT ID, which 2Checkout validates. 2Checkout throws an error if the VAT ID is invalid/incorrect. When present, you also need to provide the company name.
Can be null for end users. |
||
Address1 |
String |
||
|
Customer's address. |
||
Address2 |
String |
||
|
Customer's address. |
||
City |
String |
||
|
Customer's city. |
||
State |
String |
||
|
Customer's state. For example, "Alabama","Alaska","Arizona". |
||
Zip |
String |
||
|
Zip code. |
||
CountryCode |
String |
||
|
Customer's country code (ISO 3166 two-letter code). |
||
Phone |
String |
||
|
Customer's phone number. |
||
Fax |
String |
||
|
Customer's fax number. |
||
|
String |
||
|
Customer's email. |
||
ExistingCards |
Array of objects |
||
|
Details below. |
||
|
TransientToken |
Object |
|
|
|
Populated only with when you retrieve customer information by SSOToken. |
|
|
|
Token |
String |
|
|
|
Token for the EXISTING_PAYMENT_DATA flow. Use it to charge customers using cards they used in the past for purchases from your 2Checkout account. |
|
CardType |
String |
|
|
|
visa, visaelectron, mastercard, maestro, amex, discover, dankort, cartebleue, jcb, elo, hipercard |
|
|
LastDigits |
String |
|
|
|
Last four digits of the credit card. |
|
|
ExpirationMonth |
String |
|
|
|
Card expiration month. |
|
|
ExpirationYear |
String |
|
|
|
Card expiration year. |
|
|
NameOnCard |
String |
|
|
|
Card holder name. |
|
Enabled |
Boolean |
||
|
true or false, depending on whether the customer account is active or inactive. An active customer account features at least one Active or Past due subscription. Possible customer statuses:
|
||
Trial |
Boolean |
||
|
true or false, depending on whether the customer account features only trials or also paid subscriptions. |
||
Language |
String |
||
|
ISO 639-1 two-letter code. Example: “en.” |
Subscription history
Overview
Retrieve information about a subscription. Subscriptions can be retrieved starting with 5 minutes after their orders are generated in the 2Checkout system.
Parameters
Parameters |
Type/Description |
ReferenceNo |
String |
|
Unique, system-generated order reference number. |
Type |
String |
|
Purchase type:
|
SubscriptionReference |
String |
|
Unique, system-generated subscription reference. |
StartDate |
String |
|
Subscription start date(YYYY-MM-DD) - StartDate is mandatory when importing subscription data. If you changed the time zone for the Avangate API by editing system settings under Account settings, then the StartDate you provide must be in accordance with your custom configuration. |
ExpirationDate |
String |
|
Subscription expiration date(YYYY-MM-DD) - ExpirationDate is mandatory when importing subscription data. If you changed the time zone for the Avangate API by editing system settings under Account settings, then the ExpirationDate you provide must be in accordance with your custom configuration. |
Lifetime |
Boolean |
|
Possible values:
False – the subscription has a recurring billing cycle less than or equal to three years. |
SKU |
String |
|
Stock keeping unit you defined. |
Object |
|
|
Object with information about the delivery made to the customer. |
PartnerCode |
String |
|
Possible values:
|
Assign values for the product additional custom fields
Overview
Use this method to assign values to the additional fields for products.
Use case
- Add an HTML link or button on your page like the one below.
- Create a JavaScript click handler to execute the Inline Client desired methods.
- Set your currency using the theTwoCoInlineCart.cart.setCurrency('USD') method.
- Use the TwoCoInlineCart.products.add({code, quantity, additionalFields}) method to prepare your products.
- The additionalFields property should contain a list of objects with the code of the field and its value.
- Use the TwoCoInlineCart.cart.checkout() method to show the cart on your page.
Sample request
HTML
<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>
JavaScript
window.document.getElementById('buy-button').addEventListener('click', function() {
TwoCoInlineCart.cart.setCurrency('USD');
TwoCoInlineCart.products.add({
code: '2CO3MONTHS',
quantity: 1,
additionalFields: [
// textbox type example
{
code : 'NewsletterPolicy12345768',
value : 'Some text value'
},
// listbox type example
{
code : 'cart2cotestlist',
value : 'YES'
},
// hidden type example
{
code : 'HiddenID123',
value : 'Some text for the hidden field'
},
// checkbox type example
{
code : 'cart2cotest',
value : true
}
],
});
TwoCoInlineCart.cart.checkout();
});
Demo
After defining the additional fields for your products using the above method, your cart should look like this:
Manage user account login credentials for your partners
Account creation notifications
The 2Checkout system automatically sends out notifications to the email addresses designed for login usage when new users are created for partner accounts. The notification messages provide information about the newly created partner account, the login link, and setup instructions. The messages contain guidance on how to set passwords.
Single email address login for multiple partner accounts
Your partners can use the same email address to connect multiple partner accounts together, simplifying the login process and access. Using the same email, partners can log into one of their accounts once, and seamlessly access all other linked accounts. Single email login is designed to work with multiple users for accounts associated with the same partner or with different partners connected together.
Connecting different partner accounts scenarios:
- Creating new accounts.When new accounts are created, your partners should make sure to provide you with the same email address used to log into their other partner accounts. This way they ensure that all new accounts generated will be automatically linked together in terms of the login process.
- Editing email address for existing multiple partner accounts. Edit the login information for all existing accounts to have them use the same email address. Make sure to use the same email address for all existing partner accounts to ensure consistency.
Editing login information of connected accounts
Requirements
- Go to Partner management -> Partners.
- Choose the partner for which you’d like to edit details.
- Select the Users tab.
- Make sure that Vendor Commercial Managers is the option used for Users management is done by.
When editing login information of connected accounts, changing the email address, first and last name of one account will cause them to be updated across all linked accounts. Modifications of the details of one user will automatically impact all connected accounts.
This means that once you connected two or more partner accounts using the same email address/credentials, you won’t be able to unlink them.
As a workaround, you can delete a partner user altogether, and then recreate keeping all the data, but entering a different email address than the one used to link any additional accounts.
Changing the email address used to log into a specific account will cause the 2Checkout system to generate and send the following notification:
- Notification email. A message sent to the old email address associated with the account, serving a double purpose. It’s designed to notify the user of the change, while also offering the possibility of reverting the credentials modification. The link included in this email, valid for 30 days, revert the changes made to the login credentials, utilizing the old email address that was used before the latest switch.
While you can change the email address partners use to log into their accounts, you can only initiate a password reset for contacts.
Resetting passwords for users of partner accounts
When you click Reset password the system sends a message to the email address the user uses to log in. This message contains a link which redirects to an online form enabling the password to be changed. This link is only valid for 24 hours.
Master account users
Master account users have viewing access to all the orders placed on the partner account. The contact user information used when creating a partner account are used for creating the master user account.
To define a new master account user, delete the existing one and add a new user without assigning any role.
Subscription import
Overview
Add/import subscriptions in the 2Checkout system. Include card data with your subscription import only if you contacted 2Checkout to enable this functionality for your account. Otherwise, the import process results in a failure. Contact 2Checkout or your account manager directly for more details.
Parameters
Parameters | Type/Description | |||
---|---|---|---|---|
ExternalSubscriptionReference |
Required (string) |
|||
|
Unique identifier for your subscription. Mandatory when importing subscription data. |
|||
StartDate |
Required (string) |
|||
|
Subscription start date(YYYY-MM-DD) - StartDate is mandatory when importing subscription data. If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then the StartDate you provide must be in accordance with your custom configuration. |
|||
ExpirationDate |
Required (string) |
|||
|
Subscription expiration date(YYYY-MM-DD) - ExpirationDate is mandatory when importing subscription data. If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then the ExpirationDate you provide must be in accordance with your custom configuration. |
|||
Product |
Required (object) |
|||
|
The product for which 2Checkout generated the subscription. Details below. |
|||
|
ProductCode |
String |
||
|
|
Unique product identifier that you control. |
||
|
ProductId |
Int |
||
|
|
Unique, system-generated product identifier. |
||
|
ProductName |
String |
||
|
|
Product name. |
||
|
ProductQuantity |
Int |
||
|
|
Ordered number of units. |
||
|
ProductVersion |
String |
||
|
|
Product version. |
||
|
PriceOptionCodes |
Array |
||
|
|
The product options codes the customer selected when acquiring the subscription. Pricing options codes are case sensitive. |
||
EndUser |
Required (object) |
|||
|
The end-user of the subscription. Details below. |
|||
|
Person |
Object |
||
Details below. | ||||
|
|
FirstName |
String |
|
|
|
|
End user's first name |
|
|
|
LastName |
String |
|
|
|
|
End user's last name |
|
|
|
CountryCode |
String |
|
|
|
|
End user country code [ISO3166-1 Alpha 2]. |
|
|
|
State |
String |
|
|
|
|
End user state. |
|
|
|
City |
String |
|
|
|
|
End user city. |
|
|
|
Address1 |
String |
|
|
|
|
End user first address line. |
|
|
|
Address2 |
String |
|
|
|
|
End user second address line. |
|
|
|
Zip |
String |
|
|
|
|
End user zip code. |
|
|
|
|
String |
|
|
|
|
End user email address. |
|
|
|
Phone |
String |
|
|
|
|
End user phone number. |
|
|
|
Company |
String |
|
|
|
|
Company name. |
|
|
Fax |
String |
||
|
|
End user fax. |
||
|
Language |
String |
||
|
|
Language [ISO639-2] the 2Checkout system uses for communications. |
||
DeliveryInfo |
Optional (object) |
|||
|
The object contains information about the delivery/fulfillment made to the customer. |
|||
|
Description |
String |
||
|
|
Delivery description. |
||
|
Codes |
Array of objects |
||
Details below. | ||||
|
|
Code |
String |
|
|
|
|
Delivered activation key/code. |
|
|
|
Description |
String |
|
|
|
|
Code description for dynamic lists from your key generator. |
|
|
|
ExtraInfo |
Object |
|
|
|
|
Info set by your key generator for dynamic lists only. |
|
|
|
|
CodeExtraInfo |
Object |
|
|
|
Type |
String |
|
|
|
Label |
String |
|
|
|
Value |
String |
|
|
File |
Array of objects |
|
Details below. | ||||
|
|
|
Content |
String |
|
|
|
|
Content of the file (base64 encoded). |
|
|
|
ContentLength |
Int |
|
|
|
|
File size. |
|
|
|
Filename |
String |
|
|
|
|
The name of the delivered file. |
|
|
|
FileType |
String |
|
|
|
|
The type of the delivered file. |
PartnerCode |
Optional (string) |
|||
|
|
|||
ExternalCustomerReference |
Optional (string) |
|||
|
Customer identifier you control. |
|||
SubscriptionValue |
Optional (double) |
|||
|
Subscription value. The total costs incurred by the customer through the lifecycle of the subscription before you imported the item into the 2Checkout system. When you send this parameter you must accompany it by ValueCurrency. |
|||
SubscriptionValueCurrency |
Optional (string) |
|||
|
Mandatory when you also send the Value parameter. The currency associated with the subscription value. |
|||
AdditionalInfo |
Optional (string) |
|||
|
Extra information that you can attach to a subscription, such as the source of the initial purchase. |
|||
NextRenewalPrice |
Optional (double) |
|||
|
The future costs that subscribers would incur when their subscriptions are renewed. When provided, you must accompany it by NextRenewalPriceCurrency and CustomPriceBillingCyclesLeft. |
|||
NextRenewalPriceCurrency |
Optional (string) |
|||
|
Mandatory when you send CustomPriceBillingCyclesLeft. The currency associated with the subscription next renewal price value. |
|||
CustomPriceBillingCyclesLeft |
Optional (string) |
|||
|
Mandatory when you send NextRenewalPrice. 2Checkout applies the next renewal price to the number of billing cycles you define. |
|||
Test | Optional (integer) | |||
Available only for eStore subscriptions. Use 1 to import a test subscription. Exclude the parameter or set the value to 0 to import regular subscriptions. Test subscriptions enable you to try out flows like manual and auto-renewal and upgrade. | ||||
CardPayment |
Optional (object) |
|||
|
Include payment (credit/debit card) information that 2Checkout uses for recurring billing to renew imported subscriptions. Importing subscriptions with payment data is available only to eligible 2Checkout accounts. Contact 2Checkout directly for additional details. |
Card payment
Add credit/debit card details when importing subscriptions. 2Checkout uses payment information in the recurring billing process.
For imports of test subscriptions, use the credit card information from this article.
Parameters | Type/Description |
---|---|
CardPayment |
Object |
CardNumber |
Required (string) |
|
The credit/debit card number. |
CardType |
Required (string) |
|
VISA, VISAELECTRON, MASTERCARD, MAESTRO, AMEX, DISCOVER, DANKORT, CARTEBLEUE, JCB. |
ExpirationYear |
Required (string) |
|
The year in which the card expires. |
ExpirationMonth |
Required (string) |
|
The month in which the card expires. |
HolderName |
Required (string) |
|
Cardholder name. |
CCID |
Required (string) |
|
Credit Card Identification - an extra ID printed on the card, usually a 3-4 digit number, the CVC2/CVV2. |
HolderNameTime |
Required (int) |
|
The interval of time in seconds in which shoppers enter their name in the HolderName field. An abnormally short interval is usually a red flag for fraud attempts. |
AutoRenewal |
Optional (bool) |
|
True or false, depending on whether the customer or you enabled or disabled subscription auto-renewals. |
CardNumberTime |
Optional (int) |
|
The interval of time in seconds in which shopper enter their card number in the CardNumber field. An abnormally short interval is usually a red flag for fraud attempts. Can be NULL, but not a negative number. |
Next renewal price
Overview
The object below is returned directly or within a successful response from the following API requests:
Retrieve next renewal price
Next renewal price object
Parameters | Type/Description |
---|---|
NetPrice |
Double |
|
Price without taxes |
NetCurrency |
String |
|
Currency for the price without taxes. The currency ISO code used for the payment - ISO 4217. |
FinalPrice |
Double |
|
Price with taxes |
FinalCurrency |
String |
|
Currency used for prices with taxes. The currency ISO code used for the payment - ISO 4217. |
Request a partner invoice refund
Overview
Use this method to initiate a refund for a paid partner invoice.
Requirements
Parameters
Parameter | Type/Description |
---|---|
sessionID | Required (String) |
Session identifier, output of the Login method. An exception is thrown if the values are incorrect. | |
proformaNumber | Required (String) |
The unique identifier of a partner invoice from the Avangate system. | |
comment | Optional (String) |
Refund reason/additional comments. Can be NULL. |
Response
Parameter | Type/Description |
---|---|
result | Boolean |
True or false |
Request
<?php
require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner
$proformaNumber = 'YOUR_PROFORMA_NUMBER';
$comment = 'YOUR_REFUND_REASON';
try {
$ProformaRefund= $client->requestProformaRefund ($sessionID, $proformaNumber, $comment);
} catch (SoapFault $e) {
Echo "RefundProforma: " . $e->getMessage();
exit;
}
var_dump ("RefundProforma ", $ProformaRefund);
Errors
Error | Description |
---|---|
INVALID_PARTNER |
No partner is set. |
INVALID_PROFORMA_NUMBER |
Your partner invoice number is not valid. |
DUPLICATE_REFUND_REQUEST |
A refund request was already placed for this partner invoice. |
INVALID_PROFORMA |
The partner invoice needs to be paid in order to send a refund request.. |
Search proposal history by ID
Overview
Use the searchProposalHistoryById method via SOAP API 6.0 to find a specific proposal or retrieve the quote version history.
Request parameters
Parameters | Type | Required/Optional | Description |
---|---|---|---|
sessionId |
String |
Required |
Unique 2Checkout session ID code. |
ProposalId |
String |
Required |
Proposal id. |
Offset |
Integer |
Required |
The offset at which the proposals should be returned. Default value: 0. |
Limit |
Integer |
Required |
The maximum number of proposal versions (history) to return. Default value: 10. |
HasStatusComment | String | Optional |
Filters the history version by statusComment field. It can be “true” or “false”. |
Response
Parameters | Type | Description |
---|---|---|
Versions |
Object |
All versions of a proposal, paginated and ordered by date, newest first. Each element in the collection is a Proposal object. |
Count |
Integer |
The total number of proposal versions. |
Limit |
Integer |
The maximum number of proposal versions history to return. Default value: 10. |
Offset |
Integer |
The offset at which the proposal versions history is returned. |
Request sample
<?php
declare(strict_types=1);
class Configuration
{
public const MERCHANT_CODE = '';
public const MERCHANT_KEY = '';
public const URL = 'http://api.2checkout.com/soap/6.0';
public const ACTION = 'searchProposalHistoryById';
public const ADDITIONAL_OPTIONS = 'c0d6955b-f804-4a13-93a0-cb7cd04bc68a'; // existing proposal id
//array or JSON
public const PAYLOAD = <<<JSON
{
"Offset": 0,
"Limit" : 10
}
JSON;
}
class Client
{
public function call(
string $url = Configuration::URL,
$payload = Configuration::PAYLOAD,
string $action = Configuration::ACTION
): ?object {
if (is_array($payload)) {
$payload = json_encode($payload);
}
if (!empty($payload)) {
// SoapClient works with objects(StdClass)
$payload = json_decode($payload);
}
$soapClient = $this->getClient($url);
$sessionId = $this->getSession($soapClient);
$args = array_filter([$sessionId, Configuration::ADDITIONAL_OPTIONS, $payload]);
return $soapClient->$action(...$args);
}
public function getClient(string $url): SoapClient
{
return new SoapClient(
$url.'?wsdl',
[
'location' => $url,
'cache_wsdl' => WSDL_CACHE_NONE,
]
);
}
public function getSession(SoapClient $client)
{
$date = gmdate('Y-m-d H:i:s');
$merchantCode = Configuration::MERCHANT_CODE;
$key = Configuration::MERCHANT_KEY;
$string = strlen($merchantCode).$merchantCode.strlen($date).$date;
$hash = hash_hmac('md5', $string, $key);
$client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');
return $client->login($merchantCode, $date, $hash);
}
}
try {
$client = new Client();
var_dump($client->call());
} catch (Exception $ex) {
var_dump($ex);
}