NAV Navbar

Overview

Authentication

headers = {
  'Authorization' => "Bearer #{API_KEY}",
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

To connect to our API, you will need to include your API key in the headers with each request as shown in the example. Our endpoint requires data to be sent in JSON format, make sure the Content-Type in your header is set to application/json.

Response Status Codes

Status Description
200 OK
201 Resource created
401 Unauthorized - check that the API key has been set properly in the request Authorization header
404 Record not found
422 Unprocessable entity - check that all required request fields have been entered correctly
500 Internal server error
503 Service unavailable - service is undergoing maintenance

Errors

Example Responses

{
  "title": "Unauthorized",
  "code": "1001",
  "details": "Your user has not been authorized to access this endpoint"
}
{
  "title": "Invalid currency type",
  "code": "2004",
  "details": "The currency type submitted is invalid",
  "source": [{ "crypto_iso": "Invalid" }]
}

Error responses will be in this format unless specified otherwise.

Field Type Description
title string Short message identifying the error
code string 4-digit error code
details string Text message describing the error
error string Optional, includes more specific error details
source array Optional, present when validation fails, an array of objects with the key corresponding to the invalid field and value the reason

Merchant Registration

Register a Merchant

Example Request

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Basic ZnJlZDpmcmVk',
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}
params = {
  registration: {
    business_name: "Example Inc",
    first_name: "John",
    last_name: "Smith",
    email: "[email protected]",
    password: "=m,hWtG{ha][BGut~qT$d;L$4G-e"
    password_confirmation: "=m,hWtG{ha][BGut~qT$d;L$4G-e"
    terms_of_service: "true"
  }
}

result = RestClient.post 'https://api.net-cents.com/partner/v1/user_registration',
  params: params, headers: headers

p JSON.parse(result)

POST https://api.net-cents.com/partner/v1/user_registration

This endpoint is useful for Partners that wish to build a custom landing page to sign up their users to the NetCents Platform.

Request Parameters

Field Type Required Description
business_name string Yes
first_name string Yes
last_name string Yes
email string Yes Must be valid email address
password string Yes Minimum 8 characters
password_confirmation string Yes Must match password
terms_of_service string Yes Must be the string "true"

Response Schema

Example Response - Success

{
  "status": 1,
  "message": "Your account has been created! Please activate your account by following the instructions in the account confirmation email."
}

Example Response - Error

{
  "status": 0,
  "message": ["Password can't be blank", "Email is invalid"]
}
Field Type Description
status integer 1 if successful, 0 if an error occurred.
message array<string> | string Success message, error message or array of validation errors

Merchant Applications

Submit an Application

Example Request

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Basic ZnJlZDpmcmVk',
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

params = {
  user: {
    first_name: 'John',
    last_name: 'Smith',
    email: '[email protected]',
    business_name: 'JS Corp',
    special_offers: false,
    currency: 'CAD'
  },
  merchant_application: {
    company_detail_attributes: {
      company_name: 'ABC 123',
      dba: 'JS Corp 23',
      type_of_company: 'Personal',
      description: 'Banking',
      processing_volume: '500000',
      documentation_available: 'yes',
      phone_number: '1234567890',
      processing_method: 'online',
      website: 'www.example.com',
      address_attributes: {
        address: '123 Main St.',
        city: 'Vancouver',
        state: 'BC',
        zip: 'V5T1E1',
        country_code: 'CA'
      }
    },
    company_contact_attributes: {
      administrative_name: 'TT',
      administrative_phone: '111111111',
      administrative_email: '[email protected]',
      technical_name: 'MM',
      technical_phone: '123123123',
      technical_email: '[email protected]'
    },
    mailing_address_attributes: {
      address_attributes: {
        address: '321 Main St.',
        city: 'Toronto',
        state: 'Ont.',
        zip: 'T52ZE5',
        country_code: 'CA'
      }
    }
  }
}

result = RestClient.post 'https://api.net-cents.com/partner/v1/merchant_applications',
  params: params, headers: headers

p JSON.parse(result)

Example Response

{
  "success": true,
  "message": "Merchant Application submitted for [email protected]"
}

Once approved, Merchants registered via this API endpoint will be sent an email with a link to read the NetCents terms of service and set up a password.

POST https://api.net-cents.com/partner/v1/merchant_applications

User Parameters

These parameters should be nested under "user" as shown in the example.

Field Type Required Description
first_name string Yes
last_name string Yes
email string Yes Must be valid email
business_name string Yes
special_offers boolean No
currency string No Fiat currency merchant will process in, one of USD, CAD, EUR

Company Detail Parameters

These parameters should be nested under "merchant_application.company_detail_attributes" as shown in the example.

Field Type Required Description
company_name string Yes
dba string No Company name to be used for display to users
type_of_company string Yes Must be "Personal" or "Corporation" or "Partnership"
processing_method string Yes Must be "online" or "in_store" or "both"
documentation_available string Yes Must be "yes" or "no" or "currently_obtaining"
processing_volume string No Example: 500000
website string No Provide the merchants website URL
description string Yes Maximum length 255 characters
phone_number string Yes
address_attributes.address string Yes
address_attributes.city string Yes
address_attributes.state string Yes
address_attributes.zip string Yes
address_attributes.country_code string Yes ISO two letter country code

Company Contact Parameters

These parameters should be nested under "merchant_application.company_contact_attributes" as shown in the example.

Field Type Required
administrative_name string Yes
administrative_phone string Yes
administrative_email string Yes
technical_name string No
technical_phone string No
technical_email string No

Mailing Address Parameters

These parameters should be nested under "merchant_application.mailing_address_attributes" as shown in the example.

Field Type Required Description
address_attributes.address string No
address_attributes.city string No
address_attributes.state string No
address_attributes.zip string No
address_attributes.country_code string No ISO two letter country code

Upload CSV

Partners that wish to import multiple Merchants at once may also upload a CSV file through the Partner Portal. The file must include headers for all fields listed below and should have one row per Merchant. Note that there is a maximum of 1000 rows per CSV file.

Field Required Description
first_name Yes
last_name Yes
email Yes Must be valid email
phone_number Yes Must contain only numbers
company_name Yes
dba No Company name to be used for display to users
processing_method Yes Must be "online" or "in_store" or "both"
documentation_available Yes Must be "yes" or "no" or "currently_obtaining"
processing_volume No Example: 500000
type_of_company Yes Must be "Personal" or "Corporation" or "Partnership"
description Yes Maximum length 255 characters
website No
address_address Yes
address_city Yes
address_state Yes
address_zip Yes
address_country_code Yes ISO two letter country code
mailing_address_address No
mailing_address_city No
mailing_address_state No
mailing_address_zip No
mailing_address_country_code No ISO two letter country code
administrative_contact_name Yes
administrative_contact_phone Yes
administrative_contact_email Yes
user_currency No Fiat currency merchant will process in, one of USD, CAD, EUR