Versapay API Reference (1.3.31)

Download OpenAPI specification:Download

Overview

The Versapay API offers operations in support of its flagship products:

  • Collaborative AR (formerly ARC) - accounts receivable platform with automated invoicing, effective collaboration, flexible payments and cash application to improve efficiency and customer relationships.

    • Importing & exporting customers, invoices, and payments.

    • Monitoring file based imports/batches.

    • Importing & exporting orders and processing order based payment transactions.

    • Ecommerce integrations.

  • PayPort - cloud based platform to electronically push and pull funds across the EFT / ACH network.

    • Moving funds using transactions and pre-authorized debit agreements.

    • A secure hosted checkout for accepting payments through your website or email.

Please contact us at support@versapay.com for support & setup of A/R invoicing integration, hosted checkout, and/or payment acceptance.

Versioning & Compatibility

The current API version is Versapay API Reference (1.3.31).

Versapay commits to maintaining backward compatibility and existing API endpoints with each released version updating existing endpoints and/or introducing new endpoints.

Should Versapay require deprecation of a published API, Versapay will work with its API clients/users to confirm specific EOL/migration timelines with ample lead times, as well as endpoint migration strategies.

Environments

The UAT environment is a useful sandbox for integration testing where transaction settlements are simulated using test account numbers and test dollar amounts.

https://uat.versapay.com

Once integration testing is complete via the UAT environment, start sending your requests to the production URL to start moving money and/or integrating with Versapay.

https://secure.versapay.com

Rate Limits

The standard rate limit is 1500 requests per minute per IP address, but Versapay reserves the right to raise or lower that limit based on network conditions. When the rate limit is exceeded, APIs will return error HTTP 1015 you are being rate limited. Partner- or customer-specific rate limits can be established by special agreement.

Authentication

Visit your account settings in UAT (https://uat.versapay.com/account) or Production (https://secure.versapay.com/account) to setup API credentials needed for authentication as well as webhooks to receive relevant callbacks from Versapay transaction processing.

You can generate/disable your API credentials as often as necessary for security reasons.

If you do not have an account, please contact Versapay Support for support & setup of AR invoicing integration, hosted checkout and/or payment acceptance for partner and/or API credential setup.

API Token and API Key

API requests are authenticated using API Token & Key via HTTPS Basic Access Authentication.

Security Scheme Type HTTPS
HTTPS Authorization Scheme basic

Simply provide the API Token & Key values as the user and password parameters, using cURL for instance:

curl -u "Nvax...:UN0I..." -X POST https://secure.versapay.com/api/...

JWT Token

Alternatively, API requests can also be authenticated using JWT Token via HTTPS Bearer Authentication.

Security Scheme Type HTTPS
HTTP Authorization Scheme bearer JWT
JWT Tokens, automatically generated alongside API Token & Key, are displayed along with expiration in account settings as well as via authenticated /api/whoami, see Authentication Echo identity and account profile settings

Simply provide the JWT Token in the authorization header, using cURL for instance:

curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbiI6Im54eDFaSjgzeXRNNmhtb3NGVExCIiwiZXhwIjoxNzEyOTU5NDA5fQ.adV6U1vW69Ypskt61uPL8hZ-4muvtM4FLM48QN6iCc4" -X POST https://secure.versapay.com/api/...

Echo identity and account profile settings

Lists key account profile settings configured for the authenticated account

query Parameters
options[jwt_expiry]
integer

Number of days (1-365) until JWT expiration, default 30.

Responses

200

Successful Operation

401

Unauthorized

get /api/whoami

Production

https://secure.versapay.com/api/whoami

UAT

https://uat.versapay.com/api/whoami

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "whoami":
    {
    }
}

Webhooks

Versapay uses the Webhook pattern to POST updates to a HTTP (port 80) or HTTPS (port 443) URL you specify.

HTTP Acknowledgement

The specified URL must return a status code of 200 otherwise Versapay will continue attempting to deliver the POST up to a system defined number of attempts.

Idempotency

A webhook consumer must be idempotent in receiving replayed/duplicated webhook payload transmissions which may arise as a result of subscription configuration and event timing and/or retry scenarios.

Viewing Portal

You can view details for the latest notifications sent to your application by visiting /developers/webhook_responses in uat or production.

Entity Payloads

Webhooks can receive updates for the following PayPort entities:

  • State updates of any Transaction created by your account or going to your account. The request parameters will contain the same attributes as returned by viewing a transaction via GET /api/transactions/{token}.

  • State updates of any Debit Agreement created by your account or sent to your account. The request parameters will contain the same attributes as returned by viewing a debit agreement via GET /api/debit_agreements/{token}.

Webhooks can receive updates for the following Collaborative AR entities:

  • Recent events for any Customer part of your supplier account. The request parameters will contain the same attributes as returned by viewing a customer via GET /api/exports/customer/{identifier}.

  • Recent events for any Invoice part of your supplier account. The request parameters will contain the same attributes as returned by viewing an invoice via GET /api/exports/invoice/{number_or_id}.

  • Recent events for any Payment part of your supplier account. The request parameters will contain the same attributes as returned by viewing a payment via GET /api/exports/payment/{reference_or_token}.

HMAC Signatures for Payport

Versapay will append a HMAC-SHA256 signature attribute to all webhook notifications. For instance:

POST http://your.domain.com/your/webhook/url
{
    "to_account":"Example user",
    "token":"5TH3ACC3AU21",
    "transaction_reference":"",
    "from_account":"First1 Last1",
    "from_fund":"THE TORONTO-DOMINION BANK",
    "transaction_type":"send_money",
    "amount_in_cents":500,
    "type":"transaction",
    "created_by_user":"699cMPe6BAyqvVsZA5mo",
    "message":"",
    "state":"completed",
    "link_url":"",
    "email":"user@example.com",
    "signature":"USYpBfZFQQHa2%2BT6UtDPUVFfUPP0aobWpXe5DE9hPOY%3D%0A"
}

To verify the authenticity of received webhook notifications:

  1. Generate a single line request string concatenated with new line from:

    • The upper cased HTTP verb/method
    • The webhook URL
    • The attribute key/value pairs (without spaces) sorted ascending by key (excluding the signature attribute)
  2. Calculate the HMAC-SHA256 of the single line string along using your Versapay signing key (which is displayed on your webhook account settings) and Base64 the result.

  3. URL Encode the HMAC and compare to the value of the signature attribute for a match.

# Example of HMAC-SHA256 signature calculation - using Rails/Sinatra our POST payload is accessible via params

require 'openssl'
require 'base64'
require 'erb'

webhook_url = 'http://your.domain.com/your/webhook/url';
webhook_signing_key = 'v7aJHjbbxASKiwDW5wq6';

original_signature = params.delete(:signature)
sorted_key_values = params.keys.sort.map{ |key| "#{key}#{params[key]}" }.join

request_string = "POST\n#{webhook_url}\n#{sorted_key_values}"

expected_signature = ERB::Util.url_encode( Base64.encode64( OpenSSL::HMAC.digest(
OpenSSL::Digest::SHA256.new, webhook_signing_key, request_string
) ) )

puts "\nexpected signature: #{expected_signature}"
puts "\noriginal signature: #{original_signature}"
puts "\nauthentic? #{expected_signature == original_signature}"

HMAC Signatures for Collaborative AR

Versapay will send a HMAC-SHA256 signature attribute to all webhook notification request headers under the key X-Versapay-Signature

To verify the authenticity of received webhook notifications:

  1. Calculate the HMAC-SHA256 of the JSON request body using your Versapay signing key (which is displayed on your webhook account settings) and Base64 the result.
  2. URL Encode the HMAC and compare the result to the value of the original signature found in the request header
/* Example of HMAC-SHA256 signature calculation - using JavaScript/Express our POST payload is accessible via req.body */
const express = require('express');
const bodyParser = require('body-parser');
const crypto = require('crypto');
const app = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.post('/webhook', (req, res) => {
  let original_signature = req.headers['x-versapay-signature'];
  let webhook_signing_key = 'v7aJHjbbxASKiwDW5wq6';
  let raw_request_body = JSON.stringify(req.body);
  let hmac = crypto.createHmac('sha256', webhook_signing_key).update(raw_request_body).digest('base64');
  let expected_signature = encodeURIComponent(hmac + "\n")
  console.log(`original signature: ${original_signature}`);
  console.log(`expected signature: ${expected_signature}`);
  console.log(`authentic? ${expected_signature === original_signature}`);
});

Watermark & Limit

The API offers polling based endpoints to supplement/alternative to webhook integration. The requisite GET endpoints for customer, invoice, payment, and settlement reporting accept a "watermark" option to ensure that data more recent than the provided watermark is retrieved.

They also support a limit argument, which defaults to 100 items -- and are capped up to 2500 for performance reasons. Otherwise, the limit can be used to draw 1-2500 items at a time depending on the integrators need and performance boundaries.

The watermark & limit are specified as part of the API call e.g. GET /api/exports/open_invoices?watermark=13207500&limit=5

The watermark is typically an 8-byte integer unless otherwise specified. The limit is an integer between 1 and 2500.

API Response Structure

The general response structure of these API are an ordered hash of records, whose key/index is a watermark value.

The iteration pattern would be, for instance:

last_watermark = 0
json = GET /api/...?watermark={last_watermark}
for each watermark_key in json.keys

  record = json[watermark_key]

  last_watermark = watermark_key if watermark_key > last_watermark

Otherwise, an API response may be a flat array list, where the watermark value is a key in the array item record, just the same:

last_watermark = 0
json = GET /api/...?watermark={last_watermark}
for each record in json

  watermark_key = record["watermark"]

  last_watermark = watermark_key if watermark_key > last_watermark

The last watermark key (or last watermark attribute where echo'd on a record) in the result set can be used as the argument to the next call e.g.

  • GET /api/exports/open_invoices
  • GET /api/exports/open_invoices?limit=2
  • GET /api/exports/open_invoices?watermark=13207500&limit=7

API Response Structure - Flat Array List of Records

The flat array list response structure can be explicitly requested via list=true URL argument.

Reference Data

For convenience purposes only, Versapay can supply third party reference data to its partners and users. This data can be used to implement client-side tooling (e.g., fraud mitigation services), but it may not be redistributed. The accuracy and completeness of this third party data cannot be guaranteed and is for informational and convenience purposes only. Contact support@versapay.com for eligibility for reference data enablement.

Retrieve list of supported error response codes

View the list of possible error response codes that may be returned as part of a response_code key (and/or gateway_error_* related keys) in Order Transactions API. For instance the following response payload highlights a 211 response code:

{
  "success": false,
  "transaction": "8ATB...586N",
  "authorization": "5dl1...ady5",
  "gateway_token": "71...77",
  "order": "12345",
  "wallet": "2ZW4...8Q6V",
  "credit_card": "CC4X...WXGX",
  "transactions": [
    {
      "token": "...",
      "amount_in_cents": 13151,
      "type": "transaction",
      "transaction_type": "request_money",
      "state": "declined",
      "created_at": "2023-11-14T12:13:29-05:00",
      "step_types": [
        "TransactionSteps::CardSaleStep"
      ],
      "action": "sale",
      "payment_method": "credit_card",
      "wallet": "2ZW4...8Q6V",
      "credit_card": "CC4X...WXGX",
      "settlement_token": "MA4P...LD5P",
      "currency": "usd",
      "approved_amount_cents": 0,
      "fee_amount_cents": 0,
      "fee_exempt": true,
      "gateway_response": {...},
      "gateway_token": "7126377",
      "gateway_authorization_response": "520.014: INVALID ACCOUNT NUMBER",
      "gateway_error_scope": "tpro4",
      "gateway_error_code": "520.014",
      "gateway_error_message": "INVALID ACCOUNT NUMBER",
      "authorization_response": "500",
      "avs_response": "Z",
      "credit_card_bin": "410040",
      "credit_card_masked_number": "XXXXXXXXXXXX9700",
      "credit_card_brand": "visa",
      "credit_card_expiry": "082026"
    }
  ],
  "response_code": 211
}

The /api/reference_data/v1/response_codes payload reports 211 as follows:

{
  "code": 211,
  "description": "Account number invalid"
}

Responses

200

Successful Operation

get /api/reference_data/v1/response_codes

Production

https://secure.versapay.com/api/reference_data/v1/response_codes

UAT

https://uat.versapay.com/api/reference_data/v1/response_codes

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get Bank Identification Number (BIN) reference data

View the Bank Identification Number (BIN) reference data, including bank names, phone number, URLs, country, brand and card types.

Responses

200

Successful Operation

401

Unauthorized

get /api/reference_data/v1/bin

Production

https://secure.versapay.com/api/reference_data/v1/bin

UAT

https://uat.versapay.com/api/reference_data/v1/bin

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get Bank Identification Number (BIN) reference data

View the Bank Identification Number (BIN) reference data for a given bin number, including bank names, phone number, URLs, and card types.

path Parameters
bin
required
string (BankIdentificationNumber) [ 6 .. 8 ] characters ^\d{6,8}$
Example: 411111

Bank Identification Number. It has to have of at least 6 digits.

Responses

200

Successful Operation

401

Unauthorized

get /api/reference_data/v1/bin/{bin}

Production

https://secure.versapay.com/api/reference_data/v1/bin/{bin}

UAT

https://uat.versapay.com/api/reference_data/v1/bin/{bin}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "bin": "411111",
  • "phone": "503-685-4116",
  • "type": "CREDIT",
  • "country": "USA",
  • "category": "PREPAID",
  • "brand": "VISA",
  • "bank": "BANK OF VERSAPAY"
}

Onboarding

Onboarding supports the automated process of applying for merchant services. Contact support@versapay.com for support & setup of supplier onboarding partner credentials.

Retrieves rates and terms for merchant services

The system will return the rates, terms, and conditions for merchant services

query Parameters
locale
string (Locale) ^[a-z]{2}-[a-z]{2}$
Example: locale=en-us

pass an optional country and language

Responses

200

terms parameters

400

bad input parameter

get /api/onboarding/v1/terms

Production

https://secure.versapay.com/api/onboarding/v1/terms

UAT

https://uat.versapay.com/api/onboarding/v1/terms

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "rates":
    [
    ],
  • "prohibited_products":
    {},
  • "terms_and_conditions":
    {
    },
  • "ranges":
    {
    }
}

Create a new application

Adds an application to the system

Request Body schema: application/json

Inventory item to add

business_legal_name
required
string (BusinessName)
business_dba_name
required
string (BusinessName)
business_tax_id_number
required
object (BusinessTaxIdentifier)
business_physical_address
required
object (Address)
business_billing_address
required
object (Address)
ownership_type
required
string (OwnershipType)
Enum: "Financial Institution" "Government" "LLC" "Non-Profit" "Partnership/Gen. Ltd." "Private Corporation" "Public Corporation" "SEC Regulated Corporation" "Sole Proprietorship" "Trust"
stock_ticker_symbol
string (StockTickerSymbol)

