eGift API for Partner Platforms
Our eGift Partner API contains several endpoints to allow partners to manage ForestNation's automated eGift processes.
API Set Up
To gain access to the API you will need the hook.forestnation.com Url a Partner-Id, and a Partner-Token. If you have not already, please contact our team for these details via the support email: citizens@forestnation.com
API Endpoints
The ForestNation eGift Partner API is built using REST principles and uses endpoints that except the following HTTP Verbs as requests.
POST
PUT
GET
Each endpoint uses HTTP status codes and a JSON formated message in its response.
Possible status codes may be 200, 201, 401.
What follows are details of the endpoints you can access and details of the request and response you should use and expect from that endpoint.
eGift Create Endpoint
The eGift Create endpoint allows a partner to create the eGift order using the following request and response.
Request
Method: POST
{
"partnerId": "",
"token":"",
"orderId":"",
"gift": {
"id": "",
"message": "",
"treeAmount": 0,
"sender": {
"id": "",
"firstName": "",
"lastName": "",
"emailAddress": "",
"type": [
"company",
"person"
]
},
"recipient": {
"id": "",
"salutation": "",
"companyName": "",
"firstName": "",
"lastName": "",
"emailAddress": "",
"type": [
"company",
"person"
]
}
}
}
Request Parameters
Name | Type | Description |
partnerId
|
String | Numeric Id given to the partner by ForestNation. |
token
|
String | Unique token given to the partner by ForestNation. |
orderId
|
String | The partners order Id set by the partner |
gift
|
Gift (see details below) | A gift object detaled below |
Gift
Name | Type | Description |
id | String | Id given to the partner by ForestNation to identify the gift template to use. Similar to a ProductID. |
message
|
String | Sender's Message to add to the eGift. |
treeAmount
|
Integer | Number of trees to plant |
sender | String | A sender object detailed below |
recipent | String | A recipient object detailed below |
Sender
id
|
String | Id set by the partner to identify the sender |
firstName
|
String | First name of recipient |
lastName
|
String | Last name of recipient |
emailAddress
|
String | Email address of recipient |
type
|
String | Individual or company. |
Recipient
id
|
String | Id set by the partner to identify the recipient |
firstName
|
String | First name of recipient |
lastName
|
String | Last name of recipient |
emailAddress
|
String | Email address of recipient |
type
|
String | Individual or company. |
Response
The following response will be posted back from a successful request.
Status Code: 201
{"OrderId":""}
Response parameters
Name | Type | Description |
OrderId | String | This is the unique Id for each order assigned by ForestNation once an order has been successfully processed. |
Rate limit
API requests are limited to 30 incoming requests per second.
If you send more than 30 requests per second, the system returns an error with status code 429.
If you are having problems accessing resources or have anything in mind we should add, let us know at citizens@forestnation.com