ProductsInvoicing API Integration Guide
Environment | Base URL |
---|---|
Sandbox | https://proxy.payanywhere.dev |
Production | https://proxy.payanywhere.com |
How To Start
- Sign up for a free North Developer account.
- Contact us for Sandbox credentials that can be used to try out this product in a test environment.
- Use the guide below or the Postman Collection to build your app. Resources to assist with development are provided here.
- When logged in, you can use the Integration Tracker to view the status of your integration, notes from meetings with Integration Engineers, resources related to your solution, and more by clicking the User profile icon in the top right corner of the screen and selecting Integrations.
- When development is complete, contact us to certify your integration. Once certified, the merchant or an authorized contact will be able to retrieve Production credentials from the API Access page of your Production Payments Hub account. For more information about using Payments Hub, visit the Help Center.
Server Requirements
Any connections must be made over TLS v1.2 or higher. The following are the supported ciphers:
- ECDHE-ECDSA-AES128-GCM-SHA256
- ECDHE-RSA-AES128-GCM-SHA256
- ECDHE-ECDSA-AES256-GCM-SHA384
- ECDHE-RSA-AES256-GCM-SHA384
Invoicing API Setup
Steps 1 and 2 are intended to be performed on your server. You may wish to encapsulate them so that your client-side code makes a single request for a payments URL providing order information.
1. Generate an auth token by calling a POST to the following request URL with the headers and payload below:
Method: POST
Request URL: https://proxy.payanywhere.com/auth
Headers:
Name | Value | Description |
---|---|---|
Content-Type | application/json | Required. Content type of message. For most messages, this will be the default. |
Content-Length | 1234 | Required. This value should be set to the exact length of the message body you are sending. |
x-nabwss-appsource | pa_isv_1234567890abc | Required. This value is specific to each individual API account. For example, ISVs selling an application to multiple companies would use a different value for each company. Similarly, if a user has multiple accounts (MIDs) with us, the value for the x-nabwss-appsource header would be different for each MID. |
Request body:
JSON response:
2. Use the token and accountId received from the previous call to post a request for a hosted payments page.
Method: POST
Request URL: https://proxy.payanywhere.com/accounts/<ACCOUNT_ID>/invoices
Headers:
Name | Value | Description |
---|---|---|
Content-Type | application/json | Required. Content type of message. For most messages, this will be the default. |
Content-Length | 1234 | Required. This value should be set to the exact length of the message body you are sending. |
Authorization | Bearer | Required. |
x-nabwss-appsource | pa_isv_1234567890abc | Required. This value is specific to each individual API account. For example, ISVs selling an application to multiple companies would use a different value for each company. Similarly, if a user has multiple accounts (MIDs) with us, the value for the x-nabwss-appsource header would be different for each MID. |
Request body:
Parameter | Description |
---|---|
latitude | Optional |
longitude | Optional |
customer | Optional |
first_name | Optional |
last_name | Optional |
email_addresses | Optional |
name | Product name |
description | Product description |
number | Invoice number |
due_date | Use current date |
send_date | Use current date |
amount | Amount in dollars |
tax_rate | Percent |
service_fee_enabled | Optional boolean value that enables or disables the service fee (also referred to as Cash Discount) on a per transaction basis. The Cash Discount value is set at the account level at the time the merchant account is created, and is either a percentage or a fixed dollar amount. If Cash Discount is enabled at the account level, even if the service_fee_enabled parameter is not included in a request, Cash Discount will still be applied unless service_fee_enabled is passed with a value of false. This enables Cash Discount to be turned off on a per transaction basis. If Cash Discount is disabled at the account level, the service_fee_enabled flag will be ignored at all times. To view the Cash Discount setting associated with your account, log into the Payments Hub Merchant Portal and navigate to the Cash Discounting section. |
JSON response:
3. Present the URL received in the previous step to the user in an iFrame or separate browser window. From there, the user can enter their credit card information and click “Pay Now.”
Those using an iFrame will need to provide us with the following information:
- MID(s) that want to use an iFrame.
- Domain Names (DNS) for the merchant's website.
4. Let us know if you would like us to set up a webhook so your server can be notified when a payment is approved or declined. The following information will be required to set up the webhook:
- MID(s) to enable the webhook on.
- The full URL which North will post the payment result to. This must be on HTTPS and the site must use a certificate from a CA (not self-signed) in order to work.
Your endpoint should be configured to receive a payload that looks like the following:
Parameter | Description |
---|---|
unique_id | Unique ID for this transaction, provided by Payanywhere. You can use this field in the Payanywhere system to track your transaction |
auth_code | Auth code for this transaction |
amount | Authorized charged amount that was applied on this transaction |
status | Either “APPROVED” or “DECLINED” |
is_partial_auth | A partial auth transaction occurs when you try to charge a card a certain amount, i.e. $20, but that card has only a portion of that amount available, i.e. $15, and your transaction is partially approved with $15. For example, this could occur with a gift card |
requested_amount | Requested charge amount |
receipt_id | Receipt ID |
bric | This will be your token |
invoice_number | An invoice id provided by you. You can use this id to match between a transaction request that was sent by your web app and a transaction response that will be sent to your external notification URL |