required only if ownership_type = "Public Corporation", must be <= 10 characters

business_type
required
string (BusinessType)
Enum: "AutoRental" "MOTO" "ECommerce" "Restaurant" "Lodging" "Retail"
naics_code
required
string (NAICSCode) ^[0-9]{6}$
business_phone
required
string (Phone)

cannot begin with 1 or 0

business_email
required
string <email> (Email)
business_website
required
string <url> (URL)
business_established_date
required
string <date> (Date)
annual_card_volume
required
object (Range)
annual_direct_debit_volume
required
object (RangeAnualDirectDebitVolume)
average_ticket_amount
required
object (RangeAverageTicketAmount)
high_ticket_amount
required
object (RangeHightTicketAmount)
american_express_service_establishment
required
object (ServiceEstablishment)
business_owners
Array of objects (BusinessOwners) <= 4 items
non_business_owner_control_prong
object (NonBusinessOwnerControlProng)

This is a required object when the control_prong is set to Non-Owner

primary_contact
required
object (ApplicationContact)
control_prong
required
string (ControlProng)
Enum: "Owner 1" "Owner 2" "Owner 3" "Owner 4" "Non-Owner"
deposit_account
required
object (DDA)
reference_token
required
string <guid> (ReferenceToken) <= 36 characters

Specify a unique GUID as a client reference to the application

sells_prohibited_products
required
boolean (Boolean)
agrees_terms_and_conditions
required
boolean (Boolean)
terms_and_conditions
required
object (TermsAndConditions)
supporting_documents
Array of objects (Documents)
locale
string (Locale) ^[a-z]{2}-[a-z]{2}$
external_link
string (ExternalLink)

An external reference provided by the the ERP/partner originating the merchant application associated with this supplier

link_to_existing
string (LinkToExisting)

Must match the value of an existing application entry that has previously been submitted

Responses

201

application created

400

invalid input, object invalid

409

an existing item already exists

post /api/onboarding/v1/applications

Production

https://secure.versapay.com/api/onboarding/v1/applications

UAT

https://uat.versapay.com/api/onboarding/v1/applications

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "business_legal_name": "Acme Corporation",
  • "business_dba_name": "Acme Corporation",
  • "business_tax_id_number":
    {
    },
  • "business_physical_address":
    {
    },
  • "business_billing_address":
    {
    },
  • "ownership_type": "Limited Liability Company",
  • "stock_ticker_symbol": "EXMPL",
  • "business_type": "Restaurant",
  • "naics_code": "221111",
  • "business_phone": "503-685-4116",
  • "business_email": "me@example.com",
  • "business_website": "https://www.example.com",
  • "business_established_date": "2022-01-15",
  • "annual_card_volume":
    {
    },
  • "annual_direct_debit_volume":
    {
    },
  • "average_ticket_amount":
    {
    },
  • "high_ticket_amount":
    {
    },
  • "american_express_service_establishment":
    {
    },
  • "business_owners":
    [
    ],
  • "non_business_owner_control_prong":
    {
    },
  • "primary_contact":
    {
    },
  • "control_prong": "Non-Owner",
  • "deposit_account":
    {
    },
  • "reference_token": "1c47dece-489b-4521-89db-0a940ac58235",
  • "sells_prohibited_products": false,
  • "agrees_terms_and_conditions": false,
  • "terms_and_conditions":
    {
    },
  • "supporting_documents":
    [
    ],
  • "locale": "en-us",
  • "external_link": "xyz123abc789",
  • "link_to_existing": "1cb9ca4b-6596-4bac-a24b-8864222cf95d"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "application_token": "1c47dece-489b-4521-89db-0a940ac58235"
}

Get application status

Get the status of an existing application

path Parameters
id
required
string <guid> (ApplicationToken)
Example: 1c47dece-489b-4521-89db-0a940ac58235

Application Token

Responses

200

application status

404

application not found

get /api/onboarding/v1/applications/{id}

Production

https://secure.versapay.com/api/onboarding/v1/applications/{id}

UAT

https://uat.versapay.com/api/onboarding/v1/applications/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "application_status": "Received",
  • "api_credentials":
    {
    }
}

Find the application token of an existing application

Find the application token of an existing applications using the reference token supplied during the create application process

path Parameters
id
required
string <guid> (ReferenceToken) <= 36 characters
Example: 1c47dece-489b-4521-89db-0a940ac58235

Reference Token

Responses

200

application token

404

application not found

get /api/onboarding/v1/applications/search/{id}

Production

https://secure.versapay.com/api/onboarding/v1/applications/search/{id}

UAT

https://uat.versapay.com/api/onboarding/v1/applications/search/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "application_token": "1c47dece-489b-4521-89db-0a940ac58235"
}

Record a Completed Step of a Merchant Application

Record a completed step of the merchant application process as an integer value. A value of 99 indicates the submission of the full application.

Request Body schema: application/json
reference_token
required
string <guid> <= 36 characters

Specify a unique GUID as a client reference to the application. This same reference_token is used for all steps of the same application.

step_number
required
integer

Use values 1,2,3… to indicate steps of the process; 99 indicates the final step of the application

message
required
string <= 255 characters

Description of the step

Responses

201

Created (record was inserted successfully)

400

Bad Request

401

Unauthorized

post /api/onboarding/v1/application_steps

Production

https://secure.versapay.com/api/onboarding/v1/application_steps

UAT

https://uat.versapay.com/api/onboarding/v1/application_steps

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "reference_token": "7654321:2023-10-04T14:52:37",
  • "step_number": "1",
  • "message": "Step 1 Completed"
}

Ecommerce Integration

The Versapay e-commerce solution is composed of several components. First, is a server-side API that allows your application to configure a new payment session, manage customer wallets, create orders, and initiate payments. In addition, there is a client-side JavaScript SDK that enables your web application to accept secure payment data via an iframe hosted by Versapay. Your sensitive payment data will not transit your application when you use the iframe, so your application will have a reduced PCI scope.

In order to accept a payment, the general flow is to first create a session using the server-side API. Once a session ID has been generated by the Versapay server and returned to your application, your client-side code can use that session ID to initialize the Versapay payment SDK, which will, in turn, render the iframe. Next, the customer will interact with the iframe to specify a payment method. The SDK will return a token representing that payment method to your client-side code. Your client-side code must return the token to your server-side code, which will then use the original session ID and the token to create an order and take a payment. Finally, your ERP or order fulfillment system will query the Versapay cloud platform for new orders so that they may be created and fulfilled via your standard workflow.

For more information see Ecommerce API.

Orders

The Order entity represents the sales document in the ERP system. The fields in the ERP system should be aligned as closely as possible with the fields in the order entity, as the gateway will use these fields for credit card interchange optimization. Contact support@versapay.com for support & setup for Order and/or Order Transactions enablement.

Create an order

Create an order.

The set of attributes to send in the request body may vary based on the account configuration. Please contact the implementation specialist for more information.

Request Body schema: application/json

Order.

watermark
integer <int64> (Watermark)
identifier
string

order identifier, this may be imported or if not provided it will be generated by cds

number
string

Order number, may be unique within supplier., supplied by client.

currency
string

Currency code, based on ISO-4217. E.g. CAD, USD, AUD

amount_cents
integer

amount of order in cents.

date
string

order date

billing_name
string

The billing addressee

billing_address
string

The first line of the billing street address

billing_address2
string

The second line of the billing street address

billing_city
string

The billing city

billing_country
string

The 3-character alphabetic ISO billing country code

billing_email
string

The billing email address associated with the addressee

billing_telephone
string

The billing phone number associated with the addressee

billing_postalcode
string

The billing post code or ZIP code

billing_state_province
string

The billing state or province

shipping_name
string

The shipping addressee

shipping_address
string

The first line of the shipping street address

shipping_address2
string

The second line of the shipping street address

shipping_city
string

The shipping city

shipping_country
string

The 3-character alphabetic ISO shipping country code

shipping_email
string

The shipping email address associated with the addressee

shipping_telephone
string

The shipping phone number associated with the addressee

shipping_postalcode
string

The shipping post code or ZIP code

shipping_state_province
string

The shipping state or province

customer_identifier
string

customer identifier, if it was imported

draft
boolean

if true order is a draft else can be published

settlement_token
string

A settlement token reference (see whoami response structure) representing the merchant/bank processor configuration that should be used for transaction settlement.

attributes
object

array of key pair items.

order_items
Array of objects (OrderItem)
transactions
Array of objects (OrderTransaction)

Responses

201

Created, a JSON showing Order, OrderItems

401

Unauthorized

412

Precondition Failed

post /api/imports/order

Production

https://secure.versapay.com/api/imports/order

UAT

https://uat.versapay.com/api/imports/order

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "watermark": 1,
  • "identifier": "ABCDF",
  • "number": "sh763-h3454-dh3432",
  • "amount_cents": 20000,
  • "currency": "cad",
  • "date": "2020-11-01",
  • "shipping_name": "Acme Inc.",
  • "shipping_address": "123 First Lane",
  • "shipping_address2": "Suite 600",
  • "shipping_city": "New York",
  • "shipping_state_province": "NY",
  • "shipping_country": "USA",
  • "shipping_email": "acme@gmail.com",
  • "shipping_telephone": "555-555-5555",
  • "shipping_postalcode": "90210",
  • "billing_name": "Acme Inc.",
  • "billing_address": "123 First Lane",
  • "billing_address2": "Suite 600",
  • "billing_city": "New York",
  • "billing_state_province": "NY",
  • "billing_country": "USA",
  • "billing_email": "acme@gmail.com",
  • "billing_telephone": "555-555-5555",
  • "billing_postalcode": "90210",
  • "order_att1": "att1value1",
  • "order_att2": "att1value2",
  • "customer_identifier": "123",
  • "draft": false,
  • "order_items":
    [
    ],
  • "transactions": [ ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "1 order 1 order item(s)",
  • "identifier": "ABCD",
  • "order":
    {
    }
}

Update an order

Updates an order identified by its "identifier".

The set of attributes to send in the request body may vary based on the account configuration. Please contact the implementation specialist for more information.

Request Body schema: application/json

Order.

watermark
integer <int64> (Watermark)
identifier
string

order identifier, this may be imported or if not provided it will be generated by cds

number
string

Order number, may be unique within supplier., supplied by client.

currency
string

Currency code, based on ISO-4217. E.g. CAD, USD, AUD

amount_cents
integer

amount of order in cents.

date
string

order date

billing_name
string

The billing addressee

billing_address
string

The first line of the billing street address

billing_address2
string

The second line of the billing street address

billing_city
string

The billing city

billing_country
string

The 3-character alphabetic ISO billing country code

billing_email
string

The billing email address associated with the addressee

billing_telephone
string

The billing phone number associated with the addressee

billing_postalcode
string

The billing post code or ZIP code

billing_state_province
string

The billing state or province

shipping_name
string

The shipping addressee

shipping_address
string

The first line of the shipping street address

shipping_address2
string

The second line of the shipping street address

shipping_city
string

The shipping city

shipping_country
string

The 3-character alphabetic ISO shipping country code

shipping_email
string

The shipping email address associated with the addressee

shipping_telephone
string

The shipping phone number associated with the addressee

shipping_postalcode
string

The shipping post code or ZIP code

shipping_state_province
string

The shipping state or province

customer_identifier
string

customer identifier, if it was imported

draft
boolean

if true order is a draft else can be published

settlement_token
string

A settlement token reference (see whoami response structure) representing the merchant/bank processor configuration that should be used for transaction settlement.

attributes
object

array of key pair items.

order_items
Array of objects (OrderItem)
transactions
Array of objects (OrderTransaction)

Responses

201

Created, a JSON showing Order, OrderItems

401

Unauthorized

412

Precondition Failed

patch /api/imports/order

Production

https://secure.versapay.com/api/imports/order

UAT

https://uat.versapay.com/api/imports/order

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "watermark": 1,
  • "identifier": "ABCDF",
  • "number": "sh763-h3454-dh3432",
  • "amount_cents": 20000,
  • "currency": "cad",
  • "date": "2020-11-01",
  • "shipping_name": "Acme Inc.",
  • "shipping_address": "123 First Lane",
  • "shipping_address2": "Suite 600",
  • "shipping_city": "New York",
  • "shipping_state_province": "NY",
  • "shipping_country": "USA",
  • "shipping_email": "acme@gmail.com",
  • "shipping_telephone": "555-555-5555",
  • "shipping_postalcode": "90210",
  • "billing_name": "Acme Inc.",
  • "billing_address": "123 First Lane",
  • "billing_address2": "Suite 600",
  • "billing_city": "New York",
  • "billing_state_province": "NY",
  • "billing_country": "USA",
  • "billing_email": "acme@gmail.com",
  • "billing_telephone": "555-555-5555",
  • "billing_postalcode": "90210",
  • "order_att1": "att1value1",
  • "order_att2": "att1value2",
  • "customer_identifier": "123",
  • "draft": false,
  • "order_items":
    [
    ],
  • "transactions": [ ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "1 order 1 order item(s)",
  • "identifier": "ABCD",
  • "order":
    {
    }
}

Export Orders

Orders that have been created since watermark, limited to 100 records at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for subsequent calls.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/orders

Production

https://secure.versapay.com/api/exports/orders

UAT

https://uat.versapay.com/api/exports/orders

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "orders":
    {
    }
}

Export Orders Published

Orders that have been published (excluding draft orders) since watermark, limited to 100 records at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for subsequent calls.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

options[extended_attributes]
string

When this option (options[extended_attributes][key1]=value1) is present, e.g options[extended_attributes][ecommerce_indicator]=true then only published matching('ecommerce_indicator=true') orders are returned in the result.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/orders/published

Production

https://secure.versapay.com/api/exports/orders/published

UAT

https://uat.versapay.com/api/exports/orders/published

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "orders":
    {
    }
}

Export/View an Order

View an order and its item details.

The path parameter identifier is matched to the order's identifier.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/order/{identifier}

Production

https://secure.versapay.com/api/exports/order/{identifier}

UAT

https://uat.versapay.com/api/exports/order/{identifier}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "watermark": 1,
  • "identifier": "ABCDF",
  • "number": "sh763-h3454-dh3432",
  • "amount_cents": 20000,
  • "currency": "cad",
  • "date": "2020-11-01",
  • "shipping_name": "Acme Inc.",
  • "shipping_address": "123 First Lane",
  • "shipping_address2": "Suite 600",
  • "shipping_city": "New York",
  • "shipping_state_province": "NY",
  • "shipping_country": "USA",
  • "shipping_email": "acme@gmail.com",
  • "shipping_telephone": "555-555-5555",
  • "shipping_postalcode": "90210",
  • "billing_name": "Acme Inc.",
  • "billing_address": "123 First Lane",
  • "billing_address2": "Suite 600",
  • "billing_city": "New York",
  • "billing_state_province": "NY",
  • "billing_country": "USA",
  • "billing_email": "acme@gmail.com",
  • "billing_telephone": "555-555-5555",
  • "billing_postalcode": "90210",
  • "order_att1": "att1value1",
  • "order_att2": "att1value2",
  • "customer_identifier": "123",
  • "draft": false,
  • "order_items":
    [
    ],
  • "transactions": [ ]
}

