Table of Contents
Overview
The Direct Post method is the simplest integration method for both web-based and non-web-based payment applications, however, merchants using this integration method should have passed a PCI vulnerability scan before use. We suggest looking at the documentation in our integration portal which can be found here.
Prerequisites
This method of integration uses the username and password from the merchant account as the credentials. You will also use a URL to post the data back to us. This is the generic POST URL:
- https://secure.networkmerchants.com/api/transact.php
Best Practices
Since the Direct Post API uses a username and password, it is recommended that a separate user is created under the merchant account. Using the primary username credentials is not recommend. When creating a separate user, you are able to restrict that user's permission so they only have API access. This can be done while logged into the merchant gateway by going to "Options>Settings>User Accounts".
Examples
The examples below show you how a typical transaction can be done. There are also examples of adding to the customer vault and how to set up recurring.
Sale
https://secure.nmi.com/api/transact.php?type=sale&security_key=[ADD SECURITY KEY HERE]&ccnumber=4111111111111111&ccexp=1025&amount=15.00
Void
https://secure.nmi.com/api/transact.php?type=void&security_key=[ADD SECURITY KEY HERE]]&amount=5.00&transactionid=4077681766
Refund
https://secure.nmi.com/api/transact.php?type=refund&security_key=[ADD SECURITY KEY HERE]&amount=50.00&transactionid=3981038834
Recurring
https://secure.nmi.com/api/transact.php?security_key=[ADD SECURITY KEY HERE]&ccnumber=4111111111111111&ccexp=1025&recurring=add_subscription&plan_payments=0&plan_amount=5.00&day_frequency=30&start_date&20180209
Vault
https://secure.nmi.com/api/transact.php?security_key=[ADD SECURITY KEY HERE]&ccnumber=4111111111111111&ccexp=1025&customer_vault=add_customer