NAV Navbar
shell
  • Introduction
  • Authentication
  • Users
  • API Keys
  • Transaction Processing
  • Customers (Tokenization)
  • Recurring
  • Terminals
  • Errors
  • Introduction

    Welcome to the TransNational Payments API!

    Authentication

    To authorize, use this code:

    # With shell, you can just pass the correct header with each request
    curl "api_endpoint_here"
      -H "Authorization: <API KEY>"
    

    Make sure to replace with your API key.

    More coming soon...

    TransNational Payments expects the API key or JWT to be included in all API requests to the server in a header that looks like the following:

    Authorization: <API KEY>

    or

    Authorization: Bearer <JWT Token>

    Obtaining a JWT

    curl -v -X POST -d "username=<username>" --data-urlencode 'password=<password>' \
    "https://sandbox.gotnpgateway.com/api/token-auth"
    

    The above command returns JSON structured like this:

    {
      "status":"successful",
      "token":"<token>"
    }
    

    This endpoint is used to process a transaction.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/token-auth

    Request Body Parameters

    Parameter Default Description
    username username to authenticate with
    password password to authenticate with

    Request forgotten username

    curl -v -X POST \
      -H "Content-Type: application/json" \
      -d '{
        "email" : "user@domain.com"
      }' \
      "https://sandbox.gotnpgateway.com/api/forgot-username"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"Request processed successfully",
      "data":null
    }
    

    This endpoint is will send an email containing all usernames associated with the provided email address

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/forgot-username

    Request Body Parameters

    Parameter Default Description
    email email address to lookup accounts for

    Request forgotten password

    curl -v -X POST \
      -H "Content-Type: application/json" \
      -d '{
        "username" : "<username>"
      }' \
      "https://sandbox.gotnpgateway.com/api/forgot-password"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"Request processed successfully",
      "data":null
    }
    

    This endpoint is will send an email containing a password reset token

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/forgot-password

    Request Body Parameters

    Parameter Default Description
    username username to reset password for

    Password reset

    curl -v -X POST \
      -H "Content-Type: application/json" \
      -d '{
        "username" : "<username>",
        "reset_code": "<reset_code>",
        "password": "<new password>"
      }' \
      "https://sandbox.gotnpgateway.com/api/forgot-password/reset"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"Request processed successfully",
      "data":null
    }
    

    This endpoint is will reset a users password

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/forgot-password/reset

    Request Body Parameters

    Parameter Default Description
    username username to reset password for
    reset_code reset obtained from password reset email
    password new password to be set

    Token Logout

    curl -v \
    -H "Authorization: Bearer <JWT>" \
    -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/logout"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"Request processed successfully",
      "data":null
    }
    

    This endpoint is will terminate a valid authenication token.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/logout

    Request Body Parameters

    None

    Users

    Change Password

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "username": "<username>",
      "current_password": "<current password>",
      "new_password": "<new password>"
    }'\
      "https://sandbox.gotnpgateway.com/api/user/change-password"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"Request processed successfully",
      "data":null
    }
    

    This endpoint is will change an authenicated users password.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/user/change-password

    Request Body Parameters

    Parameter Default Description
    username username to reset password for
    current_password users current password
    new_password new password for user

    Create

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "username": "testmerchant43",
      "name": "test merchant user",
      "phone": "6305555555",
      "email": "info@website.com",
      "timezone": "ETC/UTC",
      "password": "T@est12345678",
      "status": "active",
      "role": "admin"
    }'\
      "https://sandbox.gotnpgateway.com/api/user"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "data":{
        "id":"b89227ij8m0nuanr1tk0",
        "username":"testmerchant43",
        "name":"test merchant user",
        "phone":"6305555555",
        "email":"info@website.com",
        "timezone":"ETC/UTC",
        "status":"active",
        "role":"admin",
        "account_type":"merchant",
        "account_type_id":"aucio551tlv85l7moe5g",
        "created_at":"2017-11-20T00:26:06.190264Z",
        "updated_at":"2017-11-20T00:26:06.190264Z"
        }
      }
    

    This endpoint is will create a new user

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/user

    Request Body Parameters

    Parameter Default Description
    username username to reset password for
    name users first and last name
    phone users phone number, digits only
    email users email address
    timezone users timezone
    password users password
    status users status (active or disabled)
    role users defined role (admin or standard)

    Update

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "test merchant user",
      "phone": "6305555555",
      "email": "info@website.com",
      "timezone": "ETC/UTC",
      "status": "active",
      "role": "admin"
    }'\
      "https://sandbox.gotnpgateway.com/api/user/b89227ij8m0nuanr1tk0"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "data":{
        "id":"b89227ij8m0nuanr1tk0",
        "username":"testmerchant43",
        "name":"test merchant user",
        "phone":"6305555555",
        "email":"info@website.com",
        "timezone":"ETC/UTC",
        "status":"active",
        "role":"admin",
        "account_type":"merchant",
        "account_type_id":"aucio551tlv85l7moe5g",
        "created_at":"2017-11-20T00:26:06.190264Z",
        "updated_at":"2017-11-20T00:26:06.190264Z"
        }
      }
    

    This endpoint is will update an exisiting user

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/user/<user_id>

    Query Parameters

    Parameter Description
    user_id User ID string

    Request Body Parameters

    Parameter Default Description
    name users first and last name
    phone users phone number, digits only
    email users email address
    timezone users timezone
    status users status (active or disabled)
    role users defined role (admin or standard)

    Get Specific User

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/user/b89227ij8m0nuanr1tk0"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "data":{
        "id":"b89227ij8m0nuanr1tk0",
        "username":"testmerchant43",
        "name":"test merchant user",
        "phone":"6305555555",
        "email":"info@website.com",
        "timezone":"ETC/UTC",
        "status":"active",
        "role":"admin",
        "account_type":"merchant",
        "account_type_id":"aucio551tlv85l7moe5g",
        "created_at":"2017-11-20T00:26:06.190264Z",
        "updated_at":"2017-11-20T00:26:06.190264Z"
        }
      }
    

    This endpoint is will get a specific user

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/user/<user_id>

    Query Parameters

    Parameter Description
    user_id User ID string

    Get Current User

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/user"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "data":{
        "id":"b89227ij8m0nuanr1tk0",
        "username":"testmerchant43",
        "name":"test merchant user",
        "phone":"6305555555",
        "email":"info@website.com",
        "timezone":"ETC/UTC",
        "status":"active",
        "role":"admin",
        "account_type":"merchant",
        "account_type_id":"aucio551tlv85l7moe5g",
        "created_at":"2017-11-20T00:26:06.190264Z",
        "updated_at":"2017-11-20T00:26:06.190264Z"
        }
      }
    

    This endpoint is will get a user that is currently authenticated. This is just a helper function, you should prefer getting a specific user, by specifying a valid user_id

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/user

    Get all users

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/users"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "total_count":3,
      "data":[
          ...
          {
            "id":"b89227ij8m0nuanr1tk0",
            "username":"testmerchant43",
            "name":"test merchant user",
            "phone":"6305555555",
            "email":"info@website.com",
            "timezone":"ETC/UTC",
            "status":"active",
            "role":"admin",
            "account_type":"merchant",
            "account_type_id":"aucio551tlv85l7moe5g",
            "created_at":"2017-11-20T00:26:06.190264Z",
            "updated_at":"2017-11-20T00:26:06.190264Z"
            }
          ]
        }
    

    This endpoint is will get all users

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/users

    Delete user

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
    -X DELETE \
      "https://sandbox.gotnpgateway.com/api/user/b89227ij8m0nuanr1tk0"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"successfully deleted",
      "data":null
    }
    

    This endpoint is will delete a specific user.

    HTTP Request

    DELETE https://sandbox.gotnpgateway.com/api/user/<user_id>

    Query Parameters

    Parameter Description
    user_id User ID string

    API Keys

    Create

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
    -X POST \
      "https://sandbox.gotnpgateway.com/api/user/aucio551tlv85l7moe60/apikey"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "data":{
        "id":"b892b1ij8m0nuanr1tkg",
        "api_key":"0wbK7QkCWri562dJz63LfWigq6v",
        "account_type":"merchant",
        "account_type_id":"aucio551tlv85l7moe60",
        "created_at":"2017-11-20T00:44:54.770907Z",
        "updated_at":"2017-11-20T00:44:54.770907Z"
        }
      }
    

    This endpoint is will create a new API KEY for a specific user.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/user/<user_id>/apikey

    Query Parameters

    Parameter Description
    user_id User ID string

    Get

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/user/aucio551tlv85l7moe60/apikeys"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "total_count":2,
      "data":[
        ...
        {
          "id":"b892b1ij8m0nuanr1tkg",
          "api_key":"0wbK7QkCWri562dJz63LfWigq6v",
          "account_type":"merchant",
          "account_type_id":"aucio551tlv85l7moe60",
          "created_at":"2017-11-20T00:44:55Z",
          "updated_at":"2017-11-20T00:44:55Z"
          }
        ]
      }
    

    This endpoint will list apikeys for a specific user.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/user/<user_id>/apikeys

    Query Parameters

    Parameter Description
    user_id User ID string

    Delete

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
    -X DELETE \
      "https://sandbox.gotnpgateway.com/api/user/aucio551tlv85l7moe60/apikey/b892b1ij8m0nuanr1tkg"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"successfully deleted api key",
      "data":null
    }
    

    This endpoint will delete the apikey specified.

    HTTP Request

    DELETE https://sandbox.gotnpgateway.com/api/user/<user_id>/apikey/<api_key_id>

    Query Parameters

    Parameter Description
    user_id User ID string
    api_key_id API Key Id

    Transaction Processing

    Processing a Transaction

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "sale",
        "amount": 1112,
        "tax_amount": 100,
        "shipping_amount": 100,
        "currency": "USD",
        "description": "test transaction",
        "order_id": "someOrderID",
        "po_number": "somePONumber",
        "ip_address": "4.2.2.2",
        "email_receipt": false,
        "email_address": "user@home.com",
        "payment_method": {
            "card": {
              "entry_type": "keyed",
              "number": "4012000098765439",
              "expiration_date": "12/20",
              "cvc": "999",
              "cardholder_authentication": {
                "condition": "...",
                "eci": "...",
                "cavv": "...",
                "xid": "...",
              }
            }
            ... or ...
            "customer": {
                "id": "b798ls2q9qq646ksu070",
                "payment_method_type": "card",
                "payment_method_id": "b798ls2q9qq646ksu080",
                "billing_address_id": "b798ls2q9qq646ksu07g",
                "shipping_address_id": "b798ls2q9qq646ksu07g"
            }
            ... or ...
            "terminal": {
                "id": "<terminal id>"
                "expiration_date": "12/20",
                "cvc": "999",
                "print_receipt": "both"
                "signature_required": true
            }
            ... or ...
            "ach": {
                "routing_number": "490000018",
                "account_number": "999999",
                "sec_code": "ccd",
                "account_type": "checking",
                "check_number":"1223",
                "accountholder_authentication": {
                    "dl_state": "IL",
                    "dl_number": "r500123123"
                }
            }
        },
        "billing_address" : {
            "first_name": "John",
            "last_name": "Smith",
            "company": "Test Company",
            "address_line_1": "123 Some St",
            "city": "West Chicago",
            "state": "IL",
            "postal_code": "60185",
            "country": "US",
            "phone": "5555555555",
            "fax": "5555555555",
            "email": "help@website.com"
        },
        "shipping_address" : {
            "first_name": "John",
            "last_name": "Smith",
            "company": "Test Company",
            "address_line_1": "123 Some St",
            "city": "West Chicago",
            "state": "IL",
            "postal_code": "60185",
            "country": "US",
            "phone": "5555555555",
            "fax": "5555555555",
            "email": "help@website.com"
        }
    }'   \
    "https://sandbox.gotnpgateway.com/api/transaction"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": {
            "id": "b7kgflt1tlv51er0fts0",
            "type": "sale",
            "amount": 1112,
            "tax_amount": 100,
            "tax_exempt": false,
            "shipping_amount": 100,
            "currency": "usd",
            "description": "test transaction",
            "order_id": "someOrderID",
            "po_number": "somePONumber",
            "ip_address": "4.2.2.2",
            "email_receipt": false,
            "email_address": "user@home.com",
            "payment_method": "card",
            "response" : {
                "card": {
                    "id": "b7kgflt1tlv51er0ftsg",
                    "card_type": "visa",
                    "first_six": "401200",
                    "last_four": "5439",
                    "masked_card": "401200******5439",
                    "expiration_date": "12/20",
                    "status": "approved",
                    "auth_code": "TAS731",
                    "processor_response_code": "00",
                    "processor_response_text": "APPROVAL TAS731 ",
                    "processor_type": "tsys_sierra",
                    "processor_id": "b7kgflt1tlv51er0f1sg",
                    "avs_response_code": "0",
                    "cvv_response_code": "M",
                    "processor_specific": {},
                    "created_at": "2017-10-19T20:15:19.80368Z",
                    "updated_at": "2017-10-19T20:15:20.777011Z"
                },
            },
            "status": "pending_settlement",
            "billing_address": {
                "first_name": "John",
                "last_name": "Smith",
                "company": "Test Company",
                "address_line_1": "123 Some St",
                "address_line_2": "",
                "city": "West Chicago",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "phone": "5555555555",
                "fax": "5555555555",
                "email": "help@website.com"
            },
            "shipping_address": {
                "first_name": "John",
                "last_name": "Smith",
                "company": "Test Company",
                "address_line_1": "123 Some St",
                "address_line_2": "",
                "city": "West Chicago",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "phone": "5555555555",
                "fax": "5555555555",
                "email": "help@website.com"
            },
            "created_at": "2017-10-19T20:15:19.560708Z",
            "updated_at": "2017-10-19T20:15:20.832049Z"
        }
    }
    

    Sample terminal response:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b9efr9qj8m0ge2h7tat0",
        "user_id": "aucio551tlv85l7moe60",
        "idempotency_key": "",
        "idempotency_time": 0,
        "type": "sale",
        "amount": 500,
        "amount_authorized": 500,
        "amount_captured": 500,
        "amount_settled": 0,
        "processor_id": "",
        "processor_type": "",
        "payment_method": "terminal",
        "payment_type": "",
        "tax_amount": 100,
        "tax_exempt": false,
        "shipping_amount": 100,
        "currency": "usd",
        "description": "test transaction",
        "order_id": "someOrderID",
        "po_number": "somePONumber",
        "ip_address": "4.2.2.2",
        "transaction_source": "api",
        "email_receipt": false,
        "customer_id": "",
        "referenced_transaction_id": "",
        "response_body": {
          "terminal": {
            "id": "b9efr9qj8m0ge2h7tatg",
            "card_type": "mastercard",
            "payment_type": "credit",
            "entry_type": "swiped",
            "first_four": "5424",
            "last_four": "3333",
            "masked_card": "5424********3333",
            "cardholder_name": "FDCS TEST CARD /MASTERCARD",
            "auth_code": "",
            "response_code": 100,
            "processor_response_text": "APPROVAL VTLMC1",
            "processor_specific": {
              "BatchNum": "8",
              "CashBack": "0.00",
              "ClerkID": "",
              "DISC": "0.00",
              "EBTCashAvailBalance": "",
              "EBTCashBeginBalance": "",
              "EBTCashLedgerBalance": "",
              "EBTFSAvailBalance": "",
              "EBTFSBeginBalance": "",
              "EBTFSLedgerBalance": "",
              "Fee": "0.00",
              "InvNum": "someOrderID",
              "Language": "English",
              "ProcessData": "",
              "RefNo": "",
              "RewardCode": "",
              "RewardQR": "",
              "RwdBalance": "0",
              "RwdIssued": "",
              "RwdPoints": "0",
              "SHFee": "0.00",
              "SVC": "0.00",
              "TableNum": "0",
              "TicketNum": "",
              "Tip": "0.00",
              "TotalAmt": "5.00"
            },
            "emv_aid": "",
            "emv_app_name": "",
            "emv_tvr": "",
            "emv_tsi": "",
            "signature_data": "Qk0OIQAAAAAAAD4AAAAoAAAALgEAANIAAAABAAEAAAAAANAgAADEDgAAxA4AAAAA//////////////////////////8f//////////////8AAA=",
            "created_at": "2018-01-15T19:14:47.225068Z",
            "updated_at": "2018-01-15T19:15:02.335853Z"
          }
        },
        "status": "pending_settlement",
        "response": "approved",
        "response_code": 100,
        "billing_address": {
          "first_name": "John",
          "last_name": "Smith",
          "company": "Test Company",
          "address_line_1": "123 Some St",
          "address_line_2": "",
          "city": "West Chicago",
          "state": "IL",
          "postal_code": "60185",
          "country": "US",
          "phone": "5555555555",
          "fax": "5555555555",
          "email": "help@website.com"
        },
        "shipping_address": {
          "first_name": "",
          "last_name": "",
          "company": "",
          "address_line_1": "",
          "address_line_2": "",
          "city": "",
          "state": "",
          "postal_code": "",
          "country": "",
          "phone": "",
          "fax": "",
          "email": ""
        },
        "created_at": "2018-01-15T19:14:47.108371Z",
        "updated_at": "2018-01-15T19:15:02.529558Z",
        "captured_at": "2018-01-15T19:14:47.337763Z",
        "settled_at": null
      }
    }
    

    Sample ach response:

    
      "status": "success",
      "msg": "success",
      "data": {
        "id": "bdkaefboo3su6vmf8gog",
        "user_id": "testmerchant12345678",
        "user_name": "test_merchant",
        "idempotency_key": "",
        "idempotency_time": 0,
        "type": "sale",
        "amount": 10112,
        "amount_authorized": 0,
        "amount_captured": 0,
        "amount_settled": 0,
        "tip_amount": 0,
        "processor_id": "bdcvli3oo3smmc8r4c2g",
        "processor_type": "sage_ach",
        "processor_name": "sage11",
        "payment_method": "ach",
        "payment_type": "ach",
        "tax_amount": 100,
        "tax_exempt": false,
        "shipping_amount": 100,
        "currency": "usd",
        "description": "test transaction",
        "order_id": "someOrderID",
        "po_number": "somePONumber",
        "ip_address": "4.2.2.2",
        "transaction_source": "api",
        "email_receipt": false,
        "email_address": "user@home.com",
        "customer_id": "",
        "referenced_transaction_id": "",
        "response_body": {
          "ach": {
            "id": "bdkaefboo3su6vmf8gp0",
            "sec_code": "ccd",
            "account_type": "checking",
            "masked_account_number": "99**99",
            "routing_number": "490000018",
            "auth_code": "",
            "response": "declined",
            "response_code": 200,
            "processor_response_code": "D",
            "processor_response_text": "DECLINE CHECK   CHECK LIMIT EXCEEDED",
            "processor_type": "sage_ach",
            "processor_id": "bdcvli3oo3smmc8r4c2g",
            "processor_specific": {
              "result_codes": [
                "Decline Message",
                "Transaction Limit Exceeded"
              ],
              "type_codes": [
                "Unknown Presentment"
              ]
            },
            "created_at": "2018-08-06T19:53:33.271385121Z",
            "updated_at": "2018-08-06T19:53:33.642386892Z"
          }
        },
        "status": "declined",
        "response": "declined",
        "response_code": 200,
        "billing_address": {
          "first_name": "John",
          "last_name": "Smith",
          "company": "Test Company",
          "address_line_1": "123 Some St",
          "address_line_2": "",
          "city": "West Chicago",
          "state": "IL",
          "postal_code": "60185",
          "country": "US",
          "phone": "5555555555",
          "fax": "5555555555",
          "email": "user@home.com"
        },
        "shipping_address": {
          "first_name": "",
          "last_name": "",
          "company": "",
          "address_line_1": "",
          "address_line_2": "",
          "city": "",
          "state": "",
          "postal_code": "",
          "country": "",
          "phone": "",
          "fax": "",
          "email": ""
        },
        "created_at": "2018-08-06T19:53:33.265553086Z",
        "updated_at": "2018-08-06T19:53:33.645937676Z",
        "captured_at": null,
        "settled_at": null
      }
    }
    

    This endpoint is used to process a transaction.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/transaction

    Request Body Parameters

    Parameter Default Description
    type sale, auth
    amount Processed Amount in cents. 1299 = $12.99
    tax_exempt false Bool value
    tax_amount 0 Tax Amount in cents.
    shipping_amount 0 Shipping Amount in cents.
    currency ISO 4217 currency. Ex USD
    description "" Text field, 0-255 characters
    order_id
    po_number
    ip_address Server IP IPv4 or IPv6 value of the end user
    email_receipt false Bool value to trigger sending of an email recept if an email was provided.
    payment_method Payment Method container, must only contain one of the following: card, customer, terminal objects
    payment_method.card Container for processing Credit Card transactions
    payment_method.card.entry_type Must be "keyed" or "swiped"
    payment_method.card.number Credit Card number
    payment_method.card.expiration_date Expiration date, Format MM/YY
    payment_method.card.cvc Card Verification Code
    payment_method.customer Container for Tokenized transactions
    payment_method.customer.id required Customer ID,
    payment_method.customer.payment_method_type Customer default Payment method type referenced in payment_method_id
    payment_method.customer.payment_method_id Customer default Payment method id to be charged.
    payment_method.customer.billing_address_id Customer default Billing address token to referenced.
    payment_method.customer.shipping_address_id Customer default Shipping address token to be referenced.
    payment_method.terminal Container for Terminal driven transactions.
    payment_method.terminal.id Terminal ID to trigger the request.
    payment_method.terminal.expiration_date Optionally pass an expiration date along with the transaction
    payment_method.terminal.cvc Optionally pass a CVV along with the transaction
    payment_method.terminal.print_receipt No = no reciept, Customer = customer copy, Merchant = merchant copy, Both = both copies
    payment_method.terminal.signature_required Requests that the terminal capture a signature, if supported
    payment_method.ach Container for processing ACH transactions
    payment_method.ach.routing_number
    payment_method.ach.account_number ACH account number
    payment_method.ach.check_number Check Number *required for TEL transactions
    payment_method.ach.sec_code SEC Code - WEB/CCD/PPD/TEL
    payment_method.ach.accountholder_authentication Container for accountholder authentication - if required by processor
    payment_method.ach.accountholder_authentication.dl_state Drivers License State
    payment_method.ach.accountholder_authentication.dl_number Drivers License Number
    billing_address null - Required for ACH transactions
    billing_address.first_name
    billing_address.last_name
    billing_address.company
    billing_address.address_line_1
    billing_address.address_line_2
    billing_address.city
    billing_address.state
    billing_address.postal_code
    billing_address.country
    billing_address.email
    billing_address.phone
    billing_address.fax
    shipping_address null
    shipping_address.first_name
    shipping_address.last_name
    shipping_address.company
    shipping_address.address_line_1
    shipping_address.address_line_2
    shipping_address.city
    shipping_address.state
    shipping_address.postal_code
    shipping_address.country
    shipping_address.email
    shipping_address.phone
    shipping_address.fax

    Get Transaction status

    curl -v -X GET \
      -H "Authorization: <API KEY>" \
      "https://sandbox.gotnpgateway.com/api/transaction/<transaction_id>"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": [
            {
            "id": "b7kgflt1tlv51er0fts0",
            "type": "sale",
            "amount": 1112,
            "tax_amount": 100,
            "tax_exempt": false,
            "shipping_amount": 100,
            "currency": "usd",
            "description": "test transaction",
            "order_id": "someOrderID",
            "po_number": "somePONumber",
            "ip_address": "4.2.2.2",
            "email_receipt": false,
            "payment_method": "card",
            "response" : {
                "card": {
                    "id": "b7kgflt1tlv51er0ftsg",
                    "card_type": "visa",
                    "first_six": "401200",
                    "last_four": "5439",
                    "masked_card": "401200******5439",
                    "expiration_date": "12/20",
                    "status": "approved",
                    "auth_code": "TAS731",
                    "processor_response_code": "00",
                    "processor_response_text": "APPROVAL TAS731 ",
                    "processor_type": "tsys_sierra",
                    "processor_id": "b7kgflt1tlv51er0f1sg",
                    "avs_response_code": "0",
                    "cvv_response_code": "M",
                    "processor_specific": {},
                    "created_at": "2017-10-19T20:15:19.80368Z",
                    "updated_at": "2017-10-19T20:15:20.777011Z"
                },
            },
            "status": "pending_settlement",
            "billing_address": {
                "first_name": "John",
                "last_name": "Smith",
                "company": "Test Company",
                "address_line_1": "123 Some St",
                "address_line_2": "",
                "city": "West Chicago",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "phone": "5555555555",
                "fax": "5555555555",
                "email": "help@website.com"
            },
            "shipping_address": {
                "first_name": "John",
                "last_name": "Smith",
                "company": "Test Company",
                "address_line_1": "123 Some St",
                "address_line_2": "",
                "city": "West Chicago",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "phone": "5555555555",
                "fax": "5555555555",
                "email": "help@website.com"
            },
            "created_at": "2017-10-19T20:15:19.560708Z",
            "updated_at": "2017-10-19T20:15:20.832049Z"
        }
    ],
    "total_count": 1
    }
    

    This endpoint is used to query a transaction

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/transaction/<transaction_id>

    Query Parameters

    Parameter Description
    transaction_id Transaction ID to reference

    Query Transactions

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
    
        "transaction_id": {
          "operator": "=",
          "value": "b84vgb2j8m0jujadi4v0"
        },
        "amount": {
          "operator": "=",
          "value": 1112
        },
        "created_at": {
          "start_date": "2017-11-01T00:00:00Z",
          "end_date": "2017-11-30T00:00:00Z"
        },
        "billing_address": {
          "first_name": {
            "operator": "=",
            "value": "John"
          }
        }
    }'   \
    "https://sandbox.gotnpgateway.com/api/transaction/search"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "",
      "total_count": 1,
      "data": [
        {
          "id": "b84vgb2j8m0jujadi4v0",
          "user_id": "aucio551tlv85l7moe60",
          "idempotency_key": "",
          "idempotency_time": 0,
          "type": "sale",
          "amount": 1112,
          "amount_authorized": 1112,
          "amount_captured": 1112,
          "amount_settled": 0,
          "processor_id": "aucio551tlv85l7moe7g",
          "processor_type": "tsys_sierra",
          "payment_method": "token",
          "payment_type": "card",
          "tax_amount": 100,
          "tax_exempt": false,
          "shipping_amount": 100,
          "currency": "usd",
          "description": "test transaction",
          "order_id": "someOrderID",
          "po_number": "somePONumber",
          "ip_address": "?01",
          "transaction_source": "api",
          "email_receipt": false,
          "customer_id": "b81ko5qq9qq5v460r9i0",
          "referenced_transaction_id": "",
          "response_body": {},
          "status": "pending_settlement",
          "response": "approved",
          "response_code": 100,
          "billing_address": {
            "first_name": "John",
            "last_name": "Smith",
            "company": "Some Company",
            "address_line_1": "123 Some St",
            "address_line_2": "STE 203",
            "city": "SomeTown",
            "state": "IL",
            "postal_code": "55555",
            "country": "US",
            "phone": "5555555555",
            "fax": "",
            "email": "info@website.com"
          },
          "shipping_address": {
            "first_name": "John",
            "last_name": "Smith",
            "company": "Some Company",
            "address_line_1": "123 Some St",
            "address_line_2": "STE 203",
            "city": "SomeTown",
            "state": "IL",
            "postal_code": "55555",
            "country": "US",
            "phone": "5555555555",
            "fax": "",
            "email": "info@website.com"
          },
          "created_at": "2017-11-13T19:53:17Z",
          "updated_at": "2017-11-13T19:53:18Z",
          "captured_at": null,
          "settled_at": null
        }
      ]
    }
    

    This endpoint is used to query transactions. All of the request body fields are optional, and any that are provided are used to drill down on specific transactions. See sample for structure of each query type.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/transaction/search

    Request Body Parameters

    Parameter Required Type Description
    transaction_id optional QuerySearchString Searches for transaction id
    user_id optional QuerySearchString Searches for user_id
    type optional QuerySearchString Searches for transaction type (sale, authorize...etc)
    ip_address optional QuerySearchString Searches for ip_address, either ipv4 or ipv6
    amount optional QuerySearchInt Searches for originally requested amount
    amount_authorized optional QuerySearchInt Searches for amount_authorized
    amount_captured optional QuerySearchInt Searches for amount_captured
    amount_settled optional QuerySearchInt Searches for amount_settled
    tax_amount optional QuerySearchInt Searches for tax_amount
    po_number optional QuerySearchString Searches for po_number
    order_id optional QuerySearchString Searches for order_id
    payment_method optional QuerySearchString Searches by payment_method, (token, card, terminal)
    payment_type optional QuerySearchString Searches by payment_type (card, echeck)
    status optional QuerySearchString Searches by transaction status (unknown, declined, authorized, pending_settlement, settled, voided, reversed, refunded)
    processor_id optional QuerySearchString Searches by processor_id
    customer_id optional QuerySearchString Searches by customer_id
    created_at optional QueryDateRange Searches by created_at between the provided start_date and end_date. Dates in UTC "YYYY-MM-DDTHH:II:SSZ"
    captured_at optional QueryDateRange Searches by captured_at between the provided start_date and end_date. Dates in UTC "YYYY-MM-DDTHH:II:SSZ"
    settled_at optional QueryDateRange Searches by settled_at between the provided start_date and end_date. Dates in UTC "YYYY-MM-DDTHH:II:SSZ"
    billing_address.address_id optional QuerySearchString Searches by billing_address.id
    billing_address.first_name optional QuerySearchString Searches by billing_address.first_name (0-50 characters)
    billing_address.last_name optional QuerySearchString Searches by billing_address.last_name (0-50 characters)
    billing_address.company optional QuerySearchString Searches by billing_address.company (0-50 characters)
    billing_address.address_line_1 optional QuerySearchString Searches by billing_address.address_line_1 (0-100 characters)
    billing_address.address_line_2 optional QuerySearchString Searches by billing_address.address_line_2 (0-100 characters)
    billing_address.city optional QuerySearchString Searches by billing_address.city (0-50 characters)
    billing_address.state optional QuerySearchString Searches by billing_address.state (2 Character)
    billing_address.postal_code optional QuerySearchString Searches by billing_address.postal_code (0-6 Characters)
    billing_address.country optional QuerySearchString Searches by billing_address.country (2 Characters)
    billing_address.email optional QuerySearchString Searches by billing_address.email
    billing_address.phone optional QuerySearchString Searches by billing_address.phone (0-14 digits only)
    billing_address.fax optional QuerySearchString Searches by billing_address.fax (0-14 digits only)
    shipping_address.address_id optional QuerySearchString Searches by shipping_address.id
    shipping_address.first_name optional QuerySearchString Searches by shipping_address.first_name (0-50 characters)
    shipping_address.last_name optional QuerySearchString Searches by shipping_address.last_name (0-50 characters)
    shipping_address.company optional QuerySearchString Searches by shipping_address.company (0-50 characters)
    shipping_address.address_line_1 optional QuerySearchString Searches by shipping_address.address_line_1 (0-100 characters)
    shipping_address.address_line_2 optional QuerySearchString Searches by shipping_address.address_line_2 (0-100 characters)
    shipping_address.city optional QuerySearchString Searches by shipping_address.city (0-50 characters)
    shipping_address.state optional QuerySearchString Searches by shipping_address.state (2 Character)
    shipping_address.postal_code optional QuerySearchString Searches by shipping_address.postal_code (0-6 Characters)
    shipping_address.country optional QuerySearchString Searches by shipping_address.country (2 Characters)
    shipping_address.email optional QuerySearchString Searches by shipping_address.email
    shipping_address.phone optional QuerySearchString Searches by shipping_address.phone (0-14 digits only)
    shipping_address.fax optional QuerySearchString Searches by shipping_address.fax (0-14 digits only)
    limit optional int Maximum records to return (0-100)
    offset optional int Number of records to offset the return by

    Request Body Type values

    Type Operators
    QuerySearchString =, !=
    QuerySearchInt =, !=, <, >

    Capture

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
    -X POST \
    -d '{
      "amount": 1000,
      "tax_amount": 100,
      "tax_exempt": false,
      "shipping_amount": 0
    }'
      "https://sandbox.gotnpgateway.com/api/transaction/b892b1ij8m0nuanr1tkg/capture"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "data":null
    }
    

    This endpoint will capture funds from a transaction that has been authorized. This action can only be performed on authorized transactions.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/transaction/<transaction_id>/capture

    Query Parameters

    Parameter Description
    transaction_id Transaction ID to Capture

    Request Body Parameters

    Parameter Default Description
    amount authorized amount Amount in cents. 1299 = $12.99
    tax_amount amount from auth Amount in cents. 1299 = $12.99
    tax_exempt false Bool value
    tax_amount tax_amount from auth Tax Amount in cents.
    shipping_amount shipping_amount from auth Shipping Amount in cents.
    order_id order_id from auth AlphaNumeric 0-17 characters
    po_number po_number from auth AlphaNumeric 0-17 characters
    ip_address ip_address from auth ipv4 or ipv6 address

    Void

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/transaction/b892b1ij8m0nuanr1tkg/void"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "data":null
    }
    

    This endpoint will void a transaction that is pending_settlement.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/transaction/<transaction_id>/void

    Query Parameters

    Parameter Description
    transaction_id Transaction ID to VOID

    Request Body Parameters

    None

    Refund

    curl -v \
    -H "Authorization: <API KEY>" \
    -H "Content-Type: application/json" \
    -X POST \
    -d '{
      "amount": 1000
    }' \
      "https://sandbox.gotnpgateway.com/api/transaction/b892b1ij8m0nuanr1tkg/refund"
    

    The above command returns JSON structured like this:

    {
      "status":"success",
      "msg":"success",
      "data":null
    }
    

    This endpoint will process a refund up the previously settled amount. This action can only be performed on transactions that have been settled.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/transaction/<transaction_id>/refund

    Query Parameters

    Parameter Description
    transaction_id Transaction ID to Capture

    Request Body Parameters

    Parameter Default Description
    amount amount settled Amount in cents. 1299 = $12.99

    Customers (Tokenization)

    Create a new Customer

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
          "description": "test description",
          "payment_method": {
              "card": {
                  "card_number": "4111111111111111",
                  "expiration_date": "1220"
              }
          },
          "billing_address": {
              "first_name": "John",
              "last_name": "Smith",
              "company": "Some Business",
              "address_line_1": "123 Some St",
              "address_line_2": "STE 1",
              "city": "Some Town",
              "state": "IL",
              "postal_code": "60185",
              "country": "US",
              "email": "user@somesite.com",
              "phone": "5555555555",
              "fax": "555555555"
          },
          "shipping_address": {
            "first_name": "John",
            "last_name": "Smith",
            "company": "Some Business",
            "address_line_1": "123 Some St",
            "address_line_2": "STE 1",
            "city": "Some Town",
            "state": "IL",
            "postal_code": "60185",
            "country": "US",
            "email": "user@somesite.com",
            "phone": "5555555555",
            "fax": "555555555"
          }
      }' \
      "https://sandbox.gotnpgateway.com/api/customer"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": {
            "id": "b798ls2q9qq646ksu070",
            "description": "test description",
            "payment_method": {
                "card": {
                    "id": "b798ls2q9qq646ksu080",
                    "card_type": "visa",
                    "first_six": "411111",
                    "last_four": "1111",
                    "masked_card": "411111******1111",
                    "expiration_date": "12/20",
                    "created_at": "2017-10-02T18:52:32Z",
                    "updated_at": "2017-10-02T18:52:32Z"
                }
            },
            "billing_address": {
                "id": "b798ls2q9qq646ksu07g",
                "customer_id": "b798ls2q9qq646ksu070",
                "first_name": "John",
                "last_name": "Smith",
                "company": "Some Business",
                "address_line_1": "123 Some St",
                "address_line_2": "STE 1",
                "city": "Some Town",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "email": "user@somesite.com",
                "phone": "5555555555",
                "fax": "555555555",
                "created_at": "2017-10-02T18:52:32Z",
                "updated_at": "2017-10-02T18:52:32Z"
            },
            "shipping_address": {
                "id": "b798ls2q9qq646ksu07g",
                "customer_id": "b798ls2q9qq646ksu070",
                "first_name": "John",
                "last_name": "Smith",
                "company": "Some Business",
                "address_line_1": "123 Some St",
                "address_line_2": "STE 1",
                "city": "Some Town",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "email": "user@somesite.com",
                "phone": "5555555555",
                "fax": "555555555",
                "created_at": "2017-10-02T18:52:32Z",
                "updated_at": "2017-10-02T18:52:32Z"
            },
            "created_at": "2017-10-02T18:52:32Z",
            "updated_at": "2017-10-02T18:52:32Z"
        }
    }
    

    This endpoint creates a new customer token.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/customer

    Request Body Parameters

    Parameter Default Description
    description ""
    payment_method null
    payment_method.card.card_number
    payment_method.card.expiration_date Format MMYY
    billing_address null
    billing_address.first_name
    billing_address.last_name
    billing_address.company
    billing_address.address_line_1
    billing_address.address_line_2
    billing_address.city
    billing_address.state
    billing_address.postal_code
    billing_address.country
    billing_address.email
    billing_address.phone
    billing_address.fax
    shipping_address null
    shipping_address.first_name
    shipping_address.last_name
    shipping_address.company
    shipping_address.address_line_1
    shipping_address.address_line_2
    shipping_address.city
    shipping_address.state
    shipping_address.postal_code
    shipping_address.country
    shipping_address.email
    shipping_address.phone
    shipping_address.fax

    Get a specific Customer

    curl -v -X GET \
    -H "Authorization: <API KEY>" \
    "https://sandbox.gotnpgateway.com/api/customer/b798ls2q9qq646ksu070"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": {
            "id": "b798ls2q9qq646ksu070",
            "description": "test description",
            "payment_method": {
                "card": {
                    "id": "b798ls2q9qq646ksu080",
                    "card_type": "visa",
                    "first_six": "411111",
                    "last_four": "1111",
                    "masked_card": "411111******1111",
                    "expiration_date": "12/20",
                    "created_at": "2017-10-02T18:52:32Z",
                    "updated_at": "2017-10-02T18:52:32Z"
                }
            },
            "billing_address": {
                "id": "b798ls2q9qq646ksu07g",
                "customer_id": "b798ls2q9qq646ksu070",
                "first_name": "John",
                "last_name": "Smith",
                "company": "Some Business",
                "address_line_1": "123 Some St",
                "address_line_2": "STE 1",
                "city": "Some Town",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "email": "user@somesite.com",
                "phone": "5555555555",
                "fax": "555555555",
                "created_at": "2017-10-02T18:52:32Z",
                "updated_at": "2017-10-02T18:52:32Z"
            },
            "shipping_address": {
                "id": "b798ls2q9qq646ksu07g",
                "customer_id": "b798ls2q9qq646ksu070",
                "first_name": "John",
                "last_name": "Smith",
                "company": "Some Business",
                "address_line_1": "123 Some St",
                "address_line_2": "STE 1",
                "city": "Some Town",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "email": "user@somesite.com",
                "phone": "5555555555",
                "fax": "555555555",
                "created_at": "2017-10-02T18:52:32Z",
                "updated_at": "2017-10-02T18:52:32Z"
            },
            "created_at": "2017-10-02T18:52:32Z",
            "updated_at": "2017-10-02T18:52:32Z"
        }
    }
    

    This endpoint retrieves a specific customer.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/customer/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the customer to retrieve

    Update a Specific Customer

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "description": "test description",
        "payment_method": "credit_card",
        "payment_method_id": "b798ls2q9qq646ksu080",
        "billing_address_id": "b798ls2q9qq646ksu07g",
        "shipping_address_id": "b798ls2q9qq646ksu07g"
      }' \
      "https://sandbox.gotnpgateway.com/api/customer/<ID>"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": null
    }
    

    This endpoint updates a specific customer token.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/customer/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the customer to delete

    Request Body Parameters

    Parameter Description
    description Description field for customer
    payment_method Field used to define the type of payment method referenced in payment_method_id
    payment_method_id Id field referencing the payment token
    billing_address_id Id field referencing the billing address
    shipping_address_id Id field referencing the shipping address

    Delete a Specific Customer

    curl -v -X DELETE \
      -H "Authorization: <API KEY>" \
      "https://sandbox.gotnpgateway.com/api/customer/<ID>"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": null
    }
    

    This endpoint deletes a specific customer token.

    HTTP Request

    DELETE https://sandbox.gotnpgateway.com/api/customer/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the customer to delete

    Create a new Customer Address Token

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "first_name": "John",
        "last_name": "Smith",
        "company": "Some Business",
        "address_line_1": "123 Some St",
        "address_line_2": "STE 1",
        "city": "Some Town",
        "state": "IL",
        "postal_code": "60185",
        "country": "US",
        "email": "user@somesite.com",
        "phone": "5555555555",
        "fax": "555555555"
      }' \
      "https://sandbox.gotnpgateway.com/api/customer/b798ls2q9qq646ksu070/address"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": {
            "id": "b7994biq9qq646ksu08g",
            "customer_id": "b798ls2q9qq646ksu070",
            "first_name": "John",
            "last_name": "Smith",
            "company": "Some Business",
            "address_line_1": "123 Some St",
            "address_line_2": "STE 1 ",
            "city": "Some Town",
            "state": "IL",
            "postal_code": "60185",
            "country": "US",
            "email": "user@somesite.com",
            "phone": "5555555555",
            "fax": "555555555",
            "created_at": "2017-10-02T19:23:26.902395Z",
            "updated_at": "2017-10-02T19:23:26.902395Z"
        }
    }
    

    This endpoint creates a new customer address token.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/customer/<ID>/address

    URL Parameters

    Parameter | Description ID | The ID of the customer to create the address for

    Request Body Parameters

    Parameter Default Description
    first_name
    last_name
    company
    address_line_1
    address_line_2
    city
    state
    postal_code
    country
    email
    phone
    fax

    Get all address for a specific Customer

    curl -v -X GET \
    -H "Authorization: <API KEY>" \
    "https://sandbox.gotnpgateway.com/api/customer/<ID>/addresses"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": [
            {
                "id": "b798ls2q9qq646ksu07g",
                "customer_id": "b798ls2q9qq646ksu070",
                "first_name": "John",
                "last_name": "Smith",
                "company": "Some Business",
                "address_line_1": "123 Some St",
                "address_line_2": "STE 1",
                "city": "Some Town",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "email": "user@somesite.com",
                "phone": "5555555555",
                "fax": "555555555",
                "created_at": "2017-10-02T18:52:32Z",
                "updated_at": "2017-10-02T18:52:32Z"
            },
            {
                "id": "b7994biq9qq646ksu08g",
                "customer_id": "b798ls2q9qq646ksu070",
                "first_name": "John",
                "last_name": "Smith",
                "company": "Some Business",
                "address_line_1": "123 Some St",
                "address_line_2": "STE 1 ",
                "city": "Some Town",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "email": "user@somesite.com",
                "phone": "5555555555",
                "fax": "555555555",
                "created_at": "2017-10-02T19:23:27Z",
                "updated_at": "2017-10-02T19:23:27Z"
            }
        ],
        "count": 2
    }
    

    This endpoint retrieves a specific customers address tokens.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/customer/<ID>/addresses

    URL Parameters

    Parameter Description
    ID The ID of the customer to retrieve addresses for

    Get a specific Customers Address Tokens

    curl -v -X GET \
    -H "Authorization: <API KEY>" \
    "https://sandbox.gotnpgateway.com/api/customer/<ID>/address/<Address ID>"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": [
            {
                "id": "b798ls2q9qq646ksu07g",
                "customer_id": "b798ls2q9qq646ksu070",
                "first_name": "John",
                "last_name": "Smith",
                "company": "Some Business",
                "address_line_1": "123 Some St",
                "address_line_2": "STE 1",
                "city": "Some Town",
                "state": "IL",
                "postal_code": "60185",
                "country": "US",
                "email": "user@somesite.com",
                "phone": "5555555555",
                "fax": "555555555",
                "created_at": "2017-10-02T18:52:32Z",
                "updated_at": "2017-10-02T18:52:32Z"
            }
        ],
        "count": 1
    }
    

    This endpoint retrieves a specific customer address token.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/customer/<ID>/address/<Address ID>

    URL Parameters

    Parameter Description
    ID The ID of the customer to reference
    Address ID The ID of the address to retrieve

    Update a Specific Customer Address

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "first_name": "John",
        "last_name": "Smith",
        "company": "Some Business",
        "address_line_1": "123 Some St",
        "address_line_2": "",
        "city": "Some Town",
        "state": "IL",
        "postal_code": "60185",
        "country": "US",
        "email": "user@somesite.com",
        "phone": "5555555555",
        "fax": "555555555"
      }' \
      "https://sandbox.gotnpgateway.com/api/customer/<ID>/address/<Address ID>"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": null
    }
    

    This endpoint updates a specific address token.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/customer/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the customer to reference
    Address ID The ID of the address to retrieve

    Request Body Parameters

    Parameter Description
    first_name
    last_name
    company
    address_line_1
    address_line_2
    city
    state
    postal_code
    country
    email
    phone
    fax

    Delete a Specific Customer Address

    curl -v -X DELETE \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/customer/<ID>/address/<Address ID>"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": null
    }
    

    This endpoint deletes a specific customer address token.

    HTTP Request

    DELETE https://sandbox.gotnpgateway.com/api/customer/<ID>/address/<Address ID>

    URL Parameters

    Parameter Description
    ID The ID of the customer to reference
    Address ID The ID of the address to retrieve

    Create a new Payment Token

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "card_number": "4111111111111111",
        "expiration_date": "1220"
      }' \
      "https://sandbox.gotnpgateway.com/api/customer/b798ls2q9qq646ksu070/paymentmethod/card"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": {
            "card": {
                "id": "b799g1iq9qq6dk5l39i0",
                "card_type": "visa",
                "first_six": "411111",
                "last_four": "1112",
                "masked_card": "411111******1112",
                "expiration_date": "12/20",
                "created_at": "2017-10-02T19:48:22.468483Z",
                "updated_at": "2017-10-02T19:48:22.468483Z"
            }
        }
    }
    

    This endpoint creates a new customer payment token.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/customer/<ID>/paymentmethod/<Type>

    URL Parameters

    Parameter | Description ID | The ID of the customer to create the payment method for Type | The type of payment method to create. Currently card is all that is supported

    Request Body Parameters

    Parameter Default Description
    card_number Full credit card number
    expiration_date Credit card expiration. Format MMYY

    Get all payment tokens for a specific Customer

    curl -v -X GET \
    -H "Authorization: <API KEY>" \
    "https://sandbox.gotnpgateway.com/api/customer/<ID>/paymentmethod/card"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": [
            {
                "id": "b798ls2q9qq646ksu080",
                "card_type": "visa",
                "first_six": "411111",
                "last_four": "1111",
                "masked_card": "411111******1111",
                "expiration_date": "12/20",
                "created_at": "2017-10-02T18:52:32Z",
                "updated_at": "2017-10-02T18:52:32Z"
            },
            {
                "id": "b799g1iq9qq6dk5l39i0",
                "card_type": "visa",
                "first_six": "411111",
                "last_four": "1112",
                "masked_card": "411111******1112",
                "expiration_date": "12/20",
                "created_at": "2017-10-02T19:48:22Z",
                "updated_at": "2017-10-02T19:48:22Z"
            }
        ],
        "count": 2
    }
    

    This endpoint retrieves a specific customers payment tokens.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/customer/<ID>/paymentmethod/card

    URL Parameters

    Parameter Description
    ID The ID of the customer to retrieve payment methods for

    Get a specific Customers Payment Tokens

    curl -v -X GET \
    -H "Authorization: <API KEY>" \
    "https://sandbox.gotnpgateway.com/api/customer/<ID>/paymentmethod/card/<Payment ID>"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": [
            {
                "id": "b798ls2q9qq646ksu080",
                "card_type": "visa",
                "first_six": "411111",
                "last_four": "1111",
                "masked_card": "411111******1111",
                "expiration_date": "12/20",
                "created_at": "2017-10-02T18:52:32Z",
                "updated_at": "2017-10-02T18:52:32Z"
            }
        ],
        "count": 1
    }
    

    This endpoint retrieves a customers specific payment method.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/customer/<ID>/paymentmethod/card/<Payment ID>

    URL Parameters

    Parameter Description
    ID The ID of the customer to reference
    Payment ID The ID of the payment method to retrieve

    Update a Specific Payment Token

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "card_number": "4111111111111111",
        "expiration_date": "1220"
      }' \
      "https://sandbox.gotnpgateway.com/api/customer/<ID>/paymentmethod/card/<Payment ID>"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": null
    }
    

    This endpoint updates a specific payment token.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/customer/<ID>/paymentmethod/card/<Payment ID>

    URL Parameters

    Parameter Description
    ID The ID of the customer to reference
    Payment ID The ID of the payment token to update

    Request Body Parameters

    Parameter Description
    card_number Full credit card number
    expiration_date Credit card expiration. Format MMYY

    Delete a Specific Customer Payment Token

    curl -v -X DELETE \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/customer/<ID>/paymentmethod/card/<Payment ID>"
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "msg": "success",
        "data": null
    }
    

    This endpoint deletes a specific customer payment token.

    HTTP Request

    DELETE https://sandbox.gotnpgateway.com/api/customer/<ID>/paymentmethod/card/<Payment ID>

    URL Parameters

    Parameter Description
    ID The ID of the customer to reference
    Payment ID The ID of the payment token to delete

    Recurring

    Create a Add On

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "test plan",
        "description": "just a simple test plan",
        "amount": 100,
        "duration": 0
        }' \
      "https://sandbox.gotnpgateway.com/api/recurring/addon"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89ffdqj8m0o735i19i0",
        "name": "test plan",
        "description": "just a simple test plan",
        "amount": 100,
        "percentage": null,
        "duration": 0,
        "created_at": "2017-11-20T15:41:43.330315Z",
        "updated_at": "2017-11-20T15:41:43.330315Z"
      }
    }
    

    This endpoint creates a new recurring plan add on, add ons are used to adjust a recurring charge amount either by a set amount or a percentage of the subscription amount.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/recurring/addon

    Request Body Parameters

    Parameter Type Description
    name string Display name for the addition
    description string Description for the addition
    amount* int Amount to be added
    percentage* int Percentage of original charge to be added
    duration int Duration for the addition to be billed

    Please note you may provide either amount or percentage, but not both.

    Get Add On

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/recurring/addon/b89ffdqj8m0o735i19i0"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89ffdqj8m0o735i19i0",
        "name": "test plan",
        "description": "just a simple test plan",
        "amount": 100,
        "percentage": null,
        "duration": 0,
        "created_at": "2017-11-20T15:41:43.330315Z",
        "updated_at": "2017-11-20T15:41:43.330315Z"
      }
    }
    

    This endpoint returns a specific add on.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/recurring/addon/<addon_id>

    Query Parameters

    Parameter Type Description
    addon_id string Add On ID to be returned

    Get All Add Ons

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/recurring/addons"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": [
        {
          "id": "b75cvl51tlv38t0o7o30",
          "name": "test_addon",
          "description": "some description",
          "amount": 100,
          "percentage": null,
          "duration": 0,
          "created_at": "2017-09-26T22:08:20Z",
          "updated_at": "2017-09-26T22:08:20Z"
        },
        {
          "id": "b779mpt1tlv96kdv2n20",
          "name": "test_addon_percent",
          "description": "",
          "amount": null,
          "percentage": 10,
          "duration": 0,
          "created_at": "2017-10-09T20:39:41Z",
          "updated_at": "2017-10-09T20:39:41Z"
        },
        {
          "id": "b89ffdqj8m0o735i19i0",
          "name": "test plan",
          "description": "just a simple test plan",
          "amount": 100,
          "percentage": null,
          "duration": 0,
          "created_at": "2017-11-20T15:41:43Z",
          "updated_at": "2017-11-20T15:41:43Z"
        }
      ],
      "total_count": 3
    }
    

    This endpoint returns all add ons.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/recurring/addons

    Update an Add On

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "test plan",
        "description": "just a simple test plan",
        "amount": 100,
        "duration": 0
        }' \
      "https://sandbox.gotnpgateway.com/api/recurring/addon/b89ffdqj8m0o735i19i0"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89ffdqj8m0o735i19i0",
        "name": "test plan",
        "description": "just a simple test plan",
        "amount": 100,
        "percentage": null,
        "duration": 0,
        "created_at": "2017-11-20T15:41:43.330315Z",
        "updated_at": "2017-11-20T15:41:43.330315Z"
      }
    }
    

    This endpoint updates a recurring add on.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/recurring/addon/<addon_id>

    Query Parameters

    Parameter Type Description
    addon_id string Add On ID to be returned

    Request Body Parameters

    Parameter Type Description
    name string Display name for the addition
    description string Description for the addition
    amount* int Amount to be added
    percentage* int Percentage of original charge to be added
    duration int Duration for the addition to be billed

    Please note you may provide either amount or percentage, but not both.

    Delete Add On

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -X DELETE \
      "https://sandbox.gotnpgateway.com/api/recurring/addon/b89ffdqj8m0o735i19i0"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": null
    }
    

    This endpoint deletes a specific addon

    HTTP Request

    DELETE https://sandbox.gotnpgateway.com/api/recurring/addon/<addon_id>

    Query Parameters

    Parameter Type Description
    addon_id string Add On ID to be deleted

    Create a Discount

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "test discount",
        "description": "just a simple test discount",
        "amount": 100,
        "duration": 0
        }' \
      "https://sandbox.gotnpgateway.com/api/recurring/discount"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89flfqj8m0o735i19ig",
        "name": "test discount",
        "description": "just a simple test discount",
        "amount": 100,
        "percentage": null,
        "duration": 0,
        "created_at": "2017-11-20T15:54:39.851636Z",
        "updated_at": "2017-11-20T15:54:39.851636Z"
      }
    }
    

    This endpoint creates a new recurring plan discount, discounts are used to adjust a recurring charge amount either by a set amount or a percentage of the subscription amount.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/recurring/discount

    Request Body Parameters

    Parameter Type Description
    name string Display name for the addition
    description string Description for the addition
    amount* int Amount to be discounted
    percentage* int Percentage of original charge to be discounted
    duration int Duration for the discount to be billed

    Please note you may provide either amount or percentage, but not both.

    Get Discount

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/recurring/discount/b89flfqj8m0o735i19ig"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89flfqj8m0o735i19ig",
        "name": "test discount",
        "description": "just a simple test discount",
        "amount": 100,
        "percentage": null,
        "duration": 0,
        "created_at": "2017-11-20T15:54:39.851636Z",
        "updated_at": "2017-11-20T15:54:39.851636Z"
      }
    }
    

    This endpoint returns a specific discount.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/recurring/discount/<discount_id>

    Query Parameters

    Parameter Type Description
    discount_id string Discount ID to be returned

    Get All Discounts

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/recurring/discounts"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": [
        {
          "id": "b89flfqj8m0o735i19ig",
          "name": "test discount",
          "description": "just a simple test discount",
          "amount": 100,
          "percentage": null,
          "duration": 0,
          "created_at": "2017-11-20T15:54:40Z",
          "updated_at": "2017-11-20T15:54:40Z"
        },
        {
          "id": "b779mpt1tlv96kdv2n20",
          "name": "test_discount_percent",
          "description": "",
          "amount": null,
          "percentage": 10,
          "duration": 0,
          "created_at": "2017-10-09T20:59:52Z",
          "updated_at": "2017-10-09T20:59:52Z"
        }
      ],
      "total_count": 2
    }
    

    This endpoint returns all discounts.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/recurring/discounts

    Update a Discount

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "test discount",
        "description": "just a simple test discount",
        "amount": 100,
        "duration": 0
        }' \
      "https://sandbox.gotnpgateway.com/api/recurring/discount/b89flfqj8m0o735i19ig"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89flfqj8m0o735i19ig",
        "name": "test discount",
        "description": "just a simple test discount",
        "amount": 100,
        "percentage": null,
        "duration": 0,
        "created_at": "2017-11-20T15:54:39.851636Z",
        "updated_at": "2017-11-20T15:54:39.851636Z"
      }
    }
    

    This endpoint updates a recurring discount.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/recurring/discount/<discount_id>

    Query Parameters

    Parameter Type Description
    discount_id string Discount ID to be returned

    Request Body Parameters

    Parameter Type Description
    name string Display name for the addition
    description string Description for the addition
    amount* int Amount to be discounted
    percentage* int Percentage of original charge to be discounted
    duration int Duration for the discount to be billed

    Please note you may provide either amount or percentage, but not both.

    Delete Discount

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -X DELETE \
      "https://sandbox.gotnpgateway.com/api/recurring/discount/b89flfqj8m0o735i19ig"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": null
    }
    

    This endpoint deletes a specific discount

    HTTP Request

    DELETE https://sandbox.gotnpgateway.com/api/recurring/discount/<discount_id>

    Query Parameters

    Parameter Type Description
    discount_id string Discount ID to be deleted

    Create a Plan

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
          "name": "test plan",
          "description": "just a simple test plan",
          "amount": 100,
          "billing_cycle_interval": 1,
          "billing_frequency": "twice_monthly",
          "billing_days": "1,15",
          "duration": 0,
          "add_ons": [
            {
              "id": "b75cvl51tlv38t0o7o30",
              "description": "this will add to the cost of the subscription",
              "amount": 100,
              "duration": 0
            }
          ],
          "discounts": [
            {
              "id": "b89flfqj8m0o735i19ig",
              "description": "this will discount the cost of the subscription",
              "amount": 50,
              "duration": 0
            }
          ]
      }' \
      "https://sandbox.gotnpgateway.com/api/recurring/plan"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89g35qj8m0o735i19jg",
        "name": "test plan",
        "description": "just a simple test plan",
        "amount": 100,
        "billing_cycle_interval": 1,
        "billing_frequency": "twice_monthly",
        "billing_days": "1,15",
        "total_add_ons": 100,
        "total_discounts": 50,
        "duration": 0,
        "add_ons": [
          {
            "id": "b75cvl51tlv38t0o7o30",
            "name": "test_addon",
            "description": "this will add to the cost of the subscription",
            "amount": 100,
            "percentage": null,
            "duration": 0,
            "created_at": null,
            "updated_at": null
          }
        ],
        "discounts": [
          {
            "id": "b89flfqj8m0o735i19ig",
            "name": "test discount",
            "description": "this will discount the cost of the subscription",
            "amount": 50,
            "percentage": null,
            "duration": 0,
            "created_at": null,
            "updated_at": null
          }
        ],
        "created_at": "2017-11-20T16:23:51.990051Z",
        "updated_at": "2017-11-20T16:23:51.990051Z"
      }
    }
    

    This endpoint creates a new recurring plan with a discount and an add on.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/recurring/plan

    Request Body Parameters

    Parameter Type Description
    name string Display name for the addition
    description string Description for the addition
    amount int Amount to be discounted
    billing_cycle_interval int How often to run the billing cycle. Run every x months
    billing_frequency string How often run within a billing cycle. (monthly
    billing_days string Which day to bill on. If twice_monthly, then comma separate dates
    add_ons array Allows for additions to a recurring plan.
    add_ons[#].id string ID of the referenced add_on
    add_ons[#].name string Display name for the addition (optional, this overrides the add_ons value)
    add_ons[#].description string Description for the addition (optional, this overrides the add_ons value)
    add_ons[#].amount int Amount to be added (optional, this overrides the add_ons value)
    add_ons[#].duration int Duration for the addition to be billed (optional, this overrides the add_ons value)
    discounts[#].id string ID of the referenced discount
    discounts[#].name string Display name for the discount (optional, this overrides the discount value)
    discounts[#].description string Description for the discount (optional, this overrides the discount value)
    discounts[#].amount int Amount to be discounted (optional, this overrides the discount value)
    discounts[#].duration int Duration for the discount to be billed (optional, this overrides the discount value)

    Update a Plan

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
          "name": "test plan",
          "description": "just a simple test plan",
          "amount": 100,
          "billing_cycle_interval": 1,
          "billing_frequency": "twice_monthly",
          "billing_days": "1,15",
          "duration": 0,
          "add_ons": [
            {
              "id": "b75cvl51tlv38t0o7o30",
              "description": "this will add to the cost of the subscription",
              "amount": 100,
              "duration": 0
            }
          ],
          "discounts": [
            {
              "id": "b89flfqj8m0o735i19ig",
              "description": "this will discount the cost of the subscription",
              "amount": 50,
              "duration": 0
            }
          ]
      }' \
      "https://sandbox.gotnpgateway.com/api/recurring/plan/b89g35qj8m0o735i19jg"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89g35qj8m0o735i19jg",
        "name": "test plan",
        "description": "just a simple test plan",
        "amount": 100,
        "billing_cycle_interval": 1,
        "billing_frequency": "twice_monthly",
        "billing_days": "1,15",
        "total_add_ons": 100,
        "total_discounts": 50,
        "duration": 0,
        "add_ons": [
          {
            "id": "b75cvl51tlv38t0o7o30",
            "name": "test_addon",
            "description": "this will add to the cost of the subscription",
            "amount": 100,
            "percentage": null,
            "duration": 0,
            "created_at": null,
            "updated_at": null
          }
        ],
        "discounts": [
          {
            "id": "b89flfqj8m0o735i19ig",
            "name": "test discount",
            "description": "this will discount the cost of the subscription",
            "amount": 50,
            "percentage": null,
            "duration": 0,
            "created_at": null,
            "updated_at": null
          }
        ],
        "created_at": "2017-11-20T16:23:51.990051Z",
        "updated_at": "2017-11-20T16:23:51.990051Z"
      }
    }
    

    This endpoint updates a recurring plan.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/recurring/plan/<plan_id>

    Query Parameters

    Parameter Description
    plan_id Plan ID to update

    Request Body Parameters

    Parameter Type Description
    name string Display name for the addition
    description string Description for the addition
    amount int Amount to be discounted
    billing_cycle_interval int How often to run the billing cycle. Run every x months
    billing_frequency string How often run within a billing cycle. (monthly
    billing_days string Which day to bill on. If twice_monthly, then comma separate dates
    add_ons array Allows for additions to a recurring plan.
    add_ons[#].id string ID of the referenced add_on
    add_ons[#].name string Display name for the addition (optional, this overrides the add_ons value)
    add_ons[#].description string Description for the addition (optional, this overrides the add_ons value)
    add_ons[#].amount int Amount to be added (optional, this overrides the add_ons value)
    add_ons[#].duration int Duration for the addition to be billed (optional, this overrides the add_ons value)
    discounts[#].id string ID of the referenced discount
    discounts[#].name string Display name for the discount (optional, this overrides the discount value)
    discounts[#].description string Description for the discount (optional, this overrides the discount value)
    discounts[#].amount int Amount to be discounted (optional, this overrides the discount value)
    discounts[#].duration int Duration for the discount to be billed (optional, this overrides the discount value)

    Get a Plan

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/recurring/plan/b89g35qj8m0o735i19jg"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89g35qj8m0o735i19jg",
        "name": "test plan",
        "description": "just a simple test plan",
        "amount": 100,
        "billing_cycle_interval": 1,
        "billing_frequency": "twice_monthly",
        "billing_days": "1,15",
        "total_add_ons": 100,
        "total_discounts": 50,
        "duration": 0,
        "add_ons": [
          {
            "id": "b75cvl51tlv38t0o7o30",
            "name": "test_addon",
            "description": "this will add to the cost of the subscription",
            "amount": 100,
            "percentage": null,
            "duration": 0,
            "created_at": null,
            "updated_at": null
          }
        ],
        "discounts": [
          {
            "id": "b89flfqj8m0o735i19ig",
            "name": "test discount",
            "description": "this will discount the cost of the subscription",
            "amount": 50,
            "percentage": null,
            "duration": 0,
            "created_at": null,
            "updated_at": null
          }
        ],
        "created_at": "2017-11-20T16:23:51.990051Z",
        "updated_at": "2017-11-20T16:23:51.990051Z"
      }
    }
    

    This endpoint returns a specific plan.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/recurring/plan/<plan_id>

    Query Parameters

    Parameter Type Description
    plan_id string Plan ID to be returned

    Get All Plans

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/recurring/plans"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": [
      {
        "id": "b89g35qj8m0o735i19jg",
        "name": "test plan",
        "description": "just a simple test plan",
        "amount": 100,
        "billing_cycle_interval": 1,
        "billing_frequency": "twice_monthly",
        "billing_days": "1,15",
        "total_add_ons": 100,
        "total_discounts": 50,
        "duration": 0,
        "add_ons": [
          {
            "id": "b75cvl51tlv38t0o7o30",
            "name": "test_addon",
            "description": "this will add to the cost of the subscription",
            "amount": 100,
            "percentage": null,
            "duration": 0,
            "created_at": null,
            "updated_at": null
          }
        ],
        "discounts": [
          {
            "id": "b89flfqj8m0o735i19ig",
            "name": "test discount",
            "description": "this will discount the cost of the subscription",
            "amount": 50,
            "percentage": null,
            "duration": 0,
            "created_at": null,
            "updated_at": null
          }
        ],
        "created_at": "2017-11-20T16:23:52Z",
        "updated_at": "2017-11-20T16:23:52Z"
      }
      ],
      "total_count": 1
    }
    

    This endpoint returns all plans.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/recurring/plans

    Delete a Plan

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -X DELETE \
      "https://sandbox.gotnpgateway.com/api/recurring/plan/b89g35qj8m0o735i19jg"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": null
    }
    

    This endpoint deletes a specific discount

    HTTP Request

    DELETE https://sandbox.gotnpgateway.com/api/recurring/plan/<plan_id>

    Query Parameters

    Parameter Type Description
    plan_id string Plan ID to be deleted

    Create a Subscription

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
    "plan_id": "b89g35qj8m0o735i19jg",
    "description": "some description to describe the subscription",
    "customer": {
                "id": "b81ko5qq9qq5v460r9i0"
            },
    "amount": 100,
    "billing_cycle_interval": 1,
    "billing_frequency": "twice_monthly",
    "billing_days": "1,15",
    "duration": 0,
    "1next_bill_date": "2019-11-21",
    "add_ons": [],
    "discounts": [
        {
        "id": "b89flfqj8m0o735i19ig",
            "name": "test discount",
            "description": "this will discount the cost of the subscription",
            "amount": 50,
            "duration": 0
        }
    ]
    }' \
      "https://sandbox.gotnpgateway.com/api/recurring/subscription"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89gftaj8m0oft7upk80",
        "plan_id": "b89g35qj8m0o735i19jg",
        "description": "some description to describe the subscription",
        "customer": {
          "id": "b81ko5qq9qq5v460r9i0"
        },
        "amount": 100,
        "total_adds": 0,
        "total_discounts": 50,
        "billing_cycle_interval": 1,
        "billing_frequency": "twice_monthly",
        "billing_days": "1,15",
        "duration": 0,
        "next_bill_date": "2017-11-22",
        "add_ons": null,
        "discounts": [
          {
            "id": "b89flfqj8m0o735i19ig",
            "description": "this will discount the cost of the subscription",
            "amount": 50,
            "percentage": null,
            "duration": 0
          }
        ],
        "created_at": "2017-11-20T16:51:01.798736Z",
        "updated_at": "2017-11-20T16:51:01.798736Z"
      }
    }
    

    This endpoint creates a new recurring subscription with a discount applied

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/recurring/subscription

    Request Body Parameters

    Parameter Type Description
    plan_id string Plan ID to reference as a template
    description string Description for the addition
    customer.id string Customer ID to bill
    amount int Base amount to be charged
    billing_cycle_interval int How often to run the billing cycle. Run every x months
    billing_frequency string How often run within a billing cycle. (monthly
    billing_days string Which day to bill on. If twice_monthly, then comma separate dates
    add_ons array Allows for additions to a recurring plan.
    add_ons[#].id string ID of the referenced add_on
    add_ons[#].name string Display name for the addition (optional, this overrides the add_ons value)
    add_ons[#].description string Description for the addition (optional, this overrides the add_ons value)
    add_ons[#].amount int Amount to be added (optional, this overrides the add_ons value)
    add_ons[#].duration int Duration for the addition to be billed (optional, this overrides the add_ons value)
    discounts[#].id string ID of the referenced discount
    discounts[#].name string Display name for the discount (optional, this overrides the discount value)
    discounts[#].description string Description for the discount (optional, this overrides the discount value)
    discounts[#].amount int Amount to be discounted (optional, this overrides the discount value)
    discounts[#].duration int Duration for the discount to be billed (optional, this overrides the discount value)

    Update a Subscription

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -d '{
    "plan_id": "b89g35qj8m0o735i19jg",
    "description": "some description to describe the subscription",
    "customer": {
                "id": "b81ko5qq9qq5v460r9i0"
            },
    "amount": 100,
    "billing_cycle_interval": 1,
    "billing_frequency": "twice_monthly",
    "billing_days": "1,15",
    "duration": 0,
    "next_bill_date": "2017-11-22",
    "add_ons": [],
    "discounts": [
        {
        "id": "b89flfqj8m0o735i19ig",
            "name": "test discount",
            "description": "this will discount the cost of the subscription",
            "amount": 50,
            "duration": 0
        }
    ]
    }' \
      "https://sandbox.gotnpgateway.com/api/recurring/subscription/b89gftaj8m0oft7upk80"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89gftaj8m0oft7upk80",
        "plan_id": "b89g35qj8m0o735i19jg",
        "description": "some description to describe the subscription",
        "customer": {
          "id": "b81ko5qq9qq5v460r9i0"
        },
        "amount": 100,
        "total_adds": 0,
        "total_discounts": 50,
        "billing_cycle_interval": 1,
        "billing_frequency": "twice_monthly",
        "billing_days": "1,15",
        "duration": 0,
        "next_bill_date": "2017-11-22",
        "add_ons": null,
        "discounts": [
          {
            "id": "b89flfqj8m0o735i19ig",
            "description": "this will discount the cost of the subscription",
            "amount": 50,
            "percentage": null,
            "duration": 0
          }
        ],
        "created_at": "2017-11-20T16:51:01.798736Z",
        "updated_at": "2017-11-20T16:51:01.798736Z"
      }
    }
    

    This endpoint updates a recurring subscription.

    HTTP Request

    POST https://sandbox.gotnpgateway.com/api/recurring/plan/<plan_id>

    Query Parameters

    Parameter Description
    subscription_id Subscription ID to update

    Request Body Parameters

    Parameter Type Description
    plan_id string Plan ID to reference as a template
    description string Description for the addition
    customer.id string Customer ID to bill
    amount int Base amount to be charged
    billing_cycle_interval int How often to run the billing cycle. Run every x months
    billing_frequency string How often run within a billing cycle. (monthly
    billing_days string Which day to bill on. If twice_monthly, then comma separate dates
    add_ons array Allows for additions to a recurring plan.
    add_ons[#].id string ID of the referenced add_on
    add_ons[#].name string Display name for the addition (optional, this overrides the add_ons value)
    add_ons[#].description string Description for the addition (optional, this overrides the add_ons value)
    add_ons[#].amount int Amount to be added (optional, this overrides the add_ons value)
    add_ons[#].duration int Duration for the addition to be billed (optional, this overrides the add_ons value)
    discounts[#].id string ID of the referenced discount
    discounts[#].name string Display name for the discount (optional, this overrides the discount value)
    discounts[#].description string Description for the discount (optional, this overrides the discount value)
    discounts[#].amount int Amount to be discounted (optional, this overrides the discount value)
    discounts[#].duration int Duration for the discount to be billed (optional, this overrides the discount value)

    Get a Subscription

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/subscription/b89gftaj8m0oft7upk80"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": {
        "id": "b89gftaj8m0oft7upk80",
        "plan_id": "b89g35qj8m0o735i19jg",
        "description": "some description to describe the subscription",
        "customer": {
          "id": "b81ko5qq9qq5v460r9i0"
        },
        "amount": 100,
        "total_adds": 0,
        "total_discounts": 50,
        "billing_cycle_interval": 1,
        "billing_frequency": "twice_monthly",
        "billing_days": "1,15",
        "duration": 0,
        "next_bill_date": "2017-11-22",
        "add_ons": null,
        "discounts": [
          {
            "id": "b89flfqj8m0o735i19ig",
            "description": "this will discount the cost of the subscription",
            "amount": 50,
            "percentage": null,
            "duration": 0
          }
        ],
        "created_at": "2017-11-20T16:51:01.798736Z",
        "updated_at": "2017-11-20T16:51:01.798736Z"
      }
    }
    

    This endpoint returns a specific subscription.

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/recurring/subscription/<subscription_id>

    Query Parameters

    Parameter Type Description
    subscription_id string Subscription ID to be returned

    Delete a Subscription

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      -X DELETE \
      "https://sandbox.gotnpgateway.com/api/recurring/subscription/b89gftaj8m0oft7upk80"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "success",
      "data": null
    }
    

    This endpoint deletes a specific discount

    HTTP Request

    DELETE https://sandbox.gotnpgateway.com/api/recurring/subscription/<subscription_id>

    Query Parameters

    Parameter Type Description
    subscription_id string Subscription ID to be deleted

    Terminals

    TransNational Payments is currently integrated to Dejavoo Z11, Z8 and Z1 terminals.

    All transactional requests should be processed via the /transaction referencing the specific terminal to handle the request. Please see the Transactions section for more information.

    Get all terminals

    curl -v -X POST \
      -H "Authorization: <API KEY>" \
      -H "Content-Type: application/json" \
      "https://sandbox.gotnpgateway.com/api/terminals"
    

    The above command returns JSON structured like this:

    {
      "status": "success",
      "msg": "",
      "total_count": 1,
      "data": [
        {
          "id": "1ucio551tlv85l7moe5s",
          "merchant_id": "aucio551tlv85l7moe5g",
          "manufacturer": "dejavoo",
          "model": "z11",
          "serial_number": "1811000XXXX",
          "tpn": "1811000XXXX",
          "description": "front counter z11",
          "status": "active",
          "auth_key": "wcR1c9o1",
          "register_id": "1",
          "auto_settle": true,
          "settle_at": "00:00:00",
          "created_at": "2018-01-12T03:57:59Z",
          "updated_at": "0001-01-01T00:00:00Z"
        }
      ]
    }
    

    This endpoint returns all terminals associated with the merchant account. This will include inactive/disabled terminals as well

    HTTP Request

    GET https://sandbox.gotnpgateway.com/api/terminals

    Query Parameters

    Parameter Type Description

    None

    Errors

    The TransNational Payments API uses the following error codes:

    Error Code Meaning
    400 Bad Request
    401 Unauthorized
    404 Not Found
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.