Order Transactions

Order-based card/ACH and card present EMV payment transactions include verify, authorize, capture, sale, void, return refund, and return credit transaction types. If participating in a gift card program, gift cards can be used in sale, void, refund transaction types. Contact support@versapay.com for support & setup for Order Transactions enablement.

Credit Card Payments

There are two types of credit card payments: sale and delayed capture. Sale payments occur when the merchant wishes to accept a payment for goods or services that have already been shipped or provided to the cardholder. A sale is a financial transaction, and the movement of funds will be initiated in response to a sale request. Delayed capture payments are used when there is a separation between accepting an order and fulfilling that order. With delayed capture, the credit card is first authorized for the estimated order total. The authorization reserves funds on the cardholder’s account for the merchant but does not initiate a movement of funds. Once the products or services are ready to be delivered to the cardholder, the authorization is captured for the final amount. The capture request initiates the movement of funds.

ACH Payments

ACH payments are bank-to-bank transfers of funds. Unlike credit card payments, ACH payments only have one type – sale, and there is no prior authorization. Therefore, sale amounts are final and cannot be adjusted after the fact. ACH payments assume success, and if there is a problem with the funding source, like with a bounced paper check, the originator will be notified of a rejection several days after the payment attempt.

Gift Card Payments

Provisioned gift cards can be activated/enabled (or deactivated/disabled) as well as have their balances loaded/re-loaded with an amount. Contact support@versapay.com for support & setup for Gift Card acceptance.

Point-of-Sale/Card Present EMV Payments

Card Present EMV payment transactions require a Versapay certified point-of-sale terminal. In addition to the card not present transaction types, the following payment transaction types are also supported: device setup, request signature, and cancel. Contact support@versapay.com for support & setup for POS/CP EMV enablement.

Verify transaction

A Verify transaction serves two purposes. First, it attempts to validate the provided credit card or bank account information. In the case of credit card Verify transactions, the gateway will run a verification transaction to allow the card issuer to confirm that the account is in good standing and that the provided billing address and card verification value (CVV) is correct. In the case of bank accounts, the gateway may attempt to use a negative database of known bad bank accounts or use other fraud protection tools to confirm the validity of the bank account. Second, the Verify transaction returns a token that is safe for the payment application to store and can be used for future transactions without needing to provide the sensitive account information (this effectively equates to having built a Wallet, see the Wallet API section).

Request Body schema: application/json
order
object

An order object or a token reference to an existing order

contact
object (WalletContact)

Billing contact

fund_token
string

A token reference to an existing fund (either credit card or bank account)

fee_exempt
boolean

True indicates that any fee related surcharging should be ignored even if the underlying merchant account is configured as such, false inherits any configured fee related behaviour

transaction_reference
string Nullable

Extra useful data to help link transactions to other systems e.g. PO numbers, account numbers etc.

device
string

Optional device name depending on gateway boarding & configuration

industry
string
Enum: "directmarketing" "ecommerce" "lodging" "restaurant" "autorental" "retail"

Optional, if not provided defaults to value specified in gateway/account configuration

sec_code
string
Enum: "CCD" "PPD" "WEB" "POP" "TEL"

Optional, for ACH bank transactions, standard entry class code (if not provided defaults to value specified on payment acceptance config; otherwise defaults to PPD if transaction from bank account check_type is personal & CCD if check_type is business)

credit_card
object (WalletCreditCard)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccount)

Alternative to fund_token, a bank account object or token reference to an existing credit card

gift_card
object

Alternative to fund_token, a gift card

Responses

200

200 response

500

500 error response

post /api/gateway/v1/orders/verify

Production

https://secure.versapay.com/api/gateway/v1/orders/verify

UAT

https://uat.versapay.com/api/gateway/v1/orders/verify

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "order": "3SLSC9HX3AHB",
  • "amount_cents": 4200,
  • "fund_token": "CC98U7LI8H91"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "transaction": "1TQ7L54E5L9R",
  • "order": "53HP8ILUK3E8",
  • "wallet": "2JN6JSR7IBML",
  • "credit_card": "CC9DIRFZE61U",
  • "transactions":
    [
    ]
}

Sale/Purchase transaction

A Sale transaction is a request to initiate the transfer of funds from the buyer to the supplier. For credit card payments, the gateway will first authorize the transaction before adding the transaction to the settlement batch for capture at the end of the processing day. For ACH payments, the gateway will accept the sale request and add the transaction to the batch.

Request Body schema: application/json
order
object

An order object or a token reference to an existing order

contact
object (WalletContact)

Billing contact

fund_token
string

A token reference to an existing fund (either credit card or bank account)

fee_exempt
boolean

True indicates that any fee related surcharging should be ignored even if the underlying merchant account is configured as such, false inherits any configured fee related behaviour

transaction_reference
string Nullable

Extra useful data to help link transactions to other systems e.g. PO numbers, account numbers etc.

device
string

Optional device name depending on gateway boarding & configuration

industry
string
Enum: "directmarketing" "ecommerce" "lodging" "restaurant" "autorental" "retail"

Optional, if not provided defaults to value specified in gateway/account configuration

sec_code
string
Enum: "CCD" "PPD" "WEB" "POP" "TEL"

Optional, for ACH bank transactions, standard entry class code (if not provided defaults to value specified on payment acceptance config; otherwise defaults to PPD if transaction from bank account check_type is personal & CCD if check_type is business)

credit_card
object (WalletCreditCard)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccount)

Alternative to fund_token, a bank account object or token reference to an existing credit card

gift_card
object

Alternative to fund_token, a gift card

Responses

200

200 response

500

500 error response

post /api/gateway/v1/orders/sale

Production

https://secure.versapay.com/api/gateway/v1/orders/sale

UAT

https://uat.versapay.com/api/gateway/v1/orders/sale

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "order": "3SLSC9HX3AHB",
  • "amount_cents": 4200,
  • "fund_token": "CC98U7LI8H91"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "transaction": "1TQ7L54E5L9R",
  • "order": "53HP8ILUK3E8",
  • "wallet": "2JN6JSR7IBML",
  • "credit_card": "CC9DIRFZE61U",
  • "transactions":
    [
    ]
}

Return Credit transaction (unlinked return/refund)

A Credit transaction is a request to initiate the transfer of funds from the supplier back to the buyer and is the opposite of a sale. For credit card payments, the gateway will first authorize the return transaction before adding the transaction to the settlement batch for transmission at the end of the processing day. For ACH payments, the gateway will accept the credit request and add the transaction to the batch.

Request Body schema: application/json
order
object

An order object or a token reference to an existing order

contact
object (WalletContact)

Billing contact

fund_token
string

A token reference to an existing fund (either credit card or bank account)

fee_exempt
boolean

True indicates that any fee related surcharging should be ignored even if the underlying merchant account is configured as such, false inherits any configured fee related behaviour

transaction_reference
string Nullable

Extra useful data to help link transactions to other systems e.g. PO numbers, account numbers etc.

device
string

Optional device name depending on gateway boarding & configuration

industry
string
Enum: "directmarketing" "ecommerce" "lodging" "restaurant" "autorental" "retail"

Optional, if not provided defaults to value specified in gateway/account configuration

sec_code
string
Enum: "CCD" "PPD" "WEB" "POP" "TEL"

Optional, for ACH bank transactions, standard entry class code (if not provided defaults to value specified on payment acceptance config; otherwise defaults to PPD if transaction from bank account check_type is personal & CCD if check_type is business)

credit_card
object (WalletCreditCard)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccount)

Alternative to fund_token, a bank account object or token reference to an existing credit card

gift_card
object

Alternative to fund_token, a gift card

Responses

200

200 response

500

500 error response

post /api/gateway/v1/orders/credit

Production

https://secure.versapay.com/api/gateway/v1/orders/credit

UAT

https://uat.versapay.com/api/gateway/v1/orders/credit

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "order": "3SLSC9HX3AHB",
  • "amount_cents": 4200,
  • "fund_token": "CC98U7LI8H91"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "transaction": "1TQ7L54E5L9R",
  • "order": "53HP8ILUK3E8",
  • "wallet": "2JN6JSR7IBML",
  • "credit_card": "CC9DIRFZE61U",
  • "transactions":
    [
    ]
}

Authorization transaction

An Authorize transaction is a non-financial transaction and is used to reserve funds on a buyer’s credit card account. An authorization should be used in scenarios when there will be a delay between taking the order and when the goods or services being purchased will be shipped or delivered to the buyer. In order to collect the funds reserved by an authorization, a subsequent capture request is required. Authorizations, if not captured or voided, will automatically be released by the card issuer in anywhere from two to fourteen days.

Request Body schema: application/json
order
object

An order object or a token reference to an existing order

contact
object (WalletContact)

Billing contact

fund_token
string

A token reference to an existing fund (either credit card or bank account)

fee_exempt
boolean

True indicates that any fee related surcharging should be ignored even if the underlying merchant account is configured as such, false inherits any configured fee related behaviour

transaction_reference
string Nullable

Extra useful data to help link transactions to other systems e.g. PO numbers, account numbers etc.

device
string

Optional device name depending on gateway boarding & configuration

industry
string
Enum: "directmarketing" "ecommerce" "lodging" "restaurant" "autorental" "retail"

Optional, if not provided defaults to value specified in gateway/account configuration

sec_code
string
Enum: "CCD" "PPD" "WEB" "POP" "TEL"

Optional, for ACH bank transactions, standard entry class code (if not provided defaults to value specified on payment acceptance config; otherwise defaults to PPD if transaction from bank account check_type is personal & CCD if check_type is business)

credit_card
object (WalletCreditCard)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccount)

Alternative to fund_token, a bank account object or token reference to an existing credit card

gift_card
object

Alternative to fund_token, a gift card

Responses

200

200 response

500

500 error response

post /api/gateway/v1/orders/auth

Production

https://secure.versapay.com/api/gateway/v1/orders/auth

UAT

https://uat.versapay.com/api/gateway/v1/orders/auth

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "order": "3SLSC9HX3AHB",
  • "amount_cents": 4200,
  • "fund_token": "CC98U7LI8H91"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "transaction": "1TQ7L54E5L9R",
  • "order": "53HP8ILUK3E8",
  • "wallet": "2JN6JSR7IBML",
  • "credit_card": "CC9DIRFZE61U",
  • "transactions":
    [
    ]
}

Capture transaction

A Capture transaction initiates the transfer of funds reserved by a prior authorization. When the gateway receives the capture request, it adds the capture to the settlement batch for transmission to the payment processing platform at the end of the processing day.

Request Body schema: application/json
order
object

An order object or a token reference to an existing order

contact
object (WalletContact)

Billing contact

fund_token
string

A token reference to an existing fund (either credit card or bank account)

fee_exempt
boolean

True indicates that any fee related surcharging should be ignored even if the underlying merchant account is configured as such, false inherits any configured fee related behaviour

transaction_reference
string Nullable

Extra useful data to help link transactions to other systems e.g. PO numbers, account numbers etc.

device
string

Optional device name depending on gateway boarding & configuration

industry
string
Enum: "directmarketing" "ecommerce" "lodging" "restaurant" "autorental" "retail"

Optional, if not provided defaults to value specified in gateway/account configuration

sec_code
string
Enum: "CCD" "PPD" "WEB" "POP" "TEL"

Optional, for ACH bank transactions, standard entry class code (if not provided defaults to value specified on payment acceptance config; otherwise defaults to PPD if transaction from bank account check_type is personal & CCD if check_type is business)

credit_card
object (WalletCreditCard)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccount)

Alternative to fund_token, a bank account object or token reference to an existing credit card

gift_card
object

Alternative to fund_token, a gift card

Responses

200

200 response

500

500 error response

post /api/gateway/v1/orders/capture

Production

https://secure.versapay.com/api/gateway/v1/orders/capture

UAT

https://uat.versapay.com/api/gateway/v1/orders/capture

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "amount_cents": 4200,
  • "transaction": "9HWLBLWXXPRX"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "transaction": "1TQ7L54E5L9R",
  • "order": "53HP8ILUK3E8",
  • "wallet": "2JN6JSR7IBML",
  • "credit_card": "CC9DIRFZE61U",
  • "transactions":
    [
    ]
}

Return refund transaction (linked return/refund)

A Refund transaction is a request to initiate the transfer of funds from the supplier back to the buyer and is based on a prior sale or capture transaction. For credit card payments, the gateway will first authorize the return transaction before adding the transaction to the settlement batch for transmission at the end of the processing day. For ACH payments, the gateway will accept the refund request and add the transaction to the batch.

Request Body schema: application/json
order
object

An order object or a token reference to an existing order

contact
object (WalletContact)

Billing contact

fund_token
string

A token reference to an existing fund (either credit card or bank account)

fee_exempt
boolean

True indicates that any fee related surcharging should be ignored even if the underlying merchant account is configured as such, false inherits any configured fee related behaviour

transaction_reference
string Nullable

Extra useful data to help link transactions to other systems e.g. PO numbers, account numbers etc.

device
string

Optional device name depending on gateway boarding & configuration

industry
string
Enum: "directmarketing" "ecommerce" "lodging" "restaurant" "autorental" "retail"

Optional, if not provided defaults to value specified in gateway/account configuration

sec_code
string
Enum: "CCD" "PPD" "WEB" "POP" "TEL"

Optional, for ACH bank transactions, standard entry class code (if not provided defaults to value specified on payment acceptance config; otherwise defaults to PPD if transaction from bank account check_type is personal & CCD if check_type is business)

credit_card
object (WalletCreditCard)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccount)

Alternative to fund_token, a bank account object or token reference to an existing credit card

gift_card
object

Alternative to fund_token, a gift card

Responses

200

200 response

500

500 error response

post /api/gateway/v1/orders/refund

Production

https://secure.versapay.com/api/gateway/v1/orders/refund

UAT

https://uat.versapay.com/api/gateway/v1/orders/refund

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "amount_cents": 4200,
  • "transaction": "9HWLBLWXXPRX"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "transaction": "1TQ7L54E5L9R",
  • "order": "53HP8ILUK3E8",
  • "wallet": "2JN6JSR7IBML",
  • "credit_card": "CC9DIRFZE61U",
  • "transactions":
    [
    ]
}

Void transaction (linked return/refund)

A Void transaction reverses the effect of a prior transaction when possible. Financial transactions like sales, captures, credits, and refunds can be voided during the same processing day until the gateway transmits the settlement batch. Once the batch has been transmitted, a void is not possible, and the transaction would need to be reversed using a financial transaction (e.g., a sale would need to be reversed with a refund). Void transactions can also reverse the effect of an authorization, either fully or partially. This is useful if the authorization is no longer needed or if the authorization needs to be captured for a lesser amount.

Request Body schema: application/json
order
object

An order object or a token reference to an existing order

