NAV Navbar
Curl Ruby
  • Introduction
  • Authentication
  • Sandbox
  • Sales Page
  • Pricing plans
  • Payments
  • Refunds
  • Webhooks
  • Thanks!
  • Introduction

    Welcome to the elopage API. Please fill out this form to get access to the API.

    The elopage API is based on REST. To get started and explore as much as possible, you can apply for the API credentials and get both test and live credentials. Live credentials can be accessed via your dashboard. To switch between the test and live environment, simply change the API credentials and the (sub)domain-URL. Our sandbox is run on staging.elopage.com. Requests in the staging environment will never touch the banking networks and will not create costs on your side. You can test Paypal, Sofort, Bank Wire and Credit Card payments.

    Be sure to subscribe to our API-updates list to receive updates on changes, additions or deprecations.

    On the right side you can use sample requests. To go live, make sure to use your API key that is linked to your elopage account.

    Which steps have to be completed via elopage.com?

    Feel free to contact us or visit our Help Center.

    Authentication

    Authenticate your account by using your secret API key in the request. You can create or renew your API keys in your dashboard settings. Keep your API and secret keys secret. Please do not share your API keys publicly on Github and so forth.

    On production you must create requests over HTTPS, otherwise calls will fail. Sandbox requests can be with HTTP.

    Sandbox

    Please access our sandbox environment using 'http://staging.elopage.com/'. API key and secret for the sandbox environment will be sent to you per email after your approval of your registration to our developer community.

    Please fill in the information here to get access to the elopage API.

    Test payments credentials

    Please access our sandbox environment using http://staging.elopage.com/ to test payments. Credentials for test payments will not work on the production environment. For now, we don’t have the option to test payments on production except for real payments.

    Credit Card

    The following credit card numbers can be used to test Visa or Mastercard payments.

    Parameter Value
    CVV Any 3 digits
    Date any date in the future, before 2030
    Number 5017670000005900
    5017670000006700
    5017670000007500
    5017670000008300

    Sofort Überweisung (Klarna)

    The following online banking and account credentials can be used to test Sofort Überweisung (Klarna) payments.

    Parameter Value
    Country of your bank Germany
    Sort code or BIC 88888888
    Account number 234567
    PIN 12345
    TAN 12345

    SEPA

    Please use the following payment information to test both instant successful and failed payments. Be aware that the initial payment takes 5 days to process. During that time the payment will have the “pending” status. SEPA payments are available for reseller-type-accounts.

    Description IBAN
    To do an instant successful transaction DE89370400440532013000
    To do an instant failed transaction DE62370400440532013001

    Paypal

    Please use the following Paypal credentials to test payments on staging. Beware that you do not have an option to check the payment status on a Paypal account (by logging in to Paypal) unless you connect your own Paypal account on production.

    Parameter Value
    Username info-buyer@elopage.com
    Password 123elopage

    Best practice for testing

    Regardless of sandbox or production testing, we recommend applying the following best practice example for testing payments:

    1. Create a sales page with one or two payment plans, for example a one-time payment option and an installment payment option.
    2. Get payment link info (URL to access payment page)
    3. Process a payment for a sales page using one of the payment methods for test credentials
    4. Get payment info using the Payment ID

    Check the following with your payment:

    1. All customer information (address for example) are correct
    2. Payment method and amounts incl. VAT are correct
    3. You received the Invoice_ID and URL to display or send with an email
    4. Check status of payments: successful, pending, waiting, cancelled or error

    We recommend testing each payment method and status.

    Sales Page

    Create sales page

    Example usage:

    curl -X POST \
      https://elopage.com/api/sales_pages \
      -H 'content-type: application/json' \
      -d '{
      "key":"{api_key}",
      "secret":"{api_secret}",
      "name":"product name",
      "success_url": "elopage.com",
      "cancel_url": "elopage.com",
      "error_url": "elopage.com",
      "webhook_url": "elopage.com",
      "pricing_plans": [
        {
          "form": "one_time",
          "preferences": {
            "price": "199.9",
            "old_price": "200"
           }
         }
       ],
       "authors": [
          {
            "id": 4,
            "custom_commission_enabled": true,
            "commission": 10
          }
        ],
       "success_email": {
          "subject_de": "test",
          "body_de": "<p>Hallo %{first_name} %{last_name},</p>\n<p><br></p>\n<p>vielen Dank f&uuml;r die Bestellung.</p>\n<p><br></p>\n<p>Produktname: %{product_name}</p>\n<p>Betrag: %{amount}</p>\n<p>Zahlung: %{recurring_type}</p>\n<p><br></p>\n<p>Bitte jetzt hier klicken:</p>\n<p>%{next_button}</p>\n<p><br></p>\n<p>Sch&ouml;ne Gr&uuml;&szlig;e,</p>",
          "subject_en": "test",
          "body_en": "<p>Hello %{first_name} %{last_name},</p>\n<p><br></p>\n<p>thanks for your order.</p>\n<p><br></p>\n<p>Product name: %{product_name}</p>\n<p>Amount: %{amount}</p>\n<p>Plan: %{recurring_type}</p>\n<p><br></p>\n<p>Now click here:</p>\n<p>%{next_button}</p>\n<p><br></p><p>Best regards,</p>"
       }
    }'
    
    require 'net/http'
    require 'uri'
    
    Net::HTTP.post URI('https://elopage.com/api/sales_pages'),
                   { "q" => "ruby", "max" => "50",
                     {
                      "key":"{api_key}",
                      "secret":"{api_secret}",
                      "name":"product name",
                      "success_url": "{success_url}",
                      "cancel_url": "{cancel_url}",
                      "error_url": "{error_url}",
                      "webhook_url": "{webhook_url}",
                      "pricing_plans": [
                        {
                          "form": "one_time",
                          "preferences": {
                            "price": "199.9",
                            "old_price": "200"
                           }
                         }
                       ],
                       "authors": [
                          {
                            "id": 4,
                            "custom_commission_enabled": true,
                            "commission": 10
                          }
                        ],
                        "success_email": {
                          "subject_de": "test",
                          "body_de": "<p>Hallo %{first_name} %{last_name},</p>
                                      <p><br></p>
                                      <p>vielen Dank f&uuml;r die Bestellung.</p>
                                      <p><br></p>
                                      <p>Produktname: %{product_name}</p>
                                      <p>Betrag: %{amount}</p>
                                      <p>Zahlung: %{recurring_type}</p>
                                      <p><br></p>
                                      <p>Bitte jetzt hier klicken:</p>
                                      <p>%{next_button}</p>
                                      <p><br></p>
                                      <p>Sch&ouml;ne Gr&uuml;&szlig;e,</p>",
                          "subject_en": "test",
                          "body_en": "<p>Hello %{first_name} %{last_name},</p>
                                      <p><br></p>
                                      <p>thanks for your order.</p>
                                      <p><br></p>
                                      <p>Product name: %{product_name}</p>
                                      <p>Amount: %{amount}</p>
                                      <p>Plan: %{recurring_type}</p>
                                      <p><br></p>
                                      <p>Now click here:</p>
                                      <p>%{next_button}</p>
                                      <p><br></p>
                                      <p>Best regards,</p>"
                          }
                        } }.to_json,
                        "Content-Type" => "application/json"
    

    Example response:

    {
        "id": 1087,
        "url_to_pay": "https://elopage.com/s/elopage/product-name-1/payment"
    }
    

    The elopage API allows to initiate and complete payments using optimized checkout interfaces. In order to process payments you first need to create a sales page. After the sales page creation you will receive a 'url_to_pay' parameter to which you must redirect your customer to complete payment. Thereafter you need to redirect the customer back to your success URL and pass on parameters and information. Using webhooks (webhook_url), you will get instant notifications about the status of the payment.

    POST

    https://elopage.com/api/sales_pages

    Parameter

    Field Type Description
    secret String elopage api_secret which can be generated and found in the sellers dashboard under Settings > Integrations
    key String Your personal elopage API key which you can generate in your dashboard: Settings > Integrations
    name String What is the customer paying for? Enter a product name, plan name or similar. This name will be visible to your customer during the checkout process.
    success_url String Success URL to which the customer will be redirected after completing the payment. Important: Updates for payments with payment methods that require time to process (for example Bank Wire / Vorkasse) must be continuously fetched using Payment IDs (payment_id) in order to receive the payment status (/api/payments/:id).
    cancel_url String Cancel URL to which your customer is redirected in case of payment process was cancelled by the customer.
    error_url String Error URL to which your customer is redirected in case of error occurrences during the payment processing (for example bad credit card information, rejected card etc.).
    webhook_url String The elopage API sends POST requests to this URL when there are updates related to the payment (for example bank wire payment updates to status successful). Transaction IDs and Payment IDs are included in the POST requests.
    page_header String Use the page header to add content above the payment form (testimonials, campaign information etc.) using html.
    page_footer String Use the page footer to add further information and content below the payment form using html.
    pricing_plans Array Array of objects which represent pricing plans of the product (at least one object required):
    'one_time' example pricing_plan:
    [{ "form": "one_time",
    "preferences":
    { "price": "199.9",
    "old_price": "200" } }]
    'subscription' example pricing_plan:
    [{ "form": "subscription",
    "preferences":
    { "first_interval": "1w",
    "first_amount": "20.0",
    "next_interval": "1m",
    "next_amount": "10.0" } }]
    'split' example (installment) pricing_plan:
    [{ "form": "split",
    "preferences":
    { "p_count": "5",
    "first_interval": "1w",
    "first_amount": "20.0",
    "next_interval": "1m",
    "next_amount": "10.0",
    "splitting_type": "installment" } }]
    'split' example (limited_subscription) pricing_plan:
    [{ "form": "split",
    "preferences":
    { "p_count": "5",
    "first_interval": "1w",
    "first_amount": "20.0",
    "next_interval": "1m",
    "next_amount": "10.0",
    "splitting_type": "limited_subscription" } }]
    Note: Per sales page you are allowed to use maximum 5 pricing plans .
       form String Allowed values: "one_time", "subscription", "split"
       preferences Object Apply different intervals for pricing plans with subscription and installments.
         price Decimal price by current pricing plan (only for one_time pricing plan)
         old_price Decimal old product price (only for one_time pricing plan)
         p_count Integer total count of payments (required for pricing plan form: split)
         first_interval String first payment interval (required for pricing plan form: subscription/split), possible values: ‘1w’, ‘2w’, ‘3w’, ‘1m’, ‘2m’, ‘3m’, ‘6m’, ‘1y’, ‘2y’
         first_amount Decimal first payment amount (required for pricing plan form: subscription/split)
         next_interval String next payment interval startdate (required for pricing plan form: subscription/split), possible values: ‘1w’, ‘2w’, ‘3w’, ‘1m’, ‘2m’, ‘3m’, ‘6m’, ‘1y’, ‘2y’
         next_amount Decimal next payment amount (required for pricing plan form: subscription/split)
         splitting_type String splitting type (required for pricing plan form: split); notes: "installment" - One invoice for the entire amount will be issued, "limited_subscription" - For each payment a new invoice will be issued
    Allowed values: ["installment", "limited_subscription"]
    Authors Array Array of objects which represent the authors, that will be connected to the sales page
       id Integer ID of the author, which you want to connect to the sales page (IDs of authors can be found in your dashboard under Team Members)
       c_c_enabled Boolean Pass 'true' here if you want to overwrite general commission with this one, you should pass 'commission' for it to take effect
       commission Integer Field which represents the commisison of author, measured in %
    forward Object we can forward params with url_to_pay to prefill payment form, check this blog
       first_name String first name of customer
       last_name String last name of customer
       email String email of customer
       coupon String coupon code to be applied automatically
       campaign_id String campaign IDs can be freely added
    success_email Object Payment confirmation or success email object contains data for the creation of custom emails which is automatically sent to the customer after successful payment. If success_email is not specified, elopage is sending out the standard email template which you can check in the product settings on elopage. For API usage, we do not recommend the usage of the standard template. Please customize your success email. In the custom email you have the option to add your own email body using html in body_en for the English version and body_de for the German version. In addition, you can add several variables that will be replaced automatically with your customers or purchase information: First name of customer first_name, last name last_name, name of the product product_name, price paid amount and recurring payment type recurring_type.
       subject_en String Subject of email in English
       subject_de String Subject of email in German
       body_en String Body of email in English
       body_de String Body of email in German

    Success 200

    Field Type Description
    id Number Sales page ID.
    url_to_pay String Sales page URL to which customer must be redirected

    Error 4xx

    Name Description
    NoAccessRight Only authenticated sellers can access the data.
    UserNotFound The key of the user was not found.

    Get sales pages

    Fetch sales pages and all relevant information such as product name, pricing plans, authors and more.

    Example usage:

    curl -X GET -H "Content-Type: application/json" "https://elopage.com/api/sales_pages/{id}?key={api_key}&secret={api_secret}"
    
    require 'net/http'
    require 'uri'
    
    Net::HTTP.get(URI('https://elopage.com/api/sales_pages/{id}?key={api_key}&secret={api_secret}'))
    

    Example resppnse:

    {
        "name": "product name",
        "url_to_pay": "https://elopage.com/s/elopage/product-name-1/payment",
        "success_url": "http://elopage.com",
        "cancel_url": "elopage.com",
        "error_url": "elopage.com",
        "webhook_url": "elopage.com",
        "free": false,
        "pricing_plans": [
            {
                id: "1",
                "form": "one_time",
                "preferences": {
                    "price": "199.9",
                    "old_price": "200.0"
                }
            }
        ],
        "authors": [
          {
              "author_id": 4,
              "c_c_enabled": true,
              "commission": "10.0"
          }
        ]
    }
    

    GET

    https://elopage.com/api/sales_pages/:id

    Parameter

    Field Type Description
    secret String elopage api_secret which can be generated and found in the sellers dashboard under Settings > Integrations
    key String Your personal elopage API key, you can find or generate them inside your elopage cabinet: Settings > Integrations
    id Number Sales page ID

    Success 200

    Field Type Description
    url_to_pay String Sales page URL to which customer must be redirected
    name String What is the customer paying for? Enter a product name, plan name or similar. This name will be visible to your customer during the checkout process.
    price Decimal The final price or amount you want to charge your customer incl. taxes, fees etc.
    free Boolean Sales page for a free product
    success_url String Success URL to which the customer will be redirected after completing the payment. Important: Updates for payments with payment methods that require time to process (for example Bank Wire / Vorkasse) must be continuously fetched using Payment IDs (payment_id) in order to receive the payment status (/api/payments/:id).
    cancel_url String Cancel URL to which your customer is redirected in case of payment process was cancelled by the customer.
    error_url String Error URL to which your customer is redirected in case of error occurrences during the payment processing (for example bad credit card information, rejected card etc.).
    webhook_url String elopage API sends POST request to this URL if payment for payment of product/name changes status to successful (e.g. bank wire updates).
    pricing_plans Array Array of objects which represents pricing plans of the product (at least one object required)
      ID Integer ID of the pricing plan
      form String Allowed values: "one_time", "subscription", "split"
      preferences Object Apply different intervals for pricing plans with subscription and installments.
        price Decimal price by current pricing plan
        old_price Decimal old product price
        p_count Integer total count of payments (required for pricing plan form: split)
        first_interval String first payment interval (required for pricing plan form: subscription/split), possible values: ‘1w’, ‘2w’, ‘3w’, ‘1m’, ‘2m’, ‘3m’, ‘6m’, ‘1y’, ‘2y’
        first_amount Decimal first payment amount (required for pricing plan form: subscription/split)
        next_interval String next payment interval startdate (required for pricing plan form: subscription/split), possible values: ‘1w’, ‘2w’, ‘3w’, ‘1m’, ‘2m’, ‘3m’, ‘6m’, ‘1y’, ‘2y’
        next_amount Decimal next payment amount (required for pricing plan form: subscription/split)
        splitting_type String splitting type (required for pricing plan form: split); notes: "installment" - One invoice for the entire amount will be issued, "limited_subscription" - For each payment a new invoice will be issued
    Allowed values: ["installment", "limited_subscription"]
    Authors Array Array of objects which represent the authors, that will be connected to the sales page
       id Integer ID of the author, which you want to connect to the sales page (IDs of authors can be found in your dashboard under Team Members)
       c_c_enabled Boolean Pass 'true' here if you want to overwrite general commission with this one, you should pass 'commission' for it to take effect
       commission Integer Field which represents the commisison of author, measured in %

    Error 4xx

    Name Description
    NoAccessRight Only authenticated sellers can access the data.
    UserNotFound The key of the user was not found.

    Update sales page

    Example usage:

    curl -X PUT \
      https://elopage.com/api/sales_pages/1115 \
      -H 'content-type: application/json' \
      -d '{
      "key":"{api_key}",
      "secret":"{api_secret}",
      "name":"product name",
      "success_url": "elopage.com",
      "cancel_url": "elopage.com",
      "error_url": "elopage.com",
      "webhook_url": "elopage.com",
        "pricing_plans": [
            {
                "id": 1340,
                "form": "one_time",
                "preferences": {
                    "price": "220",
                    "old_price": "200.0"
                }
            }
        ],
       "success_email": {
          "subject_de": "test",
          "body_de": "<p>Hallo %{first_name} %{last_name},</p>\n<p><br></p>\n<p>vielen Dank f&uuml;r die Bestellung.</p>\n<p><br></p>\n<p>Produktname: %{product_name}</p>\n<p>Betrag: %{amount}</p>\n<p>Zahlung: %{recurring_type}</p>\n<p><br></p>\n<p>Bitte jetzt hier klicken:</p>\n<p>%{next_button}</p>\n<p><br></p>\n<p>Sch&ouml;ne Gr&uuml;&szlig;e,</p>",
          "subject_en": "test",
          "body_en": "<p>Hello %{first_name} %{last_name},</p>\n<p><br></p>\n<p>thanks for your order.</p>\n<p><br></p>\n<p>Product name: %{product_name}</p>\n<p>Amount: %{amount}</p>\n<p>Plan: %{recurring_type}</p>\n<p><br></p>\n<p>Now click here:</p>\n<p>%{next_button}</p>\n<p><br></p><p>Best regards,</p>"
       }
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://elopage.com/api/sales_pages/1115")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Put.new(url)
    request["content-type"] = 'application/json'
    request.body = {
                    "key":"{api_key}",
                    "secret":"{api_secret}",
                    "name":"product name",
                    "success_url": "elopage.com",
                    "cancel_url": "elopage.com",
                    "error_url": "elopage.com",
                    "webhook_url": "elopage.com",
                    "pricing_plans": [
                        {
                            "id": 1340,
                            "form": "one_time",
                            "preferences": {
                                "price": "220",
                                "old_price": "200.0"
                            }
                        }
                     ],
                     "success_email": {
                        "subject_de": "test",
                        "body_de": "<p>Hallo %{first_name} %{last_name},</p>\n<p><br></p>\n<p>vielen Dank f&uuml;r die Bestellung.</p>\n<p><br></p>\n<p>Produktname: %{product_name}</p>\n<p>Betrag: %{amount}</p>\n<p>Zahlung: %{recurring_type}</p>\n<p><br></p>\n<p>Bitte jetzt hier klicken:</p>\n<p>%{next_button}</p>\n<p><br></p>\n<p>Sch&ouml;ne Gr&uuml;&szlig;e,</p>",
                        "subject_en": "test",
                        "body_en": "<p>Hello %{first_name} %{last_name},</p>\n<p><br></p>\n<p>thanks for your order.</p>\n<p><br></p>\n<p>Product name: %{product_name}</p>\n<p>Amount: %{amount}</p>\n<p>Plan: %{recurring_type}</p>\n<p><br></p>\n<p>Now click here:</p>\n<p>%{next_button}</p>\n<p><br></p><p>Best regards,</p>"
                     }
                    }
    
    response = http.request(request)
    puts response.read_body
    
    

    Example response:

    {
        "id": 1087,
        "url_to_pay": "https://elopage.com/s/elopage/product-name-1/payment"
    }
    

    The elopage API allows creating sales pages. To change or update the sales page information like price or name, please use put actions.

    PUT

    https://elopage.com/api/sales_pages/:id

    Parameter

    Field Type Description
    secret String elopage api_secret which can be generated and found in the sellers dashboard under Settings > Integrations
    key String Your personal elopage API key which you can generate in your dashboard: Settings > Integrations
    name String What is the customer paying for? Enter a product name, plan name or similar. This name will be visible to your customer during the checkout process.
    success_url String Success URL to which the customer will be redirected after completing the payment. Important: Updates for payments with payment methods that require time to process (for example Bank Wire / Vorkasse) must be continuously fetched using Payment IDs (payment_id) in order to receive the payment status (/api/payments/:id).
    cancel_url String Cancel URL to which your customer is redirected in case of payment process was cancelled by the customer.
    error_url String Error URL to which your customer is redirected in case of error occurrences during the payment processing (for example bad credit card information, rejected card etc.).
    webhook_url String The elopage API sends POST requests to this URL when there are updates related to the payment (for example bank wire payment updates to status successful). Transaction IDs and Payment IDs are included in the POST requests.
    page_header String Use the page header to add content above the payment form (testimonials, campaign information etc.) using html.
    page_footer String Use the page footer to add further information and content below the payment form using html.
    pricing_plans Array Array of objects which represent pricing plans of the product (at least one object required):
    'one_time' example pricing_plan:
    [{ "form": "one_time",
    "preferences":
    { "price": "199.9",
    "old_price": "200" } }]
    'subscription' example pricing_plan:
    [{ "form": "subscription",
    "preferences":
    { "first_interval": "1w",
    "first_amount": "20.0",
    "next_interval": "1m",
    "next_amount": "10.0" } }]
    'split' example (installment) pricing_plan:
    [{ "form": "split",
    "preferences":
    { "p_count": "5",
    "first_interval": "1w",
    "first_amount": "20.0",
    "next_interval": "1m",
    "next_amount": "10.0",
    "splitting_type": "installment" } }]
    'split' example (limited_subscription) pricing_plan:
    [{ "form": "split",
    "preferences":
    { "p_count": "5",
    "first_interval": "1w",
    "first_amount": "20.0",
    "next_interval": "1m",
    "next_amount": "10.0",
    "splitting_type": "limited_subscription" } }]
    Note: Per sales page you are allowed to use maximum 5 pricing plans .
       ID Integer ID of the pricing plan you want to edit
       form String Allowed values: "one_time", "subscription", "split"
       preferences Object Apply different intervals for pricing plans with subscription and installments.
         price Decimal price by current pricing plan (only for one_time pricing plan)
         old_price Decimal old product price (only for one_time pricing plan)
         p_count Integer total count of payments (required for pricing plan form: split)
         first_interval String first payment interval (required for pricing plan form: subscription/split), possible values: ‘1w’, ‘2w’, ‘3w’, ‘1m’, ‘2m’, ‘3m’, ‘6m’, ‘1y’, ‘2y’
         first_amount Decimal first payment amount (required for pricing plan form: subscription/split)
         next_interval String next payment interval startdate (required for pricing plan form: subscription/split), possible values: ‘1w’, ‘2w’, ‘3w’, ‘1m’, ‘2m’, ‘3m’, ‘6m’, ‘1y’, ‘2y’
         next_amount Decimal next payment amount (required for pricing plan form: subscription/split)
         splitting_type String splitting type (required for pricing plan form: split); notes: "installment" - One invoice for the entire amount will be issued , "limited_subscription" - For each payment a new invoice will be issued
    Allowed values: ["installment", "limited_subscription"]
    Authors Array Array of objects which represent the authors, that will be connected to the sales page
       id Integer ID of the author, which you want to connect to the sales page (IDs of authors can be found in your dashboard under Team Members)
       c_c_enabled Boolean Pass 'true' here if you want to overwrite general commission with this one, you should pass 'commission' for it to take effect
       commission Integer Field which represents the commisison of author, measured in %
    forward Object we can forward params with url_to_pay to prefill payment form, check this blog
       first_name String first name of customer
       last_name String last name of customer
       email String email of customer
       coupon String coupon code to be applied automatically
       campaign_id String campaign IDs can be freely added
    success_email Object Payment confirmation or success email object contains data for the creation of custom emails which is automatically sent to the customer after successful payment. If success_email is not specified, elopage is sending out the standard email template which you can check in the product settings on elopage. For API usage, we do not recommend the usage of the standard template. Please customize your success email. In the custom email you have the option to add your own email body using html in body_en for the English version and body_de for the German version. In addition, you can add several variables that will be replaced automatically with your customers or purchase information: First name of customer first_name, last name last_name, name of the product product_name, price paid amount and recurring payment type recurring_type.
       subject_en String Subject of email in English
       subject_de String Subject of email in German
       body_en String Body of email in English
       body_de String Body of email in German

    Success 200

    Field Type Description
    id Number Sales page ID.
    url_to_pay String Sales page URL to which customer must be redirected

    Error 4xx

    Name Description
    NoAccessRight Only authenticated sellers can access the data.
    UserNotFound The key of the user was not found.

    Pricing plans

    Pricing plans are created during the creation of sales. In addition, you can create pricing plans separately, view them and delete pricing plans. elopage pricing plans allow the setup of multiple options such as time-limited subscriptions, installment payments and one time payments. Furthermore you can create and attach up to 5 pricing plans for one sales page.

    Get pricing plan

    Example usage:

    curl -X GET -H 'https://elopage.com/api/pricing_plans/{id}?key={api_key}&secret={api_secret}'
    
      require 'uri'
      require 'net/http'
    
      Net::HTTP.get(URI("https://elopage.com/api/pricing_plans/{id}?key={api_key}&secret={api_secret}"))
    

    Example response:

    {
        "id": 1306,
        "form": "one_time",
        "preferences": {
            "price": "199.9",
            "old_price": "200.0"
        }
    }
    

    Fetch pricing plan information by ID to get all relevant information about your pricing plan such as prices, intervals and splitting type.

    GET

    https://elopage.com/api/pricing_plans/:id

    Parameter

    Field Type Description
    secret String elopage api_secret which can be generated and found in your dashboard under Settings > Integrations
    key String Your personal elopage API key which you can generate in your dashboard: Settings > Integrations
    id Number Pricing plan ID is sent with the get sales page request.

    Success 200

    Field Type Description
    id Integer Pricing plan id
    form String Allowed values: "one_time", "subscription", "split"
    preferences Object Apply different intervals for pricing plans with subscription and installments.  price
      old_price Decimal old product price
      p_count Integer total count of payments (required for pricing plan form: split)
      first_interval String first payment interval (required for pricing plan form: subscription/split)
      first_amount Decimal first payment amount (required for pricing plan form: subscription/split)
      next_interval String next payment interval startdate (required for pricing plan form: subscription/split)
      next_amount Decimal next payment amount (required for pricing plan form: subscription/split)
      splitting_type String splitting type (required for pricing plan form: split); notes: "installment" - One invoice for the entire amount will be issued, "limited_subscription" - For each payment a new invoice will be issued
    Allowed values: ["installment", "limited_subscription"]

    Error 4xx

    Name Description
    NoAccessRight Only authenticated sellers can access the data.
    UserNotFound The key of the user was not found.

    Create pricing plan

    Create pricing plans by sending POST requests with parameters. All pricing plans must be immediately attached to a sales page.

    Example usage:

    curl -X POST \
      http://localhost:3000/api/pricing_plans \
      -H 'content-type: application/json' \
      -d '{
        "key": "{key}",
        "secret": "{secret}",
        "sales_page_id": 1087,
        "pricing_plan": {
            "form": "split",
            "preferences": {
                "p_count": 2,
                "first_amount": 0.5,
                "next_amount": 2
            }
        }
    }'
    
    require 'net/http'
    require 'uri'
    require 'json'
    
    uri = URI.parse("https://elopage.com/api/pricing_plans")
    request = Net::HTTP::Post.new(uri)
    request.body = JSON.dump({
      "key" => "{api_key}",
      "secret" => "{api_secret}",
      "sales_page_id" => 1087,
      "pricing_plan" => {
        "form" => "split",
        "preferences" => {
          "p_count" => 2,
          "first_amount" => 0.5,
          "next_amount" => 2
        }
      }
    })
    
    req_options = {
      use_ssl: uri.scheme == "https",
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      http.request(request)
    end
    

    Example response:

    {
        "id": 1312,
        "form": "splited",
        "preferences": {
            "p_count": "2",
            "first_amount": "0.5",
            "next_amount": "2.0"
        }
    }
    

    POST

    https://elopage.com/api/pricing_plans

    Parameter

    Field Type Description
    sales_page_id Integer ID of sales page for which you create this pricing plan
    pricing_plan Object Pricing plan object
      form String Allowed values: "one_time", "subscription", "split"
      preferences Object Apply different intervals for pricing plans with subscription and installments.    price
        old_price Decimal old product price
        p_count Integer total count of payments (required for pricing plan form: split)
        first_interval String first payment interval (required for pricing plan form: subscription/split)
        first_amount Decimal first payment amount (required for pricing plan form: subscription/split)
        next_interval String next payment interval startdate (required for pricing plan form: subscription/split)
        next_amount Decimal next payment amount (required for pricing plan form: subscription/split)
        splitting_type String splitting type (required for pricing plan form: split); notes: "installment" - One invoice for the entire amount will be issued, "limited_subscription" - For each payment a new invoice will be issued
    Allowed values: ["installment", "limited_subscription"]

    Success 200

    Field Type Description
    id Integer Created pricing plan ID
    form String Allowed values: "one_time", "subscription", "split"
    preferences Object Apply different intervals for pricing plans with subscription and installments.  price
      old_price Decimal old product price
      p_count Integer total count of payments (required for pricing plan form: split)
      first_interval String first payment interval (required for pricing plan form: subscription/split)
      first_amount Decimal first payment amount (required for pricing plan form: subscription/split)
      next_interval String next payment interval startdate (required for pricing plan form: subscription/split)
      next_amount Decimal next payment amount (required for pricing plan form: subscription/split)
      splitting_type String splitting type (required for pricing plan form: split); notes: "installment" - One invoice for the entire amount will be issued, "limited_subscription" - For each payment a new invoice will be issued
    Allowed values: ["installment", "limited_subscription"]

    Error 4xx

    Name Description
    NoAccessRight Only authenticated sellers can access the data.
    UserNotFound The key of the user was not found.

    Delete pricing plan

    You can delete pricing plans with a simple delete request.

    Example usage:

    curl -X DELETE \
      https://elopage.com/api/pricing_plans/:id \
      -d '{
        "key": "api_key",
        "secret": "api_secret"
    }'
    
    
    require 'net/http'
    require 'uri'
    require 'json'
    
    uri = URI.parse("https://elopage.com/api/pricing_plans/:id")
    request = Net::HTTP::Delete.new(uri)
    request.body = JSON.dump({
      "key" => "api_key",
      "secret" => "api_secret"
    })
    
    req_options = {
      use_ssl: uri.scheme == "https",
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      http.request(request)
    end
    

    Example response:

    {
        "status": "success",
        "response": "Pricing plan 1313 was successfully destroyed"
    }
    

    DELETE

    https://elopage.com/api/pricing_plans/:id

    Parameter

    Field Type Description
    id Integer ID of the pricing plan you want to delete

    Success 200

    Field Type Description
    status string status of the request, possible values: 'success', 'error'
    response string response text

    Error 4xx

    Name Description
    NoAccessRight Only authenticated sellers can access the data.
    UserNotFound The key of the user was not found.

    Payments

    Get payment info

    Example usage:

    curl -X GET -H "Content-Type: application/json" "https://elopage.com/api/payments/{id}?key={api_key}&secret={api_secret}"
    
    require 'net/http'
    require 'uri'
    
    Net::HTTP.get(URI('https://elopage.com/api/payments/{id}?key={api_key}&secret={api_secret}'))
    

    Example response:

    {
        "id": 540391,
        "payer": {
            "email": "jonhdoe@doe.com",
            "first_name": "John",
            "last_name": "Done",
            "country": "Berlin",
            "city": "Germany",
            "street": "Joachimsthaler Straße 21",
            "zip": "10719",
            "company": null,
            "vat_id": null,
            "phone": "+4930398204650"
        },
        "revenue": 199.9,
        "amount": 194.1,
        "fee": 5.8,
        "recurring": false,
        "recurring_form": "one_time",
        "payment_method": "paypal",
        "payment_session_id": "1234",
        "sales_page_id": "1087",
        "state": "successful",
        "created_date": "2017-12-11T15:47Z",
        "success_date": "2017-12-11T15:47Z",
        "success_date_short": "2017-12-11",
        "invoice_link": "https://elopage.com/common/invoices/2879?token=uVUai-84pyDhdz8K3nNd",
        "success_link": "https://elopage.com/s/elopage/product-name-6/payment_success?token=uVUai-84pyDhdz8K3nNd"
        "author_commissions": [
          {
              "id": 1,
              "rate": "10.0",
              "amount": "19.385",
              "payment_id": 542711
          }
        ]
    }
    

    Getting the payment information by fetching the transaction or payment info is a critical use of the API. In the following you can find out which requests are needed to get the necessary information to deliver your content, product or service.

    GET

    https://elopage.com/api/payments/:id

    Parameter

    Field Type Description
    secret String elopage api_secret which can be generated and found in your dashboard under Settings > Integrations
    key String Your personal elopage API key which you can generate in your dashboard: Settings > Integrations
    id Number Payment ID

    Success 200

    Field Type Description
    payer Object customer's object
      email String customer's email
      first_name String customer's first name
      last_name String customer's last name
      country String customer's country
      city String customer's city
      street String customer's street
      zip String customer's zip code
      company String customer's company name
      vat_id String customer's vat ID
      phone String customer's phone number
    revenue Decimal gross revenue
    amount Decimal net revenue
    fee Decimal fees
    recurring Boolean Returns true if it is a recurring type payment
    recurring_form String Returns the recurring type of the transaction. This value is being taken from the pricing plan form(one_time, subscription, split), which was chosen by customer during the checkout process.
    payment_method String card, bank_account, paypal, sofort, bank_wire
    payment_session_id Integer ID of payment session to which the payment belongs to. You should save it for the recurring payments as recurring payments (next or follow up payments) will have the same session.
    sales_page_id Integer ID of sales page that is connected to this payment
    state String waiting, successful, success_av, canceled or error
    created_date String Date of payment initiation
    success_date String Date and time of completed payment
    success_date_short String Date of completed payment
    invoice_link String This is the invoice URL for automatically generated invoices. Make sure to setup the invoice generation in your dashboard (Setting - Invoice generation) to get the invoice URLs.
    author_commissions Array Refunded commission that was previously paid to the author
       id Integer Author commission ID
       rate Integer Commission rate in percentage with which commission was calculated
       amount Integer Amount earned by author with this payment
       payment_id Integer ID of payment to which commissions are connected

    Error 4xx

    Name Description
    NoAccessRight Only authenticated sellers can access the data.
    UserNotFound The key of the user was not found.

    Refunds

    You can refund completed payments or transactions. Refunds will be processed via the same payment method that was preferred by the customer.

    Create a refund

    Create a refund using the following method. An automated email from the elopage system will be sent to notify the customer about the refund. This email also includes an appropriate credit memo.

    Example usage:

    curl -X POST \
      https://elopage.com/api/payments/{:id}/refund \
      -H 'content-type: application/json' \
      -d '{
      "key":"{API key}",
      "secret":"{API secret}"
    }'
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://elopage.com/api/payments/{:id}/refund")
    http = Net::HTTP.new(url.host, url.port)
    request = Net::HTTP::Post.new(url)
    request.body = {
                      key: "{API key}",
                      secret: "{API secret}"
                   }
    response = http.request(request)
    puts response.read_body
    

    Example response:

    {
      "payer": {
          "email": "jonhdoe@doe.com",
          "first_name": "John",
          "last_name": "Done",
          "country": "Berlin",
          "city": "Germany",
          "street": "Joachimsthaler Straße 21",
          "zip": "10719",
          "company": null,
          "vat_id": null,
          "phone": "+4930398204650"
      },
      "total": "-199.9",
      "amount": "-199.9",
      "fee": 0,
      "id": 542652,
      "payment_method": "credit_card",
      "payment_session_id": 3913,
      "sales_page_id": "1087",
      "refunded_tansfer_id": 542180,
      "state": "successful"
    },
    "author_commissions": [
        {
            "id": 2,
            "rate": "10.0",
            "amount": "-19.385",
            "payment_id": 542760
        }
    ]
    

    POST

    https://elopage.com/api/payments/:id/refund

    Parameter

    Field Type Description
    secret String elopage api_secret which can be generated and found in your dashboard under Settings > Integrations
    key String Your personal elopage API key which you can generate in your dashboard: Settings > Integrations
    id Number Payment ID

    Success 200

    Field Type Description
    payer Object customer's object
      email String customer's email
      first_name String customer's first name
      last_name String customer's last name
      country String customer's country
      city String customer's city
      street String customer's street
      zip String customer's zip code
      company String customer's company name
      vat_id String customer's vat ID
      phone String pacustomeryer phone
    total Decimal brutto amount
    amount Decimal netto amount
    fee Decimal fees
    payment_method String card, bank_account, paypal, sofort, bank_wire
    payment_session_id Integer ID of payment session to which the payment belongs to. You should save it for the recurring payments as recurring payments (next or follow up payments) will have the same session.
    sales_page_id Integer ID of sales page that is connected to this payment
    refunded_transfer_id Integer ID of the transfer which is being refunded
    state String waiting, successful, success_av, canceled or error
    author_commissions Array Refunded commission that was previously paid to the author
       id Integer Author commission ID
       rate Integer Commission rate in percentage with which commission was calculated
       amount Integer Amount earned by author with this payment which is being refunded
       payment_id Integer ID of payment to which commissions are connected

    Error 4xx

    Name Description
    NoAccessRight Only authenticated sellers can access the data.
    UserNotFound The key of the user was not found.

    Get refund info

    Example usage:

    curl -X GET -H "Content-Type: application/json" "https://elopage.com/api/payments/{id}?key={api_key}&secret={api_secret}"
    
    require 'net/http'
    require 'uri'
    
    Net::HTTP.get(URI('https://elopage.com/api/payments/{id}?key={api_key}&secret={api_secret}'))
    

    Example response:

    {
      "payer": {
          "email": "jonhdoe@doe.com",
          "first_name": "John",
          "last_name": "Done",
          "country": "Berlin",
          "city": "Germany",
          "street": "Joachimsthaler Straße 21",
          "zip": "10719",
          "company": null,
          "vat_id": null,
          "phone": "+4930398204650"
      },
      "total": "-199.9",
      "amount": "-199.9",
      "fee": 0,
      "id": 542652,
      "payment_method": "credit_card",
      "payment_session_id": 3913,
      "sales_page_id": "1087",
      "refunded_tansfer_id": 542180,
      "state": "successful"
    },
    "author_commissions": [
        {
            "id": 2,
            "rate": "10.0",
            "amount": "-19.385",
            "payment_id": 542760
        }
    ]
    
    

    You can fetch refund transactions by IDs. Please use the following method and parameters.

    GET

    https://elopage.com/api/payments/:id

    Parameter

    Field Type Description
    secret String elopage api_secret which can be generated and found in your dashboard under Settings > Integrations
    key String Your personal elopage API key which you can generate in your dashboard: Settings > Integrations
    id Number Payment ID

    Success 200

    Field Type Description
    payer Object customer's object
      email String customer's email
      first_name String customer's first name
      last_name String customer's last name
      country String customer's country
      city String customer's city
      street String customer's street
      zip String customer's zip code
      company String customer's company name
      vat_id String customer's vat ID
      phone String customer's phone number
    revenue Decimal gross revenue
    amount Decimal net revenue
    fee Decimal fees
    recurring Boolean Returns true if it is a recurring type payment
    recurring_form String Returns the recurring type of the transaction. This value is being taken from the pricing plan form(one_time, subscription, split), which was chosen by customer during the checkout process.
    payment_method String card, bank_account, paypal, sofort, bank_wire
    payment_session_id Integer ID of payment session to which the payment belongs to. You should save it for the recurring payments as recurring payments (next or follow up payments) will have the same session.
    sales_page_id Integer ID of sales page that is connected to this payment
    state String waiting, successful, pending, canceled or error
    created_date String Date of payment initiation
    success_date String Date and time of completed payment
    success_date_short String Date of completed payment
    invoice_link String This is the invoice URL for automatically generated invoices. Make sure to setup the invoice generation in your dashboard (Setting - Invoice generation) to get the invoice URLs.
    author_commissions Array Refunded commission that was previously paid to the author
       id Integer Author commission ID
       rate Integer Commission rate in percentage with which commission was calculated
       amount Integer Amount earned by author with this payment which is being refunded
       payment_id Integer ID of payment to which commissions are connected

    Error 4xx

    Name Description
    NoAccessRight Only authenticated sellers can access the data.
    UserNotFound The key of the user was not found.

    Webhooks

    Use webhooks to receive instant notification of events related to payments and statuses such as successful, error or waiting/pending payments. Depending on the payment method, the status can change from waiting to successul or error or from pending to successful or error. Check parameters and methods below.

    Message body

    Field Type Description
    payer Object customer's object
      email String customer's email
      first_name String customer's first name
      last_name String customer's last name
      country String customer's country
      city String customer's city
      street String customer's street
      zip String customer's zip code
      company String customer's company name
      vat_id String customer's vat ID
      phone String customer's phone number
    revenue Decimal gross revenue
    amount Decimal net revenue
    fee Decimal fees
    recurring Boolean Returns true if it is a recurring type payment
    recurring_form String Returns the recurring type of the transaction. This value is being taken from the pricing plan form(one_time, subscription, split), which was chosen by customer during the checkout process.
    payment_method String card, bank_account, paypal, sofort, bank_wire
    payment_session_id Integer ID of payment session to which the payment belongs to. You should save it for the recurring payments as recurring payments (next or follow up payments) will have the same session.
    sales_page_id Integer ID of sales page that is connected to this payment
    state String waiting, successful, success_av, canceled or error
    created_date String Date of payment initiation
    success_date String Date and time of completed payment
    success_date_short String Date of completed payment
    invoice_link String This is the invoice URL for automatically generated invoices. Make sure to setup the invoice generation in your dashboard (Setting - Invoice generation) to get the invoice URLs.
    author_commissions Array Refunded commission that was previously paid to the author
       id Integer Author commission ID
       rate Integer Commission rate in percentage with which commission was calculated
       amount Integer Amount earned by author with this payment
       payment_id Integer ID of payment to which commissions are connected

    Thanks!

    We look forward to your questions and feedback. The elopage API is yet making its baby steps and we value all types of feedback from developers. Feel free to contact us via support@elopage.com. Thanks for using our API.