Leads
Retrieve information about your leads.
Unique code which represents an existing lead
application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"Get Lead
TFTF76455ee4YFCFCT6545465APItstsetststs45453USDENREST_API_AVANGTE1232018-02-08 11:32:02GET /rest/6.0/leads/{LeadCode} HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Get Lead
{
"LeadCode": "TFTF76455ee4YFCFCT6545465",
"GeneratedFrom": "API",
"CartId": "tstsetststs45453",
"Currency": "USD",
"Language": "EN",
"ExternalReference": "REST_API_AVANGTE",
"MachineId": "123",
"Items": {
"0": {
"Code": "my_product_1",
"Quantity": 1,
"SKU": "df1",
"IsDynamic": false,
"Tangible": false,
"PurchaseType": "PRODUCT",
"PriceOptions": {
"0": {
"Name": "sdfsd",
"Options": {
"0": {
"Name": "fsdfsdf",
"Value": "fsdfsdf",
"Surcharge": 10.36
}
}
}
},
"RecurringOptions": {
"Object": {
"CycleLength": 23,
"CycleUnit": "m",
"CycleAmount": 23,
"ContractLength": 23,
"ContractUnit": "m"
}
},
"MarketingCampaigns": {
"Object": {
"Type": 23,
"ParentCode": "m",
"CampaignCode": 23
}
},
"Price": {
"0": {
"Amount": 23,
"Type": "m"
}
},
"AdditionalFields": {
"0": {
"Code": "f",
"Text": "m",
"Value": "s"
}
},
"SubscriptionStartDate": "0000-00-00 00:00:00",
"Trial": {
"Period": 2,
"Price": 4.17
}
}
},
"BillingDetails": {
"Object": {
"FirstName": "Customer",
"LastName": "Avangate",
"Phone": "065-897-4568",
"Company": "Chack",
"FiscalCode": "32423423",
"Email": "customer@avangate.com",
"Address1": "Test Address",
"Address2": "null",
"City": "LA",
"Zip": "12345",
"CountryCode": "US",
"State": "CA"
}
},
"DeliveryDetails": {
"0": {
"Phone": "065-897-4568",
"FirstName": "Customer",
"LastName": "Avangate",
"Company": "Chack",
"FiscalCode": "32423423",
"Email": "customer@avangate.com",
"Address1": "Test Address",
"Address2": "null",
"City": "LA",
"Zip": "12345",
"CountryCode": "US",
"State": "CA"
}
},
"DeliveryInformation": {
"0": {
"ShippingMethod": {
"Code": "sdfsd"
}
}
},
"PaymentDetails": {
"0": {
"Type": "CC",
"Currency": "EUR",
"RecurringEnabled": true,
"PaymentMethod": {
"CardPayment": {
"InstallmentsNumber": 3
}
},
"CustomerIP": "1.2.3.4"
}
},
"Promotions": [
{
"0": "PROMOCODE4"
}
],
"LocalTime": "2018-02-08 11:32:02"
}Be aware that when updating a lead, all the existing data for that lead will be overwritten with the provided parameters.
Lead's code
FD86FD98Id of the cart
du8945jgdSource
du8945jgdCurrency
EURLead's language
ENVendor's reference
REST_API_AVANGTEMachine id
7df4sFollowed up
falseLocal time
2019-01-08 11:46:12Purchased products
[{"Code":"my_subscription_1","Quantity":"1","SKU":"df1","IsDynamic":false,"Tangible":false,"PurchaseType":"","Name":"asd","Description":"asd","PriceOptions":[{"Name":"sdfsd","Options":[{"Name":"fsdfsdf","Value":"fsdfsdf","Surcharge":10.36}]}],"RecurringOptions":{"CycleLength":23,"CycleUnit":"m","CycleAmount":23,"ContractLength":23,"ContractUnit":"m"},"MarketingCampaigns":{"Type":23,"ParentCode":"m","CampaignCode":23},"Price":{"Amount":23,"Type":"m"},"AdditionalFields":[{"Code":"f","Text":"m","Value":"m"}],"SubscriptionStartDate":"e","Trial":{"Period":2,"GrossPrice":5,"VAT":0.83,"NetPrice":4.17}}]Billing details
{"FirstName":"Customer","LastName":"Avangate","FiscalCode":"32423423","Email":"customer@avangate.com","Address1":"Test Address","City":"LA","Zip":"12345","CountryCode":"us","State":"CA"}Delivery details
{"FirstName":"Customer","LastName":"Avangate","FiscalCode":"32423423","Email":"customer@avangate.com","Address1":"Test Address","City":"LA","Zip":"12345","CountryCode":"us","State":"CA"}Delivery informations
{"ShippingMethod":{"Code":"sdfsd"}}Details about payment
{"Type":"CC","Currency":"EUR","RecurringEnabled":true,"PaymentMethod":{"CardPayment":{"InstallmentsNumber":32}},"CustomerIP":"1.2.3.4"}Promotion codes
["FJ34JK9","OIU546KH0"]Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: Add lead
PUT /rest/6.0/leads/{LeadCode}?Currency=EUR&Items=[object+Object]&BillingDetails=[object+Object] HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Add lead
{
"LeadResponse": {
"LeadCode": "3501E8CADA",
"CreatedAt": "2018-10-05 12:45:32",
"UpdatedAt": "2018-10-05 12:45:32",
"Errors": [
{
"Code": "LEAD_COUPON_CODE_EMPTY",
"Description": "The coupon code is empty"
}
]
}
}Unique code which represents an existing lead
["FJE349FG"]Shopper's email address
test@2checkout.comLead type
UsedStart date
2018-01-02End date
2019-01-02Product code. This can be a string and contain only one code or an array with multiple codes
["653465fYVYR"]Shopper cart language code
FRShopper billing country code
BGSource of the generated Lead
APIPage number
2Number of results on a page
25application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"Get Lead
GET /rest/6.0/leads/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Get Lead
{
"Items": {
"LeadCode": "TFTF76455ee4YFCFCT6545465",
"GeneratedFrom": "API",
"CartId": "tstsetststs45453",
"Currency": "USD",
"Language": "EN",
"ExternalReference": "REST_API_AVANGTE",
"MachineId": "123",
"Items": {
"0": {
"Code": "my_product_1",
"Quantity": 1,
"SKU": "df1",
"IsDynamic": false,
"Tangible": false,
"PurchaseType": "PRODUCT",
"PriceOptions": {
"0": {
"Name": "sdfsd",
"Options": {
"0": {
"Name": "fsdfsdf",
"Value": "fsdfsdf",
"Surcharge": 10.36
}
}
}
},
"RecurringOptions": {
"Object": {
"CycleLength": 23,
"CycleUnit": "m",
"CycleAmount": 23,
"ContractLength": 23,
"ContractUnit": "m"
}
},
"MarketingCampaigns": {
"Object": {
"Type": 23,
"ParentCode": "m",
"CampaignCode": 23
}
},
"Price": {
"0": {
"Amount": 23,
"Type": "m"
}
},
"AdditionalFields": {
"0": {
"Code": "f",
"Text": "m",
"Value": "s"
}
},
"SubscriptionStartDate": "0000-00-00 00:00:00",
"Trial": {
"Period": 2,
"Price": 4.17
}
}
},
"BillingDetails": {
"Object": {
"FirstName": "Customer",
"LastName": "Avangate",
"Phone": "065-897-4568",
"Company": "Chack",
"FiscalCode": "32423423",
"Email": "customer@avangate.com",
"Address1": "Test Address",
"Address2": "null",
"City": "LA",
"Zip": "12345",
"CountryCode": "US",
"State": "CA"
}
},
"DeliveryDetails": {
"0": {
"Phone": "065-897-4568",
"FirstName": "Customer",
"LastName": "Avangate",
"Company": "Chack",
"FiscalCode": "32423423",
"Email": "customer@avangate.com",
"Address1": "Test Address",
"Address2": "null",
"City": "LA",
"Zip": "12345",
"CountryCode": "US",
"State": "CA"
}
},
"DeliveryInformation": {
"0": {
"ShippingMethod": {
"Code": "sdfsd"
}
}
},
"PaymentDetails": {
"0": {
"Type": "CC",
"Currency": "EUR",
"RecurringEnabled": true,
"PaymentMethod": {
"CardPayment": {
"InstallmentsNumber": 3
}
},
"CustomerIP": "1.2.3.4"
}
},
"Promotions": [
{
"0": "PROMOCODE4"
}
],
"LocalTime": "2018-02-08 11:32:02"
},
"Pagination": {
"Page": 1,
"Limit": 10,
"Count": 12
}
}Lead's code
FD86FD98Id of the cart
du8945jgdCurrency
EURLead's language
ENVendor's reference
REST_API_AVANGTELead's source
testAPI.comCustomer reference
asdf1Machine id
132Local time
2019-01-08 11:46:12Purchased products
[{"Code":"my_subscription_1","Quantity":"1","SKU":"df1","IsDynamic":false,"Tangible":false,"PurchaseType":"","Name":"asd","Description":"asd","PriceOptions":[{"Name":"sdfsd","Options":[{"Name":"fsdfsdf","Value":"fsdfsdf","Surcharge":10.36}]}],"RecurringOptions":{"CycleLength":23,"CycleUnit":"m","CycleAmount":23,"ContractLength":23,"ContractUnit":"m"},"MarketingCampaigns":{"Type":23,"ParentCode":"m","CampaignCode":23},"Price":{"Amount":23,"Type":"m"},"AdditionalFields":[{"Code":"f","Text":"m","Value":"m"}],"SubscriptionStartDate":"e","Trial":{"Period":2,"GrossPrice":5,"VAT":0.83,"NetPrice":4.17}}]Billing details
{"FirstName":"Customer","LastName":"Avangate","FiscalCode":"32423423","Email":"customer@avangate.com","Address1":"Test Address","City":"LA","Zip":"12345","CountryCode":"us","State":"CA"}Delivery details
{"FirstName":"Customer","LastName":"Avangate","FiscalCode":"32423423","Email":"customer@avangate.com","Address1":"Test Address","City":"LA","Zip":"12345","CountryCode":"us","State":"CA"}Delivery informations
{"ShippingMethod":{"Code":"sdfsd"}}Details about payment
{"Type":"CC","Currency":"EUR","RecurringEnabled":true,"PaymentMethod":{"CardPayment":{"InstallmentsNumber":32}},"CustomerIP":"1.2.3.4"}Promotion codes
["FJ34JK9","OIU546KH0"]Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: Add lead
POST /rest/6.0/leads/?Currency=text&Items=[object+Object]&BillingDetails=[object+Object] HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Add lead
{
"LeadResponse": {
"LeadCode": "3501E8CADA",
"CreatedAt": "2018-10-05 12:45:32",
"Errors": [
{
"Code": "LEAD_COUPON_CODE_EMPTY",
"Description": "The coupon code is empty"
}
]
}
}Array of objects
[{"LeadCode":"FD454FDG","Used":false,"StopFollowups":true},{"LeadCode":"JI143FYU","Used":false,"StopFollowups":true}]Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: Mark Leads Response
4 leads have been marked successfullyPUT /rest/6.0/leads/?Array+of+objects=[object+Object] HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Mark Leads Response
{
"Response": "4 leads have been marked successfully",
"Errors": [
{
"Code": "WRONG_COUNTRY",
"Description": "Wrong country"
}
]
}Last updated
Was this helpful?