Kartra Documentation TECHNICAL DOCUMENTATION

Section 27: Success and error confirmation messages

After receiving your API call, Kartra should ping-back a confirmation message upon request: either a success or an error message.

Most of these confirmation messages are usually composed of 3 pieces of information:

  1. Status of your API call: success or error.
  2. Short description text message.
  3. The message type (message ID number) for easy identification.

 

Below is the full list of errors if your API call fails to establish the connection with our API server:

{
  "status": "Error",
  "message": "Connection not secure",
  "type": "201"
}

{
  "status": "Error",
  "message": "API key cannot be empty. Please get an API key first",
  "type": "202"
}

{
  "status": "Error",
  "message": "API key not valid. Please get an API key first",
  "type": "203"
}

{
  "status": "Error",
  "message": "API password not valid. Please get an API password first",
  "type": "233"
}

{
  "status": "Error",
  "message": "API Account inactive",
  "type": "204"
}

{
  "status": "Error",
  "message": "API Account banned",
  "type": "205"
}

{
  "status": "Error",
  "message": "'cmd' is required",
  "type": "254"
}

{
  "status": "Error",
  "message": "email or lead id is required. Nothing done",
  "type": "206"
}

{
  "status": "Error",
  "message": "'lead' not an array",
  "type": "223"
}

{
  "status": "Error",
  "message": "'get_lead' not an array",
  "type": "236"
}

{
  "status": "Error",
  "message": "'actions' not an array",
  "type": "224"
}

 

Here are the error messages related to the App itself:

{
  "status": "Error",
  "message": "App Id cannot be empty. Please get an App Id first",
  "type": "238"
}

{
  "status": "Error",
  "message": "App Id is not valid. The app does not exists or is inactive",
  "type": "239"
}

{
  "status": "Error",
  "message": "App Account inactive",
  "type": "240"
}

{
  "status": "Error",
  "message": "App Account banned",
  "type": "241"
}

{
  "status": "Error",
  "message": "This API call was sent from an unauthorized IP",
  "type": "242"
}

{
  "status": "Error",
  "message": "App does not have permission to execute this CMD",
  "type": "262"
}

 

Here are the confirmation messages related to action subscribe_lead_to_list :

{
  "status": "Error",
  "message": "list_name cannot be empty. Nothing done",
  "type": "207"
}

{
  "status": "Error",
  "message": "list does not exist. Nothing done",
  "type": "237"
}

{
  "status": "Success",
  "message": "Lead subscribed in list {list_name}",
  "type": "101"
}

{
  "status": "Error",
  "message": "Lead already subscribed to list",
  "type": "235"
}

 

Here are the confirmation messages related to action unsubscribe_lead_from_list :

{
  "status": "Error",
  "message": "list_name cannot be empty. Nothing done",
  "type": "208"
}

{
  "status": "Error",
  "message": "list does not exist. Nothing done",
  "type": "209"
}

{
  "status": "Error",
  "message": "Lead already unsubscribed or not in list {list_name}",
  "type": "210"
}

{
  "status": "Success",
  "message": "Lead unsubscribed from list {list_name}",
  "type": "102"
}

 

Here are the confirmation messages related to action assign_tag :

{
  "status": "Error",
  "message": "tag_name cannot be empty. Nothing done",
  "type": "211"
}

{
  "status": "Error",
  "message": "tag does not exist. Nothing done",
  "type": "212"
}

{
  "status": "Success",
  "message": "Tag {tag_name} added to lead",
  "type": "103"
}

 

Here are the confirmation messages related to action unassign_tag :

{
  "status": "Error",
  "message": "tag_name cannot be empty. Nothing done",
  "type": "213"
}

{
  "status": "Error",
  "message": "Invalid tag. Nothing done",
  "type": "214"
}

{
  "status": "Success",
  "message": "Tag {tag_name} removed from lead",
  "type": "104"
}

 

Here are the confirmation messages related to action give_points_to_lead :

{
  "status": "Error",
  "message": "points is not a number. Nothing done",
  "type": "227"
}

{
  "status": "Error",
  "message": "points cannot be empty. Nothing done",
  "type": "215"
}

