For the complete documentation index, see llms.txt. This page is also available as Markdown.

Leads

Get Lead

get

Retrieve information about your leads.

Path parameters
LeadCodestringRequired

Unique code which represents an existing lead

Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

Get Lead

application/json
LeadCodestringOptionalExample: TFTF76455ee4YFCFCT6545465
GeneratedFromstringOptionalExample: API
CartIdstringOptionalExample: tstsetststs45453
CurrencystringOptionalExample: USD
LanguagestringOptionalExample: EN
ExternalReferencestringOptionalExample: REST_API_AVANGTE
MachineIdstringOptionalExample: 123
LocalTimestringOptionalExample: 2018-02-08 11:32:02
get/leads/{LeadCode}
GET /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}"
200

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"
}

Update a Lead

put

Be aware that when updating a lead, all the existing data for that lead will be overwritten with the provided parameters.

Path parameters
LeadCodestringRequired

Lead's code

Example: FD86FD98
Query parameters
CartIdstringOptional

Id of the cart

Example: du8945jgd
GeneratedFromstringOptional

Source

Example: du8945jgd
CurrencystringRequired

Currency

Example: EUR
LanguagestringOptional

Lead's language

Example: EN
ExternalReferencestringOptional

Vendor's reference

Example: REST_API_AVANGTE
MachineIdstringOptional

Machine id

Example: 7df4s
FollowedUpbooleanOptional

Followed up

Example: false
LocalTimestringOptional

Local time

Example: 2019-01-08 11:46:12
Itemsobject[]Required

Purchased products

Example: [{"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}}]
BillingDetailsobjectRequired

Billing details

Example: {"FirstName":"Customer","LastName":"Avangate","FiscalCode":"32423423","Email":"customer@avangate.com","Address1":"Test Address","City":"LA","Zip":"12345","CountryCode":"us","State":"CA"}
DeliveryDetailsobjectOptional

Delivery details

Example: {"FirstName":"Customer","LastName":"Avangate","FiscalCode":"32423423","Email":"customer@avangate.com","Address1":"Test Address","City":"LA","Zip":"12345","CountryCode":"us","State":"CA"}
DeliveryInformationobjectOptional

Delivery informations

Example: {"ShippingMethod":{"Code":"sdfsd"}}
PaymentDetailsobjectOptional

Details about payment

Example: {"Type":"CC","Currency":"EUR","RecurringEnabled":true,"PaymentMethod":{"CardPayment":{"InstallmentsNumber":32}},"CustomerIP":"1.2.3.4"}
Promotionsstring[]Optional

Promotion codes

Example: ["FJ34JK9","OIU546KH0"]
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Responses
200

Add lead

application/json
put/leads/{LeadCode}
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
200

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"
      }
    ]
  }
}

Search Leads

get
Query parameters
LeadCodestring[]Optional

Unique code which represents an existing lead

Example: ["FJE349FG"]
EmailstringOptional

Shopper's email address

Example: test@2checkout.com
TypestringOptional

Lead type

Example: Used
StartDatestringOptional

Start date

Example: 2018-01-02
EndDatestringOptional

End date

Example: 2019-01-02
ProductCodestring[]Optional

Product code. This can be a string and contain only one code or an array with multiple codes

Example: ["653465fYVYR"]
LanguagestringOptional

Shopper cart language code

Example: FR
CountrystringOptional

Shopper billing country code

Example: BG
GeneratedFromstringOptional

Source of the generated Lead

Example: API
PageintegerOptional

Page number

Example: 2
LimitintegerOptional

Number of results on a page

Example: 25
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

Get Lead

application/json
get/leads/
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}"
200

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
  }
}

Add Leads for catalog products

post
Query parameters
LeadCodestringOptional

Lead's code

Example: FD86FD98
CartIdstringOptional

Id of the cart

Example: du8945jgd
CurrencystringRequired

Currency

Example: EUR
LanguagestringOptional

Lead's language

Example: EN
ExternalReferencestringOptional

Vendor's reference

Example: REST_API_AVANGTE
SourcestringOptional

Lead's source

Example: testAPI.com
CustomerReferencestringOptional

Customer reference

Example: asdf1
MachineIdintegerOptional

Machine id

Example: 132
LocalTimestringOptional

Local time

Example: 2019-01-08 11:46:12
Itemsobject[]Required

Purchased products

Example: [{"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}}]
BillingDetailsobjectRequired

Billing details

Example: {"FirstName":"Customer","LastName":"Avangate","FiscalCode":"32423423","Email":"customer@avangate.com","Address1":"Test Address","City":"LA","Zip":"12345","CountryCode":"us","State":"CA"}
DeliveryDetailsobjectOptional

Delivery details

Example: {"FirstName":"Customer","LastName":"Avangate","FiscalCode":"32423423","Email":"customer@avangate.com","Address1":"Test Address","City":"LA","Zip":"12345","CountryCode":"us","State":"CA"}
DeliveryInformationobjectOptional

Delivery informations

Example: {"ShippingMethod":{"Code":"sdfsd"}}
PaymentDetailsobjectOptional

Details about payment

Example: {"Type":"CC","Currency":"EUR","RecurringEnabled":true,"PaymentMethod":{"CardPayment":{"InstallmentsNumber":32}},"CustomerIP":"1.2.3.4"}
Promotionsstring[]Optional

Promotion codes

Example: ["FJ34JK9","OIU546KH0"]
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Responses
200

Add lead

application/json
post/leads/
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
200

Add lead

{
  "LeadResponse": {
    "LeadCode": "3501E8CADA",
    "CreatedAt": "2018-10-05 12:45:32",
    "Errors": [
      {
        "Code": "LEAD_COUPON_CODE_EMPTY",
        "Description": "The coupon code is empty"
      }
    ]
  }
}

Mark leads as used and stop follow-ups

put
Query parameters
Array of objectsobject[]Required

Array of objects

Example: [{"LeadCode":"FD454FDG","Used":false,"StopFollowups":true},{"LeadCode":"JI143FYU","Used":false,"StopFollowups":true}]
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Responses
200

Mark Leads Response

application/json
ResponsestringOptionalExample: 4 leads have been marked successfully
put/leads/
PUT /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
200

Mark Leads Response

{
  "Response": "4 leads have been marked successfully",
  "Errors": [
    {
      "Code": "WRONG_COUNTRY",
      "Description": "Wrong country"
    }
  ]
}

Last updated

Was this helpful?