contact
object (WalletContact)

Billing contact

fund_token
string

A token reference to an existing fund (either credit card or bank account)

fee_exempt
boolean

True indicates that any fee related surcharging should be ignored even if the underlying merchant account is configured as such, false inherits any configured fee related behaviour

transaction_reference
string Nullable

Extra useful data to help link transactions to other systems e.g. PO numbers, account numbers etc.

device
string

Optional device name depending on gateway boarding & configuration

industry
string
Enum: "directmarketing" "ecommerce" "lodging" "restaurant" "autorental" "retail"

Optional, if not provided defaults to value specified in gateway/account configuration

sec_code
string
Enum: "CCD" "PPD" "WEB" "POP" "TEL"

Optional, for ACH bank transactions, standard entry class code (if not provided defaults to value specified on payment acceptance config; otherwise defaults to PPD if transaction from bank account check_type is personal & CCD if check_type is business)

credit_card
object (WalletCreditCard)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccount)

Alternative to fund_token, a bank account object or token reference to an existing credit card

gift_card
object

Alternative to fund_token, a gift card

Responses

200

200 response

500

500 error response

post /api/gateway/v1/orders/void

Production

https://secure.versapay.com/api/gateway/v1/orders/void

UAT

https://uat.versapay.com/api/gateway/v1/orders/void

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "amount_cents": 4200,
  • "transaction": "9HWLBLWXXPRX"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "transaction": "1TQ7L54E5L9R",
  • "order": "53HP8ILUK3E8",
  • "wallet": "2JN6JSR7IBML",
  • "credit_card": "CC9DIRFZE61U",
  • "transactions":
    [
    ]
}

Export/View a Transaction

View an order transaction details.

The path parameter reference_or_token is matched to the transaction's token or unique_reference, in that order. Alias/see /api/gateway/v1/transaction/{token_or_reference}

path Parameters
token_or_reference
required
string

The transaction's token or unique_reference.

Responses

200

Successful Operation

401

Unauthorized

404

Not Found

get /api/exports/transaction/{token_or_reference}

Production

https://secure.versapay.com/api/exports/transaction/{token_or_reference}

UAT

https://uat.versapay.com/api/exports/transaction/{token_or_reference}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "1TQ7L54E5L9R",
  • "amount_in_cents": 100,
  • "message": null,
  • "link_url": null,
  • "type": "transaction",
  • "transaction_type": "request_money",
  • "email": "customer+abcmedia@versapay.com",
  • "state": "completed",
  • "transaction_reference": null,
  • "unique_reference": null,
  • "from_account": "avscvv2b Test",
  • "to_account": "ABC Media",
  • "process_on": null,
  • "created_by_user": "zoM2xjrzczmgbbGhfHFh",
  • "auto_withdraw": false,
  • "auto_withdrawal_token": null,
  • "action": "verify",
  • "payment_method": "credit_card",
  • "settlement_token": "MAY7USR7KABC",
  • "currency": "usd",
  • "step_types":
    [
    ],
  • "wallet": "2JN6JSR7IBML",
  • "credit_card": "CC9DIRFZE61U",
  • "authorization_response": "APPROVAL",
  • "avs_response": "A",
  • "cvv_response": "N",
  • "approved_amount_cents": 100,
  • "gateway_response":
    {
    },
  • "orders":
    [
    ],
  • "payments":
    [
    ]
}

Testing Order Transactions

In the uat environment, the following test account numbers can be used provided your account has been setup for payment acceptance. Please contact support@versapay.com for support & setup questions related to payment acceptance.

ACH Bank Account Numbers

Routing Number
122105278 0000000016

Credit Card Numbers

Any future dated expiry month/year for the following:

Brand Number
Visa 4895281000000006
Visa 4264280001234500 (will always decline)
Mastercard 5541032000004422
Discover 6011000990911111
American Express (Amex) 341111597242000

The following CVV values can be used to test CVV reponse codes:

CVV Code Description
123 P Not Processed
234 M Match
345 N No Match
456 S CVV value should be on the card but the merchant has indicated that it is not present
567 U Issuer not certified for CVV processing
6789 (Amex) M Match
1011 (Amex) N No Match
1213 (Amex) P Not Processed
Any other number M Match

The following address values can be used to test AVS reponse codes:

Postal/Zip Address Code Response
80801 234 Elm Street A Address match; zip no match
80802 234 Elm Street G Global non-AVS participant
80803 234 Elm Street N Address and zip do not match
80804 234 Elm Street R System unavailable or timed out
80805 234 Elm Street S Service not supported: Issuer does not support AVS and Visa
80806 234 Elm Street U Unavailable: Address information not verified for domestic transactions
808000000 234 Elm Street W 9-digit zip matches; address does not match
808000000 234 Elm Street X 9-digit zip and address match
80809 234 Elm Street Y 5-digit zip and address match
80810 234 Elm Street Z 5-digit zip matches; address does not match
80815 234 Elm Street I Address information not verified for international transaction
80818 234 Elm Street E AVS service not supported
K1A0A9 234 Elm Street D Zip and address match (International)
L6Y2N4 234 Elm Street M Zip and address match (International)
K0K2T0 234 Elm Street P Zip matches; address not verified because of incompatible formats
Any other zip Any other address Y 5-digit zip and address match

Declines

The number of cents in the transaction amount can trigger a decline response in UAT. If the transaction amount ends in .01 (e.g., $1.01 or $40.01), the transaction will decline. If a void transaction amount ends in .02 (e.g., $1.02 or $40.02), the void transaction will decline.

Gift Cards

Provisioned gift cards can be activated/enabled (or deactivated/disabled) as well as have their balances loaded/re-loaded with an amount. Contact support@versapay.com for support & setup for Gift Card acceptance.

Activate and/or load a gift card balance

Request Body schema: application/json
card_number
string

Gift card number

expiry_month
string

2 digit month

expiry_year
string

4 digit year

pin
string

Gift card pin

activated
boolean
Default: false

If this is true, the gift card is activated.

load_amount_cents
integer

Amount in cents to load/add on to existing gift card balance.

Responses

200

200 response

500

500 error response

post /api/gateway/v1/gift_card

Production

https://secure.versapay.com/api/gateway/v1/gift_card

UAT

https://uat.versapay.com/api/gateway/v1/gift_card

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "card_number": "4775419990420272",
  • "expiry_month": "12",
  • "expiry_year": "2049",
  • "pin": "1234",
  • "activated": true
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "success": true
}

Read a gift card balance

Request Body schema: application/json
card_number
string

Gift card number

expiry_month
string

2 digit month

expiry_year
string

4 digit year

pin
string

Gift card pin

Responses

200

200 response

500

500 error response

post /api/gateway/v1/gift_card/read

Production

https://secure.versapay.com/api/gateway/v1/gift_card/read

UAT

https://uat.versapay.com/api/gateway/v1/gift_card/read

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "card_number": "4775419990420272",
  • "expiry_month": "12",
  • "expiry_year": "2049",
  • "pin": "1234"
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "id": "66",
  • "token": "04bfe04a-80aa-4779-8388-59396afdfdf7",
  • "balance": 777,
  • "activated": false,
  • "created_at": "11/3/2021 12:00:00 AM",
  • "expires_at": "12/1/2049 12:00:00 AM"
}

Card Present EMV

Card Present EMV payment transactions require a Versapay certified point-of-sale terminal. Contact support@versapay.com for support & setup for POS/CP EMV enablement.

Issue a direct command to a POS terminal e.g. DeviceSetup, RequestSignature, Cancel, DeviceStatus

Request Body schema: application/json
laneid
string

Pre-configured lane identifier

command
string
Enum: "DeviceSetup" "RequestSignature" "Cancel" "DeviceStatus"

Supported terminal command

Responses

200

200 response

500

500 error response

post /api/gateway/v1/terminal

Production

https://secure.versapay.com/api/gateway/v1/terminal

UAT

https://uat.versapay.com/api/gateway/v1/terminal

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "laneid": "1",
  • "command": "DeviceSetup"
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "success": true
}

Settlement Reporting

Settlement Reporting includes retrieval of monthly statements, daily deposit amounts (including fee information), transaction exceptions (ACH reject/return & CC chargeback), and transaction details. Contact support@versapay.com for payment acceptance onboarding support & setup and eligibility for Settlement Reporting enablement.

Retrieve Monthly Statements

List of monthly statements added since watermark, limited to 100 (default) at a time.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

sample
boolean
Example: sample=true

Show some sample data

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

mid
string
Example: mid=123456789

account filter by mid or merchant account token.

enddate_from
string
Example: enddate_from=2023-01-01

start date of range filter for the statement period end date (yyyy-mm-dd).

enddate_to
string
Example: enddate_to=2023-06-01

end date of range filter for the statement period end date (yyyy-mm-dd).

Responses

200

Successful Operation

401

Unauthorized

get /api/gateway/v1/settlement/statements

Production

https://secure.versapay.com/api/gateway/v1/settlement/statements

UAT

https://uat.versapay.com/api/gateway/v1/settlement/statements

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "statements":
    {
    }
}

View Monthly Statement PDF

The generated PDF for a specific monthly statement.

path Parameters
statement_identifier
required
string
Example: 2EW5NDMG5347.pdf, 2EW5NDMG5347.json, sample.pdf

Identifier/token of the monthly statement

Responses

200

Successful Operation

401

Unauthorized

get /api/gateway/v1/settlement/statements/{statement_identifier}.{pdf/json}

Production

https://secure.versapay.com/api/gateway/v1/settlement/statements/{statement_identifier}.{pdf/json}

UAT

https://uat.versapay.com/api/gateway/v1/settlement/statements/{statement_identifier}.{pdf/json}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error": "You need to sign in or create an account before continuing."
}

Retrieve Daily Batch Deposits

List of daily batch deposits including fees and transactions.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

Responses

200

Successful Operation

401

Unauthorized

get /api/gateway/v1/settlement/batches

Production

https://secure.versapay.com/api/gateway/v1/settlement/batches

UAT

https://uat.versapay.com/api/gateway/v1/settlement/batches

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "batches":
    [
    ]
}

Retrieve Daily Transaction Exceptions

List of exception transactions including ACH return/reject and CC chargeback.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

Responses

200

Successful Operation

401

Unauthorized

get /api/gateway/v1/settlement/exceptions

Production

https://secure.versapay.com/api/gateway/v1/settlement/exceptions

UAT

https://uat.versapay.com/api/gateway/v1/settlement/exceptions

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "exceptions":
    [
    ]
}

View Transaction Detail

Alias /api/exports/transaction/{token}, see Order Transactions View a Transaction

get /api/gateway/v1/transactions/{token}

Production

https://secure.versapay.com/api/gateway/v1/transactions/{token}

UAT

https://uat.versapay.com/api/gateway/v1/transactions/{token}

View Order Detail

Alias /api/exports/order/{token}, see Orders View an Order

get /api/gateway/v1/orders/{token}

Production

https://secure.versapay.com/api/gateway/v1/orders/{token}

UAT

https://uat.versapay.com/api/gateway/v1/orders/{token}

View Invoicing Payment Detail

Alias /api/exports/payment/{token}, see Invoicing Payments View a Payment

get /api/gateway/v1/payments/{token}

Production

https://secure.versapay.com/api/gateway/v1/payments/{token}

UAT

https://uat.versapay.com/api/gateway/v1/payments/{token}

Wallets

The Wallet entity holds vaulted & secured payment methods owned by a customer (buyer/payor) that can be used to make payments via Collaborative AR (online Portals, AutoPay, Pay Now), Order Transactions (Ecomm & ERP based suppliers), and Invoicing Payments (via Partner buyer networks including Virtual Card Connect). Contact support@versapay.com for support & setup for Wallet access and payment transaction enablement in relation to licensed product components.

Search Accessible Wallets

Accessible wallets can be searched by contact email, customer identifier, fund token, or vault token.

query Parameters
type
required
string
Example: type=email

The type of search email|customer|fund|vault

locator
required
string
Example: locator=salesdemo@versapay.com

The value used for search according to the type.

Responses

200

Successful Operation

401

Unauthorized

get /api/gateway/v1/wallets/search

Production

https://secure.versapay.com/api/gateway/v1/wallets/search

UAT

https://uat.versapay.com/api/gateway/v1/wallets/search

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wallets":
    [
    ]
}

Create Wallet Empty/Payment Method

Create a new wallet (empty) and/or a new wallet with a payment method.

Request Body schema: application/json
customer
object (WalletCustomer)

Invoicing customer reference

contact
object (WalletContact)

Billing contact

credit_card
object (WalletCreditCard)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccount)

Alternative to fund_token, a bank account object or token reference to an existing credit card

Responses

200

200 response

412

Precondition Failed - Wallet related errors

post /api/gateway/v1/wallets

Production

https://secure.versapay.com/api/gateway/v1/wallets

UAT

https://uat.versapay.com/api/gateway/v1/wallets

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{ }

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "wallet_token": "5EJQM2RL4K2G",
  • "fund_token": null,
  • "wallets":
    [
    ]
}

View Wallet

View specific wallet given its wallet identifier/token.

path Parameters
wallet_token
required
string
Example: 77A81025AC3A

The wallet identifier/token

Responses

200

200 response

412

Precondition Failed - Wallet related errors

get /api/gateway/v1/wallets/{wallet_token}

Production

https://secure.versapay.com/api/gateway/v1/wallets/{wallet_token}

UAT

https://uat.versapay.com/api/gateway/v1/wallets/{wallet_token}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wallets":
    [
    ]
}

Add Payment Methods to Known Wallet

Add payment methods to a known wallet given its identifier/token.

path Parameters
wallet_token
required
string
Example: 77A81025AC3A

The wallet identifier/token

Request Body schema: application/json
credit_card
object (WalletCreditCard)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccount)

Alternative to fund_token, a bank account object or token reference to an existing credit card

Responses

200

200 response

412

Precondition Failed - Wallet related errors

post /api/gateway/v1/wallets/{wallet_token}/methods

Production

https://secure.versapay.com/api/gateway/v1/wallets/{wallet_token}/methods

UAT

https://uat.versapay.com/api/gateway/v1/wallets/{wallet_token}/methods

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "credit_card":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wallet_token": "string",
  • "fund_token": "string",
  • "wallets":
    [
    ]
}

Update Payment Method in Wallet

Updates a payment method given its wallet and fund identifier/token.

path Parameters
wallet_token
required
string
Example: 77A81025AC3A

The wallet identifier/token

fund_token
required
string
Example: CC98U7LI8H91

The fund identifier/token

Request Body schema: application/json
credit_card
object (WalletCreditCardPatch)

Alternative to fund_token, a credit card object or token reference to an existing credit card

bank_account
object (WalletBankAccountPatch)

Alternative to fund_token, a bank account object or token reference to an existing credit card

Responses

200

200 response

412

Precondition Failed - Wallet payment method related errors

patch /api/gateway/v1/wallets/{wallet_token}/methods/{fund_token}

Production