{
  "status": "Success",
  "message": "{points} points were added to lead",
  "type": "105"
}

 

Here are the confirmation messages related to action remove_points_from_lead :

{
  "status": "Error",
  "message": "points is not a number. Nothing done",
  "type": "228"
}

{
  "status": "Error",
  "message": "points cannot be empty. Nothing done",
  "type": "217"
}

{
  "status": "Success",
  "message": "{points} points were removed from lead",
  "type": "106"
}

 

Here are the confirmation messages related to action subscribe_lead_to_sequence_at_step:

{
  "status": "Error",
  "message": "sequence_name cannot be empty. Nothing done",
  "type": "224"
}

{
  "status": "Error",
  "message": "step cannot be empty. Nothing done",
  "type": "225"
}

{
  "status": "Error",
  "message": "step has to be alphanumeric. Nothing done",
  "type": "229"
}

{
  "status": "Error",
  "message": "Invalid sequence. Nothing done",
  "type": "219"
}

{
  "status": "Error",
  "message": "step does not exist. Nothing done",
  "type": "230"
}

{
  "status": "Success",
  "message": "Lead added to sequence {sequence_name} at step {current_step}",
  "type": "107"
}

{
  "status": "Error",
  "message": "Lead already subscribed to this sequence",
  "type": "231"
}

 

Here are the confirmation messages related to action unsubscribe_lead_from_sequence :

{
  "status": "Error",
  "message": "sequence_name cannot be empty. Nothing done",
  "type": "226"
}

{
  "status": "Error",
  "message": "Invalid sequence. Nothing done",
  "type": "220"
}

{
  "status": "Error",
  "message": "Lead is not subscribed to this sequence",
  "type": "232"
}

{
  "status": "Success",
  "message": "Lead removed from sequence {sequence_name}",
  "type": "108"
}

 

Here are the confirmation messages related to action refund_transaction:

{
  "status": "Error",
  "message": "Transaction doesn't exist",
  "type": "247"
}

{
  "status": "Error",
  "message": "Transaction outside refund period",
  "type": "250"
}

{
  "status": "Error",
  "message": "Transaction already refunded",
  "type": "251"
}

{
  "status": "Error",
  "message": "This type of transaction cannot be refunded or cancelled",
  "type": "253"
}

{ 
  "status": "Error", 
  "message": "Refund has failed", 
  "type": "266" 
}

{
  "status": "Success",
  "actions": [
    {
      "refund_transaction": {
        "transaction_id": "1234"
      }
    }
  ]
}

 

Here are the confirmation messages related to action cancel_transaction:

{
  "status": "Error",
  "message": "Subscription doesn't exist",
  "type": "248"
}

{
  "status": "Error",
  "message": "Transaction not linked to any recurring subscription",
  "type": "249"
}

{
  "status": "Error",
  "message": "Subscription already cancelled",
  "type": "252"
}

{
  "status": "Error",
  "message": "This type of transaction cannot be refunded or cancelled",
  "type": "253"
}

{ 
  "status": "Error", 
  "message": "Cancellation has failed", 
  "type": "267" 
}

{
  "status": "Success",
  "actions": [
    {
      "cancel_transaction": {
        "transaction_id": "1234"
      }
    }
  ]
}

 

Here are the confirmation messages related to action calendar_subscribe:

{
  "status": "Error",
  "message": "calendar_name cannot be empty. Nothing done",
  "type": "255"
}

{
  "status": "Error",
  "message": "class_name cannot be empty. Nothing done",
  "type": "256"
}

{
  "status": "Error",
  "message": "Invalid calendar. Nothing done",
  "type": "257"
}

{
  "status": "Error",
  "message": "Invalid calendar class. Nothing done",
  "type": "258"
}

{
  "status": "Error",
  "message": "Invalid date format. Nothing done",
  "type": "260"
}

{
  "status": "Error",
  "message": "Date is in the past. Nothing done",
  "type": "261"
}
{
  "status": "Success",
  "message": "The lead will be subscribed to calendar {calendar_name}, class {class_name}",
  "type": "112"
}

 

Here are the confirmation messages related to action calendar_cancel:

{
  "status": "Error",
  "message": "calendar_name cannot be empty. Nothing done",
  "type": "255"
}

{
  "status": "Error",
  "message": "class_name cannot be empty. Nothing done",
  "type": "256"
}

{
  "status": "Error",
  "message": "Invalid calendar. Nothing done",
  "type": "257"
}

{
  "status": "Error",
  "message": "Invalid calendar class. Nothing done",
  "type": "258"
}

{
  "status": "Error",
  "message": "There is no active/pending calendar subscription for this lead. Nothing done",
  "type": "259"
}

{
  "status": "Success",
  "message": "The lead will be unsubscribed from calendar {calendar_name}",
  "type": "113"
}

 

Here are the confirmation messages related to action create_custom_field:

{
  "status": "Error",
  "message": "Custom Field name can only contain letters, numbers, dashes or underscores",
  "type": "263"
}

{ 
  "status": "Error",
  "message": "Custom Field already exists or not allowed",
  "type": "264" 
}

{ 
  "status": "Error",
  "message": "'custom_field_identifier' cannot be empty",
  "type": "265" 
} 

{ 
  "status": "Error",
  "message": "'custom_field_type' not valid",
  "type": "269" 
} 

{ 
  "status": "Error",
  "message": "'custom_field_options' not an array",
  "type": "270" 
} 

{ 
  "status": "Error",
  "message": "'option_name' missing or empty",
  "type": "272" 
} 

{ 
  "status": "Error",
  "message": "'custom_field_options' must have two or more elements",
  "type": "273" 
} 

{
  "status": "Success",
  "message": "Custom Field created",
  "type: "114"
}

 

Here are the confirmation messages related to action search_transaction:

{
  "status": "Error",
  "message": "Transaction doesn't exist",
  "type": "247"
}

{
  "status": "Success",
  "message": "Transaction exists"
}

 

Here are the confirmation messages related to action search_subscription:

{
  "status": "Error",
  "message": "Subscription doesn't exist",
  "type": "248"
}

{
  "status": "Success",
  "message": "Subscription exists"
}

 

Here are the confirmation messages related to action get_transactions_from_lead:

{
  "status": "Error",
  "message": "No lead found",
  "type": 234
}

{
  "status": "Success",
  "actions": [
    {
      "get_transactions_from_lead": {
        "transaction_list": [
          {
            "transaction_id": "123456",
            "buyer_first_name": "Test",
            "buyer_last_name": "Test",
            "buyer_email": "test@test.com",
            "buyer_username": "test123",
            "buyer_id": "1234",
            "product_name": "Test Product",
            "product_id": "1234",
            "product_price_point": "1",
            "transaction_amount": "20.99",
            "transaction_full_amount": "20.99",
            "transaction_base_amount": "20.99",
            "transaction_affiliate": "N/A",
            "transaction_jv": "N/A",
            "transaction_date": "2018-07-06 00:00:00",
            "transaction_type": "sale",
            "transaction_parent_id": "0",
            "transaction_subscription_id": "7608",
            "transaction_subscription_pay_number": "1",
            "original_id": "123456",
            "buyer_billing_country": "United States",
            "buyer_billing_country_code_2": "US",
            "buyer_billing_country_code_3": "USA",
            "buyer_billing_state": "New York",
            "buyer_billing_phone_country_code": "55",
            "buyer_billing_phone_number": "555555",
            "buyer_billing_address": "test",
            "buyer_billing_city": "test",
            "buyer_billing_zip": "test",
            "transaction_discount": "N/A",
            "transaction_tax": "N/A",
            "vendor_tracking_id_1": "N/A",
            "vendor_tracking_id_2": "N/A",
            "price": "20.99",
            "rebill_circle": "1",
            "payments_left": "9999",
            "shipping_first_name": "test",
            "shipping_last_name": "test",
            "shipping_address": "test",
            "shipping_city": "test",
            "shipping_zip": "test",
            "shipping_country": "United States",
            "shipping_state": "New York",
            "transaction_shipping": "0.00",
            "payment_processor_type": "Stripe"
          }
        ]
      }
    }
  ]
}

 