https://secure.versapay.com/api/gateway/v1/wallets/{wallet_token}/methods/{fund_token}

UAT

https://uat.versapay.com/api/gateway/v1/wallets/{wallet_token}/methods/{fund_token}

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "credit_card":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "fund_token": "CC98U7LI8H91"
}

Remove Payment Method From Wallet

Removes a payment method from wallet given given its wallet and fund identifier/token.

path Parameters
wallet_token
required
string
Example: 77A81025AC3A

The wallet identifier/token

fund_token
required
string
Example: CC98U7LI8H91

The fund identifier/token

Responses

200

200 response

412

Precondition Failed - Wallet payment method related errors

delete /api/gateway/v1/wallets/{wallet_token}/methods/{fund_token}

Production

https://secure.versapay.com/api/gateway/v1/wallets/{wallet_token}/methods/{fund_token}

UAT

https://uat.versapay.com/api/gateway/v1/wallets/{wallet_token}/methods/{fund_token}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "fund_token": "CC98U7LI8H91"
}

Export Wallets

Payments made to your supplier account from your customers since watermark, limited to 100 payments at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for a subsequent calls.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/wallets

Production

https://secure.versapay.com/api/exports/wallets

UAT

https://uat.versapay.com/api/exports/wallets

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wallets":
    {
    }
}

Export Wallets Recently Updated

Payment records that have been updated in the past 7 days, since watermark, limited to 100 records at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for subsequent calls.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

get /api/exports/wallets/recent

Production

https://secure.versapay.com/api/exports/wallets/recent

UAT

https://uat.versapay.com/api/exports/wallets/recent

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wallets":
    {
    }
}

Customers

As a supplier your customers are the entities that are invoiced.

Webhooks

When using Webhooks, your application will be notified when key events are triggered for a customer.

Create and Update Customer

Create a customer using the following attributes (at minimum by providing values for required attributes). If providing an identifier for an existing customer, its information is updated.

Note: Any additional non-standard attribute will be stored with customer record and available for presentment rendering.

Request Body schema: application/json
identifier
required
string

Customer number, must be unique within supplier. Alphanumeric.

name
required
string

Customer name.

email
string <email>

Email address of the default contact.

first_name
string

First name of the default contact.

last_name
string

Last name of the default contact.

notes
string

Optional text field up to 64K.

address_1
string

Billing address line 1.

address_2
string

Billing address line 2.

city
string

Billing address - city.

province
string

Billing address - state or province.

postal_code
string

Billing address - zip or postal code.

country
string

Billing address - country.

telephone
string

Customer phone number.

fax
string

Customer fax number.

url
string <uri>

Customer web site.

business_number
string

Customer EIN or Business Number. 20-character alphanumeric.

locale
string
Enum: "en" "fr" "es"

Customer language, based on ISO 639-1 standard.

parent_identifier
string

Required if the customer is part of a hierarchy, and this customer has a level (parent) above it. This is the identifier of the customer immediately above this customer in the tree.

pdf_attachment_opt_in
boolean
Default: false

If true, the customer will receive PDFs of invoices and attachments with all invoice notifications.

account_status
string
Default: "open"
Enum: "open" "closed"

The status of the customer's account with the supplier.

last_contact_date
string <date>

The last time the customer was contacted. It is ignored if the customer already has a last contact date and it is more recent than this one.

next_contact_date
string <date>

The date of the next planned contact with the customer. This always overwrites what is on the customer.

credit_limit_cents
integer

The customer's credit limit. This is the maximum value of outstanding invoices before the supplier is alerted, if supplier is configured to monitor this. If the customer is a multi-currency customer, this is the total credit limit converted to a single currency (see next field.)

credit_limit_currency
string

Currency of the credit limit. If blank, defaults to the currency of the majority of the customer's invoices. If there are no invoices, defaults to the supplier’s default currency.

credit_rating
string

Credit rating for the customer.

terms_type
string
Enum: "date" "day"

This field and terms_value specify how to set a customer's due date.

terms_value
integer

This field and terms_type specify how to set a customer's invoice due date.

If terms_type is 'day':

  • It means the due date should be days after invoice date.
  • E.g. if terms_value is 30, the due date must be 30 days after the invoice date.
  • It must be a whole number between 0 and 100.

If terms_type is 'date':

  • It means the due date is on a fixed day (terms_value) of the month.
  • E.g. if terms_value is 15, it means the due date should be on the 15th of the month after invoice date.
  • It must be an integer between 1 and 27 inclusive, or -1 to specify the last day of the month, or -2 to specify the second-last day of the month.
company_bio
string

Short description of products and services that the customer offers.

ignores_cc_payment_rules
boolean
Default: false

If this is true, it means that the customer is not subject to any credit card payment rules, and is free to use credit cards any time.

notification_suppressed
boolean
Default: false

If this is true, all notifications to the customer are suppressed.

tags
string

One or more tags separated by semi-colons.

external_id
string

External (ERP-based) identifier for the customer record.

external_group_identifier
string

External (ERP-based) identifier used to control customer grouping.

If the supplier is configured for restricted grouping, the system will not permit a user to group customers together that have different values for external_group_identifier.

If the supplier is not configured for restricted grouping, this value is saved but ignored.

replace_contacts
boolean
Default: false

When true for a customer that is re-imported any contacts in the payload that are also in the DB will be updated if they are not signed-up users, and any contacts in the DB that were created by the supplier and are not in the payload will be deleted if not signed up, otherwise they will be disabled.

line_item_attributes
Array of objects (Contact)

Responses

201

Created

401

Unauthorized

412

Precondition Failed

post /api/imports/customer

Production

https://secure.versapay.com/api/imports/customer

UAT

https://uat.versapay.com/api/imports/customer

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "identifier": "C1234",
  • "name": "Acme Inc.",
  • "email": "bob.smith@example.com",
  • "first_name": "Bob",
  • "last_name": "Smith",
  • "notes": "Payment terms will be revised next year.",
  • "address_1": "200 Main Street",
  • "address_2": "Suite 250",
  • "city": "Toronto",
  • "province": "ON",
  • "postal_code": "M5M 5M5",
  • "country": "CA",
  • "telephone": "(416) 123-4567",
  • "fax": "(416) 100-1020",
  • "url": "www.acmeinc.com",
  • "business_number": "GS324587987",
  • "locale": "en",
  • "parent_identifier": "P3212",
  • "pdf_attachment_opt_in": false,
  • "account_status": "open",
  • "last_contact_date": "2017-12-04",
  • "next_contact_date": "2018-02-15",
  • "credit_limit_cents": "2000000",
  • "credit_limit_currency": "CAD",
  • "credit_rating": "AA",
  • "terms_type": "date",
  • "terms_value": 15,
  • "company_bio": "Acme Inc. sells cutting-edge widgets.",
  • "ignores_cc_payment_rules": "false",
  • "notification_suppressed": "false",
  • "tags": "Blue;Green;Yellow",
  • "external_id": "string",
  • "external_group_identifier": "string",
  • "replace_contacts": false,
  • "line_item_attributes":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "identifier": "C1234",
  • "message": "1 customer with 3 contacts"
}

Export/View a Customer

View a customer based on the identifier provided.

path Parameters
identifier
required
string

identifier of the customer record.

Responses

200

Successful Operation

401

Unauthorized

404

Not Found

get /api/exports/customer/{identifier}

Production

https://secure.versapay.com/api/exports/customer/{identifier}

UAT

https://uat.versapay.com/api/exports/customer/{identifier}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "identifier": "163627",
  • "name": "21st Century Media",
  • "business_number": "",
  • "first_name": "",
  • "last_name": "",
  • "email": "customer+21st@versapay.com",
  • "address_1": "",
  • "address_2": "",
  • "postal_code": "",
  • "city": "",
  • "province": "",
  • "country": "",
  • "telephone": "",
  • "fax": "",
  • "status": "Signed Up",
  • "auto_debit": "N",
  • "invite_sent": "2016-03-29",
  • "signed_up": "2016-03-29",
  • "notification_suppressed": "N",
  • "notification_override": "N",
  • "paper_invoices": "N",
  • "paper_statements": "N",
  • "balance": "$26,185.00",
  • "credit": "$0.00",
  • "current": "$0.00",
  • "unapplied_payment": "$0.00",
  • "aging": "$26,185.00",
  • "aging_30": "$0.00",
  • "aging_60": "$0.00",
  • "aging_90": "$0.00",
  • "aging_older": "$26,185.00",
  • "notes": "",
  • "parent_identifier": "161803",
  • "parent_name": "Digital First Media",
  • "parent_email": "customer+dfm@versapay.com",
  • "adp": "",
  • "adp_arc": "",
  • "adp_external": "",
  • "last_contact_date": "",
  • "next_contact_date": "",
  • "credit_limit": "$0.00",
  • "oldest_open_invoice": "5557488",
  • "oldest_open_invoice_age": "1726",
  • "oldest_open_invoice_balance": "$1,325.00",
  • "last_payment_date": "",
  • "last_payment_amount": "$0.00",
  • "last_payment_source": "",
  • "account_status": "open",
  • "tags": "",
  • "user_tags": "A+ Customer;Tester A;91+ $2500+ Test Tag",
  • "divisions_names": "",
  • "divisions_codes": "",
  • "group_id": "",
  • "external_group_identifier": "",
  • "credit_card_fee_exempt": "N",
  • "auto_update_cc_expiry": "N",
  • "cash_on_delivery": "N",
  • "watermark": 10917589,
  • "contacts":
    [
    ]
}

Export Customers

Customer records that have been created since watermark, limited to 100 records at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for subsequent calls.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/customers

Production

https://secure.versapay.com/api/exports/customers

UAT

https://uat.versapay.com/api/exports/customers

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "customers":
    {
    }
}

Export Customers Recently Updated

Customer records that have been updated in the past 7 days, since watermark, limited to 100 records at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for subsequent calls.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/customers/recent

Production

https://secure.versapay.com/api/exports/customers/recent

UAT

https://uat.versapay.com/api/exports/customers/recent

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "customers":
    {
    }
}

Export Open Invoices for a Customer

Invoice records with an open balance for the customer based on the identifier provided, limited to 100 records at a time.

A consumer should store the last watermark value of each response and include it as the watermark parameter for subsequent calls.

path Parameters
identifier
required
string

identifier of the customer record.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

404

Not Found

412

Precondition Failed

get /api/exports/customer/{identifier}/open_invoices

Production

https://secure.versapay.com/api/exports/customer/{identifier}/open_invoices

UAT

https://uat.versapay.com/api/exports/customer/{identifier}/open_invoices

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "open_invoices":
    [
    ]
}

Issue an invitation

Issue a new contact invitation for the specified customer. The recipient of the invitation will begin to receive other Collaborative AR notifications, subject to the configuration of the supplier.

Note: If the provided email is not an existing contact of the specified customer, a new contact will be created.

Request Body schema: application/json
identifier
required
string

the identifier of the customer to invite the contact to

email
required
string

Contact email address.

Responses

200

Successfully Invited

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

post /api/invitations

Production

https://secure.versapay.com/api/invitations

UAT

https://uat.versapay.com/api/invitations

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "identifier": "CUS001",
  • "email": "bob.smith@example.com"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Cancel an invitation

Cancel an existing contact invitation for the specified customer.

Note: 403 will be returned if the specified customer is closed, or if the specified email was invited by a customer user

Request Body schema: application/json
identifier
required
string

the identifier of the customer to cancel the invitation for

email
required
string

Contact email address.

Responses

200

Invitation Successfully Cancelled

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

delete /api/invitations

Production

https://secure.versapay.com/api/invitations

UAT

https://uat.versapay.com/api/invitations

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "identifier": "CUS001",
  • "email": "bob.smith@example.com"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Update Customer Identifier

Update a customer's identifier and any associations where identifier is being stored.

Note: 412 will be returned if the specified customer cannot be found or the identifier has already been taken.

path Parameters
identifier
required
string

identifier of the customer to be updated.

Request Body schema: application/json
new_identifier
required
string

Customer's new identifier to be used. Must be unique within supplier.

Responses

200

Customer Successfully Updated.

412

Precondition failed.

post /api/imports/customers/{identifier}/update_identifier

Production

https://secure.versapay.com/api/imports/customers/{identifier}/update_identifier

UAT

https://uat.versapay.com/api/imports/customers/{identifier}/update_identifier

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "new_identifier": "CUS-1001"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "customer identifier updated",
  • "identifier": "CUS-1001"
}

Invoices

As a supplier invoices are your receivables.

Webhooks

When using Webhooks, your application will be notified when key events are triggered for an invoice.

Create and Update Invoice

Create and update invoices. If the invoice already exists when a request is processed, it will be updated. If attachment is provided, will include the document in the invoice.

The set of attributes to send in the request body may vary based on the account configuration. Please contact the implementation specialist for more information.

Note:

  • Customer will be created/updated using the customer_* attributes if necessary at time of invoice import.
  • Any additional non-standard attribute will be stored with invoice record and available for presentment rendering.
Request Body schema: application/json
number
required
string

Invoice number, must be unique within supplier.

display_number
string

Invoice number as displayed to customers. Optional if this is the same as number.

currency
string

Currency code, based on ISO-4217. E.g. CAD, USD, AUD

amount
integer

The invoice amount in cents.

replace_line_items
boolean

When provided and True, line items in the DB that are not in the input file will be deleted.

amount_override
boolean

When provided and True, the amount provided in an update import will overwrite the amount that would normally be calculated from line items.

attachment
object

When provided, it uses the provided inline pdf (as base64) as the invoice template/rendering.

subtotal_tax1
integer

Tax amount in cents.

subtotal_tax2
integer

Additional field to carry tax amount (in cents). For example, when invoice shows state (provincial) and federal taxes.

customer_identifier
required
string

Unique identifier for customer.

date
string <date>

Invoice date, YYYY-MM-DD, based on ISO-8601.

order_date
string <date>

Order date, YYYY-MM-DD.

due_date
string <date>

Invoice due date, YYYY-MM-DD.

purchase_order_number
string

Purchase order number.

notes_text
string

Optional text field up to 64K.

shipping_name
string

Shipping address: recipient name

shipping_address_1
string

Shipping address: line 1

shipping_address_2
string

Shipping address: line 2

shipping_city
string

Shipping address: city

shipping_province
string

Shipping address: state or province. Based on the second part (after hyphen) of codes in ISO 3166-2 standard. E.g. "ON" for Ontario, "CA" for California

shipping_postal_code
string

Shipping address: zip or postal code

shipping_country
string

Shipping address: country

line_item_attributes
Array of objects (LineItem)

Details of each line-item for the invoice. Any additional non-standard attribute will be stored with the line-item record and available for presentment rendering.

auto_debit
string
Enum: "Y" "N"

Explicitly states whether an invoice, having an owing/open balance, Y would be auto-paid via its customer pre-authorized agreement or N to be paid manually by customer. With integrations managing daily invoice synchronization, this attribute is normally excluded altogether - unless explicitly intending to mark N for manual customer payment consideration - since the Collaborative AR platform may also manage this invoice flag in conjunction with customer AutoPay profile settings. For more information contact support@versapay.com

division
string

Division Code. Required only if supplier supports divisions.

If supplier supports divisions and is configured for dynamic division creation, this value is used to create a new division if one does not already exist.

division_name
string

Division Name. Optional value. Relevant only if supplier supports divisions and is configured for dynamic division creation, otherwise ignored.

This value is assigned to the name of a newly created division. Existing divisions will not be updated by this value.

auto_debit_reference
string

For AutoPay agreements that reference a policy# or contract#, etc., specify that number.

owing_cents
integer

Balance remaining on this invoice or credit memo.

Required if supplier is configured for Balance Sync, otherwise ignored.

ref1
string

A reference that is meaningful to the customer, e.g. Policy number, contract number, etc.

ref2
string

As above.

ref3
string

As above.

adjustments_attributes
Array of objects

Adjustments such as Fuel Surcharge.

plan_identifier
string

Payment plan template identifier. If populated, this puts the invoice on a payment plan.

Required if supplier is configured for payment plans.

plan_start_date
string <date>

Payment plan start date. Required if supplier is configured for payment plans.

plan_end_date
string <date>

Payment plan end date. Required if supplier is configured for payment plans.

plan_payment_cents
integer

Payment plan recurring payment amount. Required if supplier is configured for payment plans.

annualized_amount_cents
integer

The annual invoice amount. When this is populated, the importer will calculate a pro-rated invoice amount based on the next two dates.

Required if the supplier is configured for payment plans.

annualized_effective_date
string <date>

The date that the annualized_amount takes effect. Mandatory if annualized_amount is populated.

annualized_expiry_date
string <date>

The end date of the period for which the annualized_amount is in effect.

Mandatory if annualized_amount is populated. The difference between this date and the effective date (inclusive) is used to pro-rate the invoice amount or any adjustments to the amount.

external_id
string

Optional external identifier for the invoice to be included in payment exports.

summary_invoice_parent
string

Flag that indicates if the invoice is a summary invoice. Default is 0 (invoice is not a summary invoice).

summary_invoice_number
string

If the invoice in the row is a child of a summary invoice, that summary invoice's identifier appears here.

service_rep_email
string

One or more supplier user email addresses (semi-colon delimited) that will be used for notification routing eg when in dispute each specified rep is notified only.

discount_amount_cents
integer

Amount in cents of already computed discount. Requires supplier discount configuration to be enabled.

discount_rate
float

Floating point rate of discount. For example, .05 represents 5%. The importer will calculate discount_amount_cents based on this field and the invoice amount. Note: if this field is provided, the amount will always be calculated, even if discount_amount_cents is provided. Therefore only include this field if the intention is to have the importer calculate. Requires supplier discount configuration to be enabled.

discount_expiry_date
date

The date by which the discount should expire. Requires supplier discount configuration to be enabled.

echo
string

Optional setting. When set to pay_urls it ensures pay_url and pay_urls are echoed in the response.

Responses

201

Created

401

Unauthorized

412

Precondition Failed

post /api/imports/invoice

Production

https://secure.versapay.com/api/imports/invoice

UAT

https://uat.versapay.com/api/imports/invoice

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "number": "sh763-h3454-dh3432",
  • "display_number": "INV1234",
  • "customer_identifier": "CUS001",
  • "purchase_order_number": "PO-3847",
  • "amount": 40000,
  • "currency": "usd",
  • "date": "2017-11-01",
  • "due_date": "2017-12-15",
  • "notes_text": "Thank you for your business",
  • "shipping_name": "Acme Inc.",
  • "shipping_address_1": "1 Main Street",
  • "shipping_address_2": "Suite 600",
  • "shipping_postal_code": "90210",
  • "shipping_city": "New York",
  • "shipping_province": "NY",
  • "owing_cents": 30000,
  • "discount_amount_cents": 39999,
  • "discount_expiry_date": "2017-11-15",
  • "replace_line_items": false,
  • "amount_override": false,
  • "line_item_attributes":
    [
    ],
  • "echo": "pay_urls"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{}

Export/View an Invoice

View an invoice.

The path parameter number_or_id is matched to the invoice number, display_number or id, in that order.

path Parameters
number_or_id
required
string

number or display_number or id of the invoice record.

options
any

An array of additional options that determine if extra data should be fetched for the invoice

options[payments]
any

When this option is present: ?options[payments]=true then an extra attribute is appended to the payload payments, this payments attribute will contain an array of all the PaymentAmounts associated with the exported invoice. When the supplier is enabled for line_item_short_pay then within the payments array there will be a nested structure of line_item_transactional_amounts containing the information corresponding to each line item that has been short paid.

Responses

200

Successful Operation

401

Unauthorized

404

Not Found

get /api/exports/invoice/{number_or_id}

Production

https://secure.versapay.com/api/exports/invoice/{number_or_id}

UAT

https://uat.versapay.com/api/exports/invoice/{number_or_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "number": "sh763-h3454-dh3432",
  • "display_number": "INV1234",
  • "customer_identifier": "CUS001",
  • "amount_cents": 40000,
  • "owing_cents": 30000,
  • "subtotal_tax1": "$0.00",
  • "subtotal_tax2": "$0.00",
  • "currency": "usd",
  • "date": "2017-11-01",
  • "due_date": "2017-12-15",
  • "order_date": null,
  • "purchase_order_number": "PO-3847",
  • "notes_text": "Thank you for your business",
  • "shipping_name": "Acme Inc.",
  • "shipping_address":
    {
    },
  • "line_item_attributes":
    [
    ],
  • "auto_debit": true,
  • "division": "770",
  • "auto_pay_reference": null,
  • "ref1": null,
  • "ref2": null,
  • "ref3": null,
  • "adjustments_attributes":
    [
    ],
  • "plan_identifier": null,
  • "plan_start_date": null,
  • "plan_end_date": null,
  • "plan_payment_cents": null,
  • "annualized_amount_cents": null,
  • "annualized_effective_date": null,
  • "annualized_expiry_date": null,
  • "external_id": null,
  • "status": "CURRENT",
  • "delivery_status": "not_sent",
  • "extended_attributes":
    {
    },
  • "summary_invoice_parent": 0,
  • "summary_invoice_number": null,
  • "service_rep_email": "john.doe@supplier.com;jane.doe@supplier.com",
  • "payments":
    [
    ]
}

Export Invoices Recently Updated

Invoice records that have been updated in the past 7 days, since watermark, limited to 100 records at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for subsequent calls.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/invoices/recent

Production

https://secure.versapay.com/api/exports/invoices/recent

UAT

https://uat.versapay.com/api/exports/invoices/recent

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "invoices":
    {
    }
}

Export Open Invoices

Invoice records with an open balance, limited to 100 records at a time.

A supplier should store the last watermark value of each response and include it as the watermark parameter for subsequent calls.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/open_invoices

Production

https://secure.versapay.com/api/exports/open_invoices

UAT

https://uat.versapay.com/api/exports/open_invoices

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "invoices":
    {
    }
}

Autopay

Autopays are a digital analog to paper pre-authorized debit agreements that businesses could use, for instance, for monthly billing.

Create an Autopay

Request Body schema: application/json
autopay_reference
Array of strings or string
customer_identifier
required
string

Customer Identifier.

fund_token
required
string

The fund token to be used for autopay.

Responses

201

Created

401

Unauthorized

412

Precondition Failed

post /api/autopay

Production

https://secure.versapay.com/api/autopay

UAT

https://uat.versapay.com/api/autopay

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "autopay_reference":
    [
    ],
  • "customer_identifier": "CUS123",
  • "fund_token": "TOKEN123"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "TOKEN123"
}

Updates an Autopay

Updates a autopay fund

Request Body schema: application/json
customer_identifier
required
string

Customer Identifier.

fund_token
required
string

New token of the required fund.

token
required
string

Old token of the required fund.

Responses

201

Created

401

Unauthorized

412

Precondition Failed

put /api/autopay

Production

https://secure.versapay.com/api/autopay

UAT

https://uat.versapay.com/api/autopay

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "customer_identifier": "CUS123",
  • "fund_token": "NEWTOKEN123",
  • "token": "OLDTOKEN123"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error": "You need to sign in or create an account before continuing."
}

Retrieves Autopays

Gets all the autopay for a customer

Request Body schema: application/json
customer_identifier
required
string

Customer Identifier.

Responses

201

Created

401

Unauthorized

412

Precondition Failed

get /api/autopay

Production

https://secure.versapay.com/api/autopay

UAT

https://uat.versapay.com/api/autopay

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "customer_identifier": "CUS123"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "agreement_token": "TOKEN123",
  • "fund_token": "TOKEN123",
  • "timing": "AutoPay on Due Date",
  • "autopay_limit": "None",
  • "autopay_reference": "TOKEN123",
  • "autopay_inherited_from_customer_identifier": "CUST123",
  • "can_delete": true
}

Revoke an Autopay

Revoke an approved autopay for your account by supplying an agreement's token attribute. The agreement's creator will no longer be able to debit your account using this autopay agreement.

Request Body schema: application/json
customer_identifier
required
string

Customer Identifier.

token
required
string

The token of the autopay agreement.

Responses

200

Successful Operation

post /api/autopay/revoke

Production

https://secure.versapay.com/api/autopay/revoke

UAT

https://uat.versapay.com/api/autopay/revoke

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "customer_identifier": "CUS123",
  • "token": "TOKEN123"
}

Invoicing Payments

As a supplier a payments are made by customers for invoices issued to them.

Webhooks

When using Webhooks, your application will be notified when key events are triggered for a payment.

Create a Payment

Create and update external payments.

The set of attributes to send in the request body may vary based on the account configuration. Please contact the implementation specialist for more information.

The request schema for posting a payment for a single invoice is slightly different than that for posting a payment for multiple invoices.

For instance, sample request for posting payment for a single invoice looks like:

{
  "identifier": "PMT0010-05",
  "invoice_number": "INV1234-01",
  "amount": 10000,
  "currency": "usd",
  "date": "2018-01-10",
  "customer_identifier": "C1234",
  "customer_name": "Acme Inc.",
  "notes": "Notes",
  "ref1": "1234",
  "ref2": "PO# 84767"
}

Note: Customer will be created using the customer_* attributes if it doesn’t already exist at the time of payment import.

Request Body schema: application/json
identifier
required
string

Payment identifier; must be unique within supplier. May appear multiple times in a single file if payment was applied to multiple invoices.

amount_cents
integer

The amount of total payment, in cents.

Note: when providing data in a CSV layout this field can also be represented as payment_total; however, in JSON layout this field must be called amount_cents.

Note 2: For the update of a payment originated in Versapay, only the total payment amount without fees, or the total payment amount with fees will be accepted. Any other value will be rejected.

date
string <date>

Payment date, in the format YYYY-MM-DD.

currency
string

Currency code, based on ISO-4217.

invoice_number
string

Invoice number associated with this payment (if payment covers single invoice). If payment covers multiple invoices, provide payment_amounts_attributes instead.

payment_code
string

Payment code

payment_description
string

Description corresponding to payment code.

payment_amounts_attributes
Array of objects

Applicable only when payment covers multiple invoices.

division
string

Division code, if divisions are set up.

This value will be used for all payment_amounts_attributes that do not specify their own division attribute.

customer_identifier
string

Customer identifier.

customer_name
string

Customer name.

external_payment_type
string

When provided identifies this payment as having been processed externally E.g. cash, check/cheque, wire, ACH, Paypal, etc.

external_payment_number
string

When provided identifies this payment as having been processed externally, its value corresponding to the type above. E.g. the actual cheque number.

payor_bank_branch_number
string

Branch (if CAD) or Routing number (if USD). Useful when external_payment_type = check/cheque.

payor_bank_account_number
string

Bank account number. Useful when external_payment_type = check/cheque.

payor_name
string

Name of entity or business making the payment. May or may not be the same as customer name on invoice.

settlement_date
string <date>

Settlement date, in the format YYYY-MM-DD.

external_id
string

The internal reference of the payment as originated from a source system, typically used by ERP connectors to aid in synchronizing payment data.

Responses

201

Created

401

Unauthorized

412

Precondition Failed

post /api/imports/payment

Production

https://secure.versapay.com/api/imports/payment

UAT

https://uat.versapay.com/api/imports/payment

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "identifier": "PMT001-05",
  • "amount_cents": 10000,
  • "currency": "usd",
  • "date": "2017-12-02",
  • "customer_identifier": "CUS001",
  • "payment_amounts_attributes":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "identifier": "PMT123",
  • "message": "1 payment 1 invoice amounts"
}

Export/View a Payment

View a payment.

The path parameter reference_or_token is matched to the payment's payment_reference or payment_transaction_token, in that order.

path Parameters
reference_or_token
required
string

The payment's payment_reference or payment_transaction_token.

options[export_payment_tree]
any

When present: ?options[export_payment_tree]=true then the optional payment_tree attribute is included in the response payload.

Responses

200

Successful Operation

401

Unauthorized

404

Not Found

get /api/exports/payment/{reference_or_token}

Production

https://secure.versapay.com/api/exports/payment/{reference_or_token}

UAT

https://uat.versapay.com/api/exports/payment/{reference_or_token}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "payment_reference": "string",
  • "date": "2024-11-11",
  • "payment_amount": "string",
  • "payment_transaction_amount": "string",
  • "payment_method": "string",
  • "auto_debit_indicator": "string",
  • "payment_timestamp": "string",
  • "customer_identifier": "string",
  • "customer_name": "string",
  • "status": "IN PROGRESS",
  • "status_reason": "string",
  • "payment_source": "string",
  • "payment_code": "string",
  • "payment_description": "string",
  • "gateway_authorization_code": "string",
  • "pay_to_bank_account": "string",
  • "pay_to_bank_account_name": "string",
  • "display_identifier": "string",
  • "payment_amounts":
    [
    ],
  • "batch_number": "string",
  • "batch_amount": "string",
  • "payment_tree":
    {
    }
}

Export Payment Allocations

Payments made/recorded to your supplier account from your customers since watermark, limited to 100 payment amounts at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for a subsequent calls.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/payment_amounts

Production

https://secure.versapay.com/api/exports/payment_amounts

UAT

https://uat.versapay.com/api/exports/payment_amounts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "payment_amounts":
    {
    }
}

Export Payments

Payments made/recorded to your supplier account from your customers since watermark, limited to 100 payments at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for a subsequent calls.

path Parameters
options[export_payment_tree]
any

When present: ?options[export_payment_tree]=true then the optional payment_tree attribute is included in the response payload.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/payments

Production

https://secure.versapay.com/api/exports/payments

UAT

https://uat.versapay.com/api/exports/payments

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "payments":
    {
    }
}

Export Payments Recently Updated

Payment records that have been updated in the past 7 days, since watermark, limited to 100 records at a time.

A consumer should store the last id value of each response and include it as the watermark parameter for subsequent calls.

path Parameters
options[export_payment_tree]
any

When present: ?options[export_payment_tree]=true then the optional payment_tree attribute is included in the response payload.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/payments/recent

Production

https://secure.versapay.com/api/exports/payments/recent

UAT

https://uat.versapay.com/api/exports/payments/recent

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "payments":
    {
    }
}

Divisions

As a supplier divisions are used to group your invoices.

Create and Update Division

Create and update divisions. If the division already exists when a request is processed, it will be updated.

Note:

  • A Division cannot be deleted if it is:
    • related to any invoices
    • a parent division
  • The parent division must exist in order to add a child division to a hierarchy. Attempting to set an unknown parent code will permit the creation of the new division, but will not create a parent.
Request Body schema: application/json
code
required
string

Division Code used on invoices

name
required
string

Division Name

external_id
string

Optional external identifier for the division

deleted
boolean

Optional value that indicates if the division is inactive (true) or active (false)

parent_code
string

Optional value that indicates this is a child of another division. The value must be an existing division code to make this division part of a hierarchy.

Responses

201

Created

401

Unauthorized

412

Precondition Failed

post /api/imports/division

Production

https://secure.versapay.com/api/imports/division

UAT

https://uat.versapay.com/api/imports/division

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": "DIV1",
  • "name": "Division One",
  • "external_id": "45332",
  • "deleted": false,
  • "parent_code": ""
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "identifier": "DIV1",
  • "message": "1 division"
}

Notifications

As a supplier you can notify customers about their invoices.

Single Invoice Reminder

Issue an invoice reminder to the relevant recipients for the specified invoice.

path Parameters
number_or_id
required
string

number or display_number or id of the invoice record.

Responses

200

Successful Operation

401

Unauthorized

post /api/notifications/remind/{number_or_id}

Production

https://secure.versapay.com/api/notifications/remind/{number_or_id}

UAT

https://uat.versapay.com/api/notifications/remind/{number_or_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "requested": 1,
  • "sent": 1,
  • "not_found": 0,
  • "suppressed": 0,
  • "not_invited": 0,
  • "paid": 0,
  • "draft": 0,
  • "credit": 0,
  • "scheduled": 0,
  • "on_plan": 0
}

Bulk Invoice Reminder

Issue an invoice reminder to the relevant recipients for the specified invoices.

Request Body schema: application/json
ids
array

A list of number or display_number or id of the invoice records.

Responses

200

Successful Operation

401

Unauthorized

post /api/notifications/remind

Production

https://secure.versapay.com/api/notifications/remind

UAT

https://uat.versapay.com/api/notifications/remind

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "requested": 10,
  • "sent": 7,
  • "not_found": 1,
  • "suppressed": 0,
  • "not_invited": 1,
  • "paid": 0,
  • "draft": 0,
  • "credit": 1,
  • "scheduled": 0,
  • "on_plan": 0
}

Direct Message

Issue a direct message to just the specified email address regarding the declared object.

Note: When certain conditions are not met for an order the response code 400 will be returned. Conditions are:

  • must be enabled for supplier
  • must not be a draft
  • owing_cents must be greater than 0
  • deposit_amount_cents must be greater than 0
  • order must belong to a customer
Request Body schema: application/json
email
required
string

the notification recipient email address

object_type
required
string
Enum: "invoice" "order"

the type of object that is the subject of the notification

invoice supported currently, future releases to extend this support
order send order deposit request

object_identifier
required
string

identifier of the object that is the subject of the notification

create_contact
boolean

when true a contact will be created for the specified email if it does not already exist
when false the contact is required to already exist

first_name
string

Optional, the contact first name.

last_name
string

Optional, the contact last name.

Responses

200

Successful Operation

400

Bad Request

401

Unauthorized

post /api/notifications/direct_message

Production

https://secure.versapay.com/api/notifications/direct_message

UAT

https://uat.versapay.com/api/notifications/direct_message

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "email": "email@example.com",
  • "object_type": "invoice",
  • "object_identifier": "INV01",
  • "create_contact": true,
  • "first_name": "string",
  • "last_name": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Collaboration

As a supplier your customers collaborate with you through comments about invoices and/or payments.

Export Open and Closed Disputes

Open and closed disputes since watermark, limited to 100 disputes at a time per category (open/closed).

query Parameters
watermark
string
Example: watermark=2017-12-16T20:44:37

The date/datetime (yyyy-mm-dd, yyyy-mm-ddThh:mm:ss) value to base a subsequent extract of the next 100 open and the next 100 closed disputes.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure. Note the watermark is a date/datetime, and the response watermark is the dispute.id and is not to be used as the input.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/disputes

Production

https://secure.versapay.com/api/exports/disputes

UAT

https://uat.versapay.com/api/exports/disputes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "disputes":
    {
    }
}

Export Customer and Invoice Comments

Customer and invoice comments (including disputes) since watermark, limited to 100 comments at a time.

query Parameters
watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/comments

Production

https://secure.versapay.com/api/exports/comments

UAT

https://uat.versapay.com/api/exports/comments

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "comments":
    {
    }
}

File Imports

As a supplier you can upload customer, invoice, and payment data in CSV file formats.

Import a CSV File

When uploading a CSV-formatted file it’s helpful to use your language/framework tooling to simplify the multipart/form-data file upload.

Size Limit

The file cannot exceed 25MB.

Layouts

Please contact support@versapay.com or reach out to your implementation specialist for standard inbound CSV file layouts.

Request Body schema: multipart/form-data
file
string

The file to upload.

filename
string

Name of original file.

Responses

201

Created

401

Unauthorized

post /api/imports

Production

https://secure.versapay.com/api/imports

UAT

https://uat.versapay.com/api/imports

Request samples

Copy
curl \
-u "Nvax...:UN0I..." \
-F "filename=data.csv" \
-F "file=@/home/user/Desktop/data.csv" \
https://secure.versapay.com/api/imports/

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 21877,
  • "file_name": "invoices.csv",
  • "file_size": 1024,
  • "file_content_type": "text/plain",
  • "file_fingerprint": "bf817b5548d69f6a3a49b6bb872fb906",
  • "file_errors_count": 5,
  • "error": "",
  • "result_message": "5487 invoices",
  • "complete_at": "2016-08-30T15:39:30-04:00"
}

View In-Progress & Completed Batches

View recent in-progress and completed import batches.

query Parameters
page
integer

50 items are displayed per page.

Responses

200

Successful Operation

401

Unauthorized

get /api/imports

Production

https://secure.versapay.com/api/imports

UAT

https://uat.versapay.com/api/imports

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

View In-Progress Batches

View only recent in-progress import batches.

query Parameters
page
integer

50 items are displayed per page.

Responses

200

Successful Operation

401

Unauthorized

get /api/imports/processing

Production

https://secure.versapay.com/api/imports/processing

UAT

https://uat.versapay.com/api/imports/processing

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

View Completed Batches

View only recent completed import batches.

query Parameters
page
integer

50 items are displayed per page.

Responses

200

Successful Operation

401

Unauthorized

get /api/imports/completed

Production

https://secure.versapay.com/api/imports/completed

UAT

https://uat.versapay.com/api/imports/completed

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

View Batch Details

path Parameters
id
required
string

The import batch identifier.

Responses

200

Successful Operation

401

Unauthorized

get /api/imports/{id}

Production

https://secure.versapay.com/api/imports/{id}

UAT

https://uat.versapay.com/api/imports/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 21877,
  • "file_name": "invoices.csv",
  • "file_size": 1024,
  • "file_content_type": "text/plain",
  • "file_fingerprint": "bf817b5548d69f6a3a49b6bb872fb906",
  • "file_errors_count": 5,
  • "error": "",
  • "result_message": "5487 invoices",
  • "complete_at": "2016-08-30T15:39:30-04:00"
}

View Tokenized Results of File Imported Payment Methods

Tokenized results of file imported payment methods are available up to 24hrs following a fund import. This results file echo's the original input lines - absent the original header line, with sensitive field masking - appending the imported items wallet token, fund token, and vault token - i.e. essential references that can be used for subsequent payment/order transactions API usage.

path Parameters
id
required
string

The import batch identifier.

Responses

200

Successful Operation

401

Unauthorized

get /api/imports/{id}/echo

Production

https://secure.versapay.com/api/imports/{id}/echo

UAT

https://uat.versapay.com/api/imports/{id}/echo

Response samples

Content type
text/csv
Copy
1. Example of credit card import source text/csv:
customer_identifier,name,first_name,last_name,number,expiry,postal_code,create_debit_agreement,auto_debit_reference
10001,John Doe,John,Doe,4111111111111111,0318,H0H 0H0,Y,POLICY_10001
10001,John Doe,John,Doe,5473500000000014,0318,H0H 0H0,Y,10001,John Doe,John,Doe,372700699251018,0318,H0H 0H0,N,
10004,Mary Smith,Mary,Smith,4111111111111111,0318,H0H 0H0,Y,POLICY_10004
10004,Mary Smith,Mary,Smith,5473500000000014,0318,H0H 0H0,Y,10004,Mary Smith,Mary,Smith,372700699251018,0318,H0H 0H0,N,

2. Example of credit card import results text/csv:
10001,John Doe,John,Doe,************1111,****,H0H 0H0,Y,POLICY_10001,1L8DN37Y6TL8,CC8KCKWWL8UT,ccuq905fyzruz9
10001,John Doe,John,Doe,************0014,****,H0H 0H0,Y,,1L8DN37Y6TL8,CC3R9L5BDHI3,ccghc1fsa52tko
10004,Mary Smith,Mary,Smith,************1111,****,H0H 0H0,Y,POLICY_10004,4JL6FH2L7LKN,CC851RBU5WGJ,ccg8c12dymulm1
10004,Mary Smith,Mary,Smith,************0014,****,H0H 0H0,Y,,4JL6FH2L7LKN,CC2YDCF82NQK,ccom320nfnozj8

View Batch Errors

View the error results for a given batch import. This endpoint returns by default a json type response. But you can specify the extension in which you want to see the response, the accepted extensions are json and csv

path Parameters
id
required
string

The import batch identifier.

Responses

200

Successful Operation

401

Unauthorized

get /api/imports/{id}/errors

Production

https://secure.versapay.com/api/imports/{id}/errors

UAT

https://uat.versapay.com/api/imports/{id}/errors

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message":
    [
    ]
}

Export/View Invoice Reconciliation Results

View the most recent, or for a given batch import, invoice reconciliation results.

query Parameters
batch_file_id
integer

Optional, the id of the batch file import queued via /api/imports. When not specified the most recent invoice recon results are returned if any.

watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/invoice_recon/{batch_file_id}

Production

https://secure.versapay.com/api/exports/invoice_recon/{batch_file_id}

UAT

https://uat.versapay.com/api/exports/invoice_recon/{batch_file_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "reconciliation_invoices":
    {
    }
}

Export/View Payment Reconciliation Results

View the most recent, or for a given batch import, payment reconciliation results.

query Parameters
batch_file_id
integer

Optional, the id of the batch file import queued via /api/imports. When not specified the most recent invoice recon results are returned if any.

watermark
integer <int64> (Watermark)
Example: watermark=0

The value to base a subsequent extract of the next 100 items.

list
boolean
Example: list=true

See Watermark & Limit for more information on response structure.

Responses

200

Successful Operation

401

Unauthorized

get /api/exports/payment_recon/{batch_file_id}

Production

https://secure.versapay.com/api/exports/payment_recon/{batch_file_id}

UAT

https://uat.versapay.com/api/exports/payment_recon/{batch_file_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "reconciliation_payments":
    {
    }
}

Fund Sources

This endpoint is not applicable to Collaborative AR based suppliers.`

Fund Sources include bank accounts, credit cards, and balance associated with your account. The tokenized representation of these fund sources can be used to specify which fund to use when working with Transactions and Debit Agreements.

View Your Fund Sources

Responses

200

Successful Operation

401

Unauthorized

get /api/funds

Production

https://secure.versapay.com/api/funds

UAT

https://uat.versapay.com/api/funds

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    }
]

Vault a Bank Account

Vault a Bank Account for subsequent Transaction Use/Creation

Request Body schema: application/json

Bank account to vault.

currency
string
Enum: "usd" "gbp" "eur" "cad" "aud"
business_name
string

Name of account holder.

country
string

CA (default), US, AU

account_number
string

Bank account number.

account_type
string

checking or savings, defaults checking (required country = US)

institution_number
string

Financial institution number (required country = CA).

branch_number
string

Financial institution branch/transit (required country = CA).

routing_number
string

Financial institution branch/location (required country = US, AU).

token
string

the bank account token

nickname
string

optional value that describes the bank account

masked_account_number
string

a masked version of the account number

routing_account_hash_function
string

the hash function used to mask the routing number and account number

routing_account_hash
string

the hash value used to mask the routing number and account number.

address
object

Responses

201

Created

401

Unauthorized

412

Precondition Failed

post /api/vault/bank

Production

https://secure.versapay.com/api/vault/bank

UAT

https://uat.versapay.com/api/vault/bank

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "currency": "usd",
  • "business_name": "John Doe",
  • "country": "CA",
  • "account_number": "10101234",
  • "account_type": "checking",
  • "institution_number": "001",
  • "branch_number": "03662",
  • "routing_number": "",
  • "token": "string",
  • "nickname": "string",
  • "masked_account_number": "string",
  • "routing_account_hash_function": "string",
  • "routing_account_hash": "string",
  • "address":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "79VMZNLXCBL9",
  • "name": "TD Canada Trust (1234)",
  • "type": "bank_account"
}

Transactions

This endpoint is not applicable to Collaborative AR based suppliers.`

Transactions are used to move funds between fund sources. The directionality of the money transfer depends on the transaction type and the specified from/to fund tokens.

Lifecycle

The lifecycle states of transaction settlement/flow are:

State Context Action to Take
new The initial state for a new transaction. N/A
wait_for_claim The transaction has been created and an email delivered to the other party. They have not yet signed up and approved the transaction. None. You may want to remind the other party if the payment has not been approved for a sufficient length of time.
wait_for_request_approval The requestee has an account already. They have not yet approved the transaction. None. You may want to remind the other party if the payment has not been approved for a sufficient length of time.
wait_for_bank_account_verification The requestee has signed up and accepted the transaction, however they have not yet verified their bank account.

Note: Users are required to verify their bank account by going through the micro-debit process in which Versapay debits and credits the user’s bank account an undisclosed amount. The user then checks their online banking and fills in the amount on the Versapay website.
None. You may want to remind the other party if the bank has not been verified in a sufficient length of time.
rejected The transaction was rejected by the requestee. Review the rejection message.
in_progress The transaction has been sent to the bank and is in progress. N/A
error There was an error while processing the transaction. Contact your bank if the error pertains to your bank account.

Contact client or create a new transaction if the error is with the other party’s bank account.
nsfed The transaction's selected fund has in-sufficient funds and the transaction has been cancelled. Contact your bank if the error pertains to your bank account.

Contact client or create a new transaction if the error is with the other party’s bank account.
cancelled The transaction has been cancelled by an administrator. A transaction can only be cancelled before the debit has been sent to the bank. N/A
completed The transaction has been completed successfully. Update your order to "Paid".
completed_but_nsfed The transaction was completed successfully, but has been returned by the bank as in-sufficient funds. Update your order to "Un-paid".

Webhooks

When using Webhooks, your application will be notified any time a transaction's status has been updated. Note that for a variety of reasons strict ordering of notifications cannot be guaranteed. We recommend any integrations that track a "last seen" state either be aware of the flow of states (downward on the preceding list), or only track actionable states.

Create Transactions

Request Body schema: application/json
transaction_type
required
string
amount_in_cents
required
integer

Transaction amount in cents.

email
required
string <email>

Recipient email address.

message
string

A message describing the transaction.

transaction_reference
string Nullable

Extra useful data to help link transactions to other systems e.g. PO numbers, account numbers etc.

unique_reference
string

Similar to transaction_reference, except it must be unique. Can be used as a duplicate transaction check.

process_on
string <date>

The date YYYY-MM-DD when this transaction should be started.

auto_withdraw
boolean

Set true to have transaction auto settle from Versapay balance to the specified bank account the night of completion; false to settle directly to Versapay balance. Auto withdraw must be enabled for your account. Only applicable to request and pre_authorized_debit transactions.

debit_agreement_token
string

The token that represents a pre-authorized agreement, see Agreements.

fund_token
string

Token of fund to use as the source.

credit
boolean

Set true to send money with Versapay credit. Your account must be credit enabled.

link_url
string

A specified url associated with transaction for instance linking to an invoice.

Responses

201

Created

401

Unauthorized

412

Precondition Failed

post /api/transactions

Production

https://secure.versapay.com/api/transactions

UAT

https://uat.versapay.com/api/transactions

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "transaction_type": "send",
  • "amount_in_cents": 20000,
  • "email": "bob@example.com",
  • "message": "Thank you",
  • "transaction_reference": "Order 3487",
  • "process_on": "2018-01-05",
  • "fund_token": "string",
  • "debit_agreement_token": "string",
  • "credit": true,
  • "link_url": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "79VMZNLXCBL9",
  • "amount_in_cents": 15000,
  • "message": "Thank you for doing business",
  • "type": "transaction",
  • "transaction_type": "send_money",
  • "email": "bob.smith@example.com",
  • "state": "in_progress",
  • "transaction_reference": "Lease 123",
  • "unique_reference": null,
  • "from_account": "John Doe",
  • "to_account": "Jane Smith",
  • "process_on": null,
  • "from_fund": "TD Canada Trust",
  • "created_by_user": "Uf6TaxzBMBBT_rXjsrN7"
}

View Transactions

query Parameters
page
integer

50 items are displayed per page.

Responses

200

Successful Operation

401

Unauthorized

get /api/transactions

Production

https://secure.versapay.com/api/transactions

UAT

https://uat.versapay.com/api/transactions

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

View a Transaction

path Parameters
token_or_unique_reference
required
string

The transaction identifier (or unique_reference).

Responses

200

Successful Operation

401

Unauthorized

get /api/transactions/{token_or_unique_reference}

Production

https://secure.versapay.com/api/transactions/{token_or_unique_reference}

UAT

https://uat.versapay.com/api/transactions/{token_or_unique_reference}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "79VMZNLXCBL9",
  • "amount_in_cents": 15000,
  • "message": "Thank you for doing business",
  • "type": "transaction",
  • "transaction_type": "send_money",
  • "email": "bob.smith@example.com",
  • "state": "in_progress",
  • "transaction_reference": "Lease 123",
  • "unique_reference": null,
  • "from_account": "John Doe",
  • "to_account": "Jane Smith",
  • "process_on": null,
  • "from_fund": "TD Canada Trust",
  • "created_by_user": "Uf6TaxzBMBBT_rXjsrN7"
}

Approve a Transaction

Approve a new or wait_for_request_approval transaction.
An API key with administrative access is required to approve a transaction.

path Parameters
token
required
string

The transaction identifier.

Request Body schema: application/json
fund_token
string

Your bank account or balance's token attribute. Omitting this option will approve the transaction using your default bank account.

Responses

200

Successful Operation

401

Unauthorized

412

Precondition Failed

post /api/transactions/{token}/approve

Production

https://secure.versapay.com/api/transactions/{token}/approve

UAT

https://uat.versapay.com/api/transactions/{token}/approve

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "fund_token": "5TH3ACC3AU21"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "79VMZNLXCBL9",
  • "amount_in_cents": 15000,
  • "message": "Thank you for doing business",
  • "type": "transaction",
  • "transaction_type": "send_money",
  • "email": "bob.smith@example.com",
  • "state": "in_progress",
  • "transaction_reference": "Lease 123",
  • "unique_reference": null,
  • "from_account": "John Doe",
  • "to_account": "Jane Smith",
  • "process_on": null,
  • "from_fund": "TD Canada Trust",
  • "created_by_user": "Uf6TaxzBMBBT_rXjsrN7"
}

Cancel a Transaction

Cancel a new, wait_for_request_approval or wait_for_bank_account_verification transaction you created. Transactions cannot be cancelled after they have been sent to the bank and are in_progress.
An API key with administrative access is required to approve a transaction.

path Parameters
token
required
string

The transaction identifier.

Responses

200

Successful Operation

412

Precondition Failed

post /api/transactions/{token}/cancel

Production

https://secure.versapay.com/api/transactions/{token}/cancel

UAT

https://uat.versapay.com/api/transactions/{token}/cancel

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "79VMZNLXCBL9",
  • "amount_in_cents": 15000,
  • "message": "Thank you for doing business",
  • "type": "transaction",
  • "transaction_type": "send_money",
  • "email": "bob.smith@example.com",
  • "state": "in_progress",
  • "transaction_reference": "Lease 123",
  • "unique_reference": null,
  • "from_account": "John Doe",
  • "to_account": "Jane Smith",
  • "process_on": null,
  • "from_fund": "TD Canada Trust",
  • "created_by_user": "Uf6TaxzBMBBT_rXjsrN7"
}

Testing Transactions

This endpoint is not applicable to Collaborative AR based suppliers.`

EFT Bank Account Numbers

In the uat environment, the following test bank accounts can be setup up in your account.

Institution Institution Number Branch Account Number
TD 004 99960 1-12 digits
RBC 003 16824 1-12 digits
BMO 001 99520 1-12 digits
HSBC 016 10880 1-12 digits

When Versapay prompts you to verify these bank accounts enter a value of 1.23 for the verification amount.

To determine the outcome of a transaction funded by a bank account, set the amount accordingly:

Amount Resulting State
$x.10 nsfed
$x.11 completed_but_nsfed
$x.30 error
anything else completed

ACH Bank Account Numbers

Please contact support@versapay.com for support & setup of ACH acceptance and bank account numbers that can be used for testing.

Credit Card Numbers

Please contact support@versapay.com for support & setup of Credit Card acceptance and card brands/numbers that can be used for testing.

Agreements

This endpoint is not applicable to Collaborative AR based suppliers.`

Debit Agreements are a digital analog to paper pre-authorized debit agreements that businesses could use, for instance, for monthly billing.

The creator of an agreement can cancel at any time. The other party can approve, reject, or later revoke an agreement at any time.

Lifecycle

The lifecycle states of debit agreements are:

State Context Action to take
pending The recipient has been sent an email to approve the agreement. N/A
approved The agreement has been approved. Create a pre-authorized debit transaction that references the agreement when you bill.
rejected The agreement was rejected by the requestee. Review the rejection message.
cancelled The agreement was cancelled by the requestor. Cancel the subscription with the other party.
revoked The agreement was cancelled by the requestee. Cancel the subscription with the other party.
wait_for_bank_account_verification The associated bank account has not yet been verified. None - The recipient has been notified.

Email the recipient if the bank account is not verified within a reasonable amount of time.
invalid_funding_source There were errors with the associated bank account or credit card. None - The recipient has been notified to change the funding source.

Email the recipient if the fund is not changed within a reasonable amount of time.

Webhooks

When using Webhooks, your application will be notified any time an agreement’s status has been updated (see Lifecycle); allowing you to start billing when approved or cancel a subscription when rejected or revoked.

Create an Agreement

Request Body schema: application/json
email
required
string

Recipient email address.

reference
string

Extra useful data to help link transactions to other systems e.g. PO numbers, account numbers etc.

message
string

A message describing what the agreement is for.

Responses

201

Created

401

Unauthorized

412

Precondition Failed

post /api/debit_agreements

Production

https://secure.versapay.com/api/debit_agreements

UAT

https://uat.versapay.com/api/debit_agreements

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "email": "bob.smith@example.com",
  • "reference": "87769089",
  • "message": "Debit agreement for order number - 87769089"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "3TJWJB36M973",
  • "state": "pending",
  • "name": "John Doe",
  • "email": "user@example.com",
  • "reference": "Ad 123",
  • "message": "Thank you for your business",
  • "type": "debit_agreement",
  • "created_by_user": "Uf6TaxzBMBBT_rXjsrN7",
  • "created_by_account": "Central Media News"
}

View Sent Agreements

query Parameters
page
integer

50 items are displayed per page.

Responses

200

Successful Operation

401

Unauthorized

get /api/debit_agreements/sent

Production

https://secure.versapay.com/api/debit_agreements/sent

UAT

https://uat.versapay.com/api/debit_agreements/sent

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

View Received Agreements

query Parameters
page
integer

50 items are displayed per page.

Responses

200

Successful Operation

401

Unauthorized

get /api/debit_agreements/received

Production

https://secure.versapay.com/api/debit_agreements/received

UAT

https://uat.versapay.com/api/debit_agreements/received

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Approve an Agreement

path Parameters
token
required
string

The agreement identifier.

Request Body schema: application/json
fund_token
string

Your bank account or balance's token attribute. Omitting this option will approve the agreement using your default bank account.

Responses

201

Created

401

Unauthorized

412

Precondition Failed

post /api/debit_agreements/{token}/approve

Production

https://secure.versapay.com/api/debit_agreements/{token}/approve

UAT

https://uat.versapay.com/api/debit_agreements/{token}/approve

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "fund_token": "5TH3ACC3AU21"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "3TJWJB36M973",
  • "state": "pending",
  • "name": "John Doe",
  • "email": "user@example.com",
  • "reference": "Ad 123",
  • "message": "Thank you for your business",
  • "type": "debit_agreement",
  • "created_by_user": "Uf6TaxzBMBBT_rXjsrN7",
  • "created_by_account": "Central Media News"
}

Cancel an Agreement

path Parameters
token
required
string

The agreement identifier.

Responses

200

Successful Operation

401

Unauthorized

post /api/debit_agreements/{token}/cancel

Production

https://secure.versapay.com/api/debit_agreements/{token}/cancel

UAT

https://uat.versapay.com/api/debit_agreements/{token}/cancel

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "3TJWJB36M973",
  • "state": "pending",
  • "name": "John Doe",
  • "email": "user@example.com",
  • "reference": "Ad 123",
  • "message": "Thank you for your business",
  • "type": "debit_agreement",
  • "created_by_user": "Uf6TaxzBMBBT_rXjsrN7",
  • "created_by_account": "Central Media News"
}

Reject an Agreement

Reject a pending agreement by supplying an agreement's token attribute and providing a rejection_reason.

path Parameters
token
required
string

The agreement identifier.

Responses

200

Successful Operation

401

Unauthorized

post /api/debit_agreements/{token}/reject

Production

https://secure.versapay.com/api/debit_agreements/{token}/reject

UAT

https://uat.versapay.com/api/debit_agreements/{token}/reject

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "3TJWJB36M973",
  • "state": "pending",
  • "name": "John Doe",
  • "email": "user@example.com",
  • "reference": "Ad 123",
  • "message": "Thank you for your business",
  • "type": "debit_agreement",
  • "created_by_user": "Uf6TaxzBMBBT_rXjsrN7",
  • "created_by_account": "Central Media News"
}

Revoke an Agreement

Revoke an approved agreement for your account by supplying an agreement's token attribute. The agreement's creator will no longer be able to debit your account using this agreement.

path Parameters
token
required
string

The agreement identifier.

Responses

200

Successful Operation

post /api/debit_agreements/{token}/revoke

Production

https://secure.versapay.com/api/debit_agreements/{token}/revoke

UAT

https://uat.versapay.com/api/debit_agreements/{token}/revoke

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "3TJWJB36M973",
  • "state": "pending",
  • "name": "John Doe",
  • "email": "user@example.com",
  • "reference": "Ad 123",
  • "message": "Thank you for your business",
  • "type": "debit_agreement",
  • "created_by_user": "Uf6TaxzBMBBT_rXjsrN7",
  • "created_by_account": "Central Media News"
}

Hosted Checkout

This endpoint is not applicable to Collaborative AR based suppliers.`

Hosted checkout is a URL based method for accepting a payment through your website or email without the need for custom programming.

Single Payment Hosted Checkout

Clients, customers, or donors, for instance, can send your organization money directly from their bank account or credit card simply by clicking a link which displays a page with your account name allowing your customer to make a payment to you for the specified dollar amount:
https://secure.versapay.com/send_money?api_token={your_api_token}&amount={dollar_amount_for_customer_to_pay}
Funds will go to the fund destination passed in the to_fund parameter. By default, the funds will be deposited into your default bank account once the transaction clears from the other party.

query Parameters
api_token
required
string

A valid API token generated from your account.

amount
required
number

The amount in dollars that the transaction is for.

message
string

A message which will be stored with the transaction.

return_to
string

A url which will displayed to the user to return to your website after they finish the Signup and Confirmation.

link_url
string

A url that gets stored and displayed on the transaction for an invoice.

pref
string

The preferred payment type either ba or cc for bank or credit card respectively.

to_fund
string

The token of the bank account or balance where the funds should go to.

reference
string

Extra data (max 255 characters). Great for storing internal order or account number.

locale
string

Set the default language of the checkout, either en or fr. Users will still be able to switch to their preferred language.

Responses

200

Successful Operation

get /send_money

Production

https://secure.versapay.com/send_money

UAT

https://uat.versapay.com/send_money

Debit Agreement Hosted Checkout

Clients, customers, or donors, for instance, can initiate a pre-authorized debit agreement by clicking a link on your website or in an email.
https://secure.versapay.com/authorize?api_token={your_api_token}&message={explanation_of_what_this_is_for}

query Parameters
api_token
required
string

A valid API token generated from your account.

message
required
string

A message for the user describing the pre-authorized debit agreement.

return_to
string

A url which will displayed to the user to return to your website after they finish the Signup and Confirmation.

reference
string

Extra data (max 255 characters). Great for storing internal order or account number.

Responses

200

Successful Operation

get /authorize

Production

https://secure.versapay.com/authorize

UAT

https://uat.versapay.com/authorize