Here are the confirmation messages related to action get_subscriptions_from_lead:

{
  "status": "Error",
  "message": "No lead found",
  "type": 234
}

{
  "status": "Success",
  "actions": [
    {
      "get_subscriptions_from_lead": {
        "status": "Success",
        "subscription_list": [
          {
            "transaction_subscription_id": "1234",
            "transaction_subscription_status": "Active",
            "buyer_id": "123456",
            "buyer_email": "test@test.com"
          }
        ]
      }
    }
  ]
}

 

Here are the confirmation messages related to creating a lead:

{
  "status": "Error",
  "message": "Lead already exists",
  "type": "244"
}

{
  "status": "Error",
  "message": "Wrong custom field format",
  "type": "271"
}

{
  "status": "Success",
  "actions": [
    {
      "create_lead": {
        "status": "Success",
        "lead_details": {
          "id": "1234"
        }
      }
    }
  ]
}

 

Here are the confirmation messages related to editing a lead:

{
  "status": "Error",
  "message": "No lead found",
  "type": "243"
}

{
  "status": "Error",
  "message": "Lead already exists",
  "type": "244"
}

{
  "status": "Error",
  "message": "Wrong custom field format",
  "type": "271"
}

{
  "status": "Success",
  "actions": [
    {
      "edit_lead": {
        "status": "Success",
        "lead_details": {
          "id": "1234"
        }
      }
    }
  ]
}

 

Here are the confirmation messages related to searching for a lead:

{
  "status": "Error",
  "message": "No lead found",
  "type": "243"
}

{
  "status": "Error",
  "message": "Lead is deleted",
  "type": "245"
}

{
  "status": "Success",
  "actions": [
    {
      "edit_lead": {
        "status": "Success",
        "lead_details": {
          "id": "1234"
        }
      }
    }
  ]
}

 

Here is the confirmation message when get_lead successfully finds an existing lead:

{
  "status": "Success",
  "lead_details": {
    "first_name": "Joe",
    "middle_name": "",
    "last_name": "Smith",
    "last_name2": "",
    "email": "JoeSmith@domain.com",
    "date_joined": "10 Sep 2015 02:00:24",
    "phone_country_code": "+1",
    "phone": "312521352",
    "ip": "24.255.224.9",
    "ip_country": "United States",
    "address": "Apple avenue 35",
    "zip": "90034",
    "city": "San Diego",
    "state": "California",
    "country": "United States",
    "lead_picture": "https://kartrausers.s3.amazonaws.com/kartra_user/69ffc9dee2e378bbeaf1d67f69ace176.jpg",
    "score": "12",
    "website": "http://domain.com",
    "facebook": "https://www.facebook.com/joe.smith.134",
    "twitter": "",
    "linkedin": "",
    "google_plus": "",
    "notes": "This is a test note.\n\nTest note.",
    "tags": [
      {
        "tag_name": "My customers"
      },
      {
        "tag_name": "VIP customer"
      }
    ],
    "lists": [
      {
        "list_name": "My customers newsletter",
        "active": "1"
      },
      {
        "list_name": "Free updates",
        "active": "0"
      }
    ],
    "sequences": [
      {
        "sequence_name": "My customers sequence",
        "step": "4",
        "status": "active"
      }
    ],
    "transactions": [
      {
        "transaction_id": "32550",
        "product_name": " My product",
        "product_price_point": "1",
        "transaction_type": "Sale",
        "transaction_amount": "2.00",
        "date": "18 Aug 2015 02:24:40"
      },
      {
        "transaction_id": "32551",
        "product_name": "My product",
        "product_price_point": "1",
        "transaction_type": "Refund",
        "transaction_amount": "2.00",
        "date": "19 Aug 2015 05:14:40"
      }
    ],
    "memberships": [
      {
        "name": "My customers membership",
        "level_name": "All access",
        "active": "1"
      }
    ]
  }
}

 

Here is the confirmation message when get_lead does not find any lead under the specified email:

{
  "status": "Error",
  "message": "No lead found",
  "type": "234"
}

© 2020 Kartra All Rights Reserved