### Magento v2 Setup Commands
Source: https://docs.vendoservices.com/docs/install-magento-plugin
Run these commands in your Magento v2 installation's root directory after extracting the plugin files. These commands are essential for upgrading the setup, compiling dependency injection, and deploying static content.
```bash
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
```
--------------------------------
### Update Payment Method Example
Source: https://docs.vendoservices.com/docs/update-payment-method-link
A complete URL example including the required subscription and signature query parameters.
```http
https://secure.vend-o.com/v/update?subscription=123456789&signature=ivdCM2C3eN_g5LUr_mEkJuthJLs
```
--------------------------------
### Make a GET Request to Refund API
Source: https://docs.vendoservices.com/docs/refund
This example demonstrates how to make a GET request to the Refund API using cURL. Ensure all required query parameters are included.
```Shell
curl --request GET \
--url "https://secure.vend-o.com/api/refund" \
--header "accept: application/xml"
```
--------------------------------
### Trial Offer Parameters Example
Source: https://docs.vendoservices.com/docs/custom-offer-link
Parameters for setting up a trial offer with specific amounts and durations. Includes an example of the offer disclosure text.
```text
billing_schedule_type=trial
initial_amount=1.95
initial_duration=2
rebill_amount=19.95
rebill_duration=30
Offer disclosure:
You will gain access to [SITE] for $1.95 for 2 days.
If not cancelled within the trial period you will be charged $19.95 every month until you cancel.
```
--------------------------------
### Example of Change Offer link
Source: https://docs.vendoservices.com/docs/change-offer-link
A complete example of a Change Offer link with required parameters for a specific subscription and offer.
```http
https://secure.vend-o.com/v/change-offer?subscription=345&offer=12&signature=OIPslx5X
```
--------------------------------
### Install Vendo SDK for PHP
Source: https://docs.vendoservices.com/docs/sdk-for-php
Use this composer command to install the Vendo Services SDK for your PHP project.
```text
composer require vendoservices/vendo-sdk
```
--------------------------------
### Example Custom Offer Link
Source: https://docs.vendoservices.com/docs/custom-offer-link
An example of a complete custom offer link for a 3-day trial at $2.95, rebilling at $30 every 30 days on site 2.
```http
https://secure.vend-o.com/v/custom-offer?site=2&type=normal&billing_schedule_type=trial&initial_amount=2.95&initial_duration=3&rebill_amount=30&rebill_duration=30&signature=OIPslx5X
```
--------------------------------
### Example Vendo One-click Join Link
Source: https://docs.vendoservices.com/docs/one-clicks
An example of a fully constructed one-click join link. This includes the base URL with mandatory parameters like subscription, offer, and signature, as well as an optional 'offers' list.
```HTTP
https://secure.vend-o.com/v/oneclick?subscription=345&offer=12&offers=12,23,24&signature=OIPslx5X
```
--------------------------------
### Instant Upgrade Link Example
Source: https://docs.vendoservices.com/docs/instant-upgrade
A sample URL demonstrating the inclusion of the subscription ID and signature parameters.
```text
https://secure.vend-o.com/v/upgrade?subscription=1738&signature=2zTP5OfWQX
```
--------------------------------
### Verification needed response example
Source: https://docs.vendoservices.com/reference/payment-gateway
Example response returned when a transaction requires additional verification steps.
```json
{
"status": 2,
"external_references": {
"transaction_reference": "123456",
"program_id": "1",
"campaign_id": "2",
"affiliate_id": "3"
},
"transaction": {
"id": 240123482,
"amount": "10.10",
"currency": "USD",
"datetime": "2020-10-14T09:25:26+02:00"
},
"result": {
"code": "6307",
"message": "Vendo Risk rules requires verification for this transaction.",
"verification_id": 123456789,
"verification_url": "https://secure.vend-o.com/v/verification?transaction_id=240123482&systemsignature=7W2suMQFTdytlD5u7dShnikS75Q"
},
"payment_details_token": "1234567890",
"request_id": "X4an4DOvnGgnlNUzg-SmwQAAAMg"
}
```
--------------------------------
### Example Card Payment Request
Source: https://docs.vendoservices.com/reference/payment-gateway
This example demonstrates a request for a card payment. It includes details for the transaction, items, payment method, customer, shipping, and request information.
```json
{
"api_secret": "001b794cc23f056e13d6718d54b9150063452c9378c4bbf9cd3bb58417cc51c6",
"is_test": 1,
"merchant_id": 1,
"site_id": 1,
"amount": 10.1,
"currency": "USD",
"external_references": {
"transaction_reference": "123",
"program_id": "1",
"campaign_id": "2",
"affiliate_id": "3"
},
"items": [
{
"item_id": "item1",
"item_description": "Product description",
"item_price": 3.1,
"item_quantity": 1
},
{
"item_id": "item2",
"item_description": "Product description 2",
"item_price": 7,
"item_quantity": 1
}
],
"payment_details": {
"payment_method": "card",
"card_number": "4111111111111111",
"expiration_month": "09",
"expiration_year": "2029",
"cvv": "110",
"name_on_card": "Marcus McNamara"
},
"customer_details": {
"first_name": "Marcus",
"last_name": "McNamara",
"language": "en",
"address": "999 Mainstreet",
"city": "Miami",
"state": "FL",
"country": "US",
"postal_code": "32122",
"email": "macus@somedomainxyzm.net",
"phone": "+1999888877",
"national_identifier": ""
},
"shipping_address": {
"first_name": "Marcus",
"last_name": "McNamara",
"address": "999 Mainstreet",
"city": "Miami",
"state": "Florida",
"country": "US",
"postal_code": "32122",
"phone": "+1999111999"
},
"request_details": {
"ip_address": "90.114.113.111",
"browser_user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36."
}
}
```
--------------------------------
### Example Tokenized Payment Request
Source: https://docs.vendoservices.com/reference/payment-gateway
This example shows a request for a tokenized payment. It includes essential transaction details and authentication parameters.
```json
{
"api_secret": "001b794cc23f056e13d6718d54b9150063452c9378c4bbf9cd3bb58417cc51c6",
"is_test": 1,
"merchant_id": 1,
"site_id": 1,
```
--------------------------------
### Magento v2 Cache Clean Commands
Source: https://docs.vendoservices.com/docs/install-magento-plugin
After running the setup commands for Magento v2, execute these commands to clear and flush the Magento cache. This ensures that the newly installed plugin is recognized and functions correctly.
```bash
php bin/magento cache:clean
php bin/magento cache:flush
```
--------------------------------
### Standard Join Link Example
Source: https://docs.vendoservices.com/docs/integration-overview
This is an example of a standard join link used to direct customers to Vendo's signup and payment pages. Ensure all query string parameters are URL-encoded.
```http
https://secure.vend-o.com/v/signup?site=9000&offers=1001,1002,1003
```
--------------------------------
### Cancel Subscription - Success Response Example
Source: https://docs.vendoservices.com/reference/cancel-subscription
This example shows the JSON response when a subscription is successfully cancelled. It includes the status, subscription ID, and a request ID.
```json
{
"status": 1,
"subscription": {
"id": 240123482
},
"request_id": "XoMgrUtN4CXZnJrJ2sRT5wAAAMc"
}
```
--------------------------------
### GET /v/upgrade
Source: https://docs.vendoservices.com/docs/instant-upgrade-link
Generates an instant upgrade link for trial users to transition to a full membership.
```APIDOC
## GET /v/upgrade
### Description
Allows end-users currently on a trial membership to quickly upgrade to a full membership by visiting a Vendo-hosted confirmation page.
### Method
GET
### Endpoint
https://secure.vend-o.com/v/upgrade
### Parameters
#### Query Parameters
- **subscription** (integer) - Required - Vendo Subscription ID that was posted to your platform when the trial transaction was processed.
- **signature** (string) - Required - The URL Signature used for security verification.
- **success_url** (string) - Optional - URL to redirect the user to after a successful upgrade confirmation.
- **decline_url** (string) - Optional - URL to redirect the user to if the upgrade is declined.
### Request Example
https://secure.vend-o.com/v/upgrade?subscription=1738&signature=2zTP5OfWQX
```
--------------------------------
### Successful Subscription Cancellation Response Example
Source: https://docs.vendoservices.com/reference/subscription-cancel
Example of a successful cancellation response in XML format, indicating subscription ID, merchant ID, and a success code.
```xml
28823358
1
Subscription successfully canceled.
```
--------------------------------
### Cancel Subscription - Error Response Example
Source: https://docs.vendoservices.com/reference/cancel-subscription
This example illustrates the JSON response when there is an error during subscription cancellation, such as the subscription not being found. It includes status, subscription ID, error details, and a request ID.
```json
{
"status": 0,
"subscription": {
"id": 12345678
},
"error": {
"code": "8105",
"message": "Subscription not found."
},
"request_id": "XoTpPo5jhjjnKOXuFCBWfwAAAJY"
}
```
--------------------------------
### Instant Upgrade Link Generation
Source: https://docs.vendoservices.com/docs/instant-upgrade
This section details how to construct the instant upgrade link, including required and optional parameters.
```APIDOC
## GET /v/upgrade
### Description
Generates an instant upgrade link for trial members to upgrade to a full membership.
### Method
GET
### Endpoint
https://secure.vend-o.com/v/upgrade
### Parameters
#### Query Parameters
- **subscription** (integer) - Required - Vendo Subscription ID for the trial membership.
- **signature** (string) - Required - The URL Signature used for authentication. See Signing URLs for more information.
- **success_url** (string) - Optional - The URL to redirect the user to after a successful upgrade confirmation.
- **decline_url** (string) - Optional - The URL to redirect the user to if the upgrade is declined.
### Request Example
```
https://secure.vend-o.com/v/upgrade?subscription=1738&signature=2zTP5OfWQX
```
### Response
This endpoint does not return a response body directly. Upon successful confirmation by the user on the Vendo page, a transaction postback is sent to your platform, and the user is redirected according to the `success_url` or Vendo's default confirmation page.
```
--------------------------------
### Signup Link with Tracking
Source: https://docs.vendoservices.com/docs/standard-join-link
Append the 'ref' parameter to the signup URL for tracking user and transaction data.
```HTTP
https://secure.vend-o.com/v/signup?site=5000&affiliate_id=0&ref=XYZ-123-ABC
```
--------------------------------
### Instant Upgrade Base URL
Source: https://docs.vendoservices.com/docs/instant-upgrade
The base endpoint for constructing an instant upgrade link.
```text
https://secure.vend-o.com/v/upgrade?
```
--------------------------------
### Default Signup Link
Source: https://docs.vendoservices.com/docs/standard-join-link
Construct a basic signup URL with site and affiliate ID. Use affiliate_id=0 for organic or search engine traffic.
```HTTP
https://secure.vend-o.com/v/signup?site=5000&affiliate_id=0
```
--------------------------------
### GET /reactivate
Source: https://docs.vendoservices.com/reference/subscription-reactivate
Reactivates a subscription that has been canceled but not yet expired.
```APIDOC
## GET /reactivate
### Description
You can reactivate a subscription using the Reactivate Subscription API. A subscription can only be reactivated if it has been canceled but has not yet expired.
### Method
GET
### Endpoint
https://secure.vend-o.com/api/reactivate
### Parameters
#### Query Parameters
- **merchantId** (string) - Required - Vendo content provider identifier.
- **subscriptionId** (string) - Required - Vendo susbcription identifier.
- **signature** (string) - Required - The URL signature.
### Response
#### Success Response (200)
- **code 5956** - Subscription successfully reactivated.
#### Response Example
28823358
1
Subscription successfully reactivated.
```
--------------------------------
### Respond to addUser with success
Source: https://docs.vendoservices.com/docs/adduser
Use this XML response to confirm the request was successful and grant the user access.
```xml
1
```
--------------------------------
### GET /cancel
Source: https://docs.vendoservices.com/reference/subscription-cancel
Cancels a subscription at the end of its current billing period.
```APIDOC
## GET /cancel
### Description
You can cancel a subscription using the Cancel Subscription API. The subscription will be canceled at the end of its current billing period, and the delUser postback will be sent when the subscription expires, not at the time the API is called.
### Method
GET
### Endpoint
https://secure.vend-o.com/api/cancel
### Parameters
#### Query Parameters
- **merchantId** (string) - Required - Vendo's content provider identifier.
- **subscriptionId** (integer) - Required - Vendo subscription identifier.
- **reasonId** (integer) - Optional - Please always use value "55" which means "Cancellation requested by the merchant".
- **signature** (string) - Required - The URL signature.
### Response
#### Success Response (200)
- **code** (integer) - 5915: Subscription successfully cancelled.
#### Response Example
28823358
1
Subscription successfully canceled.
```
--------------------------------
### POST addUser Postback
Source: https://docs.vendoservices.com/docs/adduser
This endpoint is triggered by Vendo to notify your system of a successful user signup. Your server must respond within 30 seconds to avoid a timeout and subsequent retry.
```APIDOC
## POST addUser
### Description
Vendo triggers the addUser postback when an end user has successfully completed a signup transaction. It is sent so that your system knows the user should be granted access to your site.
### Parameters
#### Request Body
- **callback** (string) - Specifies the action, which is "addUser".
- **username** (string) - End user's username.
- **password** (string) - End user's password.
- **subscription_id** (numeric) - Vendo's subscription identifier.
- **customer_id** (numeric) - Vendo's customer identifier.
- **firstname** (string) - End user's first name.
- **lastname** (string) - End user's last name.
- **street** (string) - End user's street address.
- **zip** (string) - End user's zip code.
- **city** (string) - End user's city.
- **country** (string) - End user's country (2-letter ISO 3166-1 alpha-2).
- **email** (string) - End user's email.
- **language** (string) - End user's language (2-letter ISO 639-1).
- **ip** (string) - End user's IP address.
- **site_id** (numeric) - Vendo's site identifier.
- **merchant_reference** (string) - Custom reference passed in the original request.
- **is_test** (boolean) - 0 for real transaction, 1 for test transaction.
### Response
#### Success Response (200)
- **code** (numeric) - Reply with 1 to indicate success.
#### Response Example
```xml
1
```
```
--------------------------------
### GET /update-credentials/
Source: https://docs.vendoservices.com/reference/change-username-and-password
Notifies Vendo that a username or password has been updated for a specific subscription.
```APIDOC
## GET /update-credentials/
### Description
This API allows you to notify Vendo when a username or password has been updated on your side.
### Method
GET
### Endpoint
https://secure.vend-o.com/api/update-credentials/
### Parameters
#### Query Parameters
- **merchantId** (integer) - Required - Vendo' content provider identifier.
- **subscriptionId** (integer) - Required - Vendo subscription identifier.
- **username** (string) - Required - New username for subscription.
- **password** (string) - Required - New password for subscription.
- **signature** (string) - Required - The URL signature.
### Response
#### Success Response (200)
- **code** (integer) - 5945: Subscription successfully updated.
#### Response Example
60202000
2081
Subscription successfully updated.
```
--------------------------------
### GET /api/refund
Source: https://docs.vendoservices.com/docs/refund
Endpoint to issue a full or partial refund for a specific transaction.
```APIDOC
## GET https://secure.vend-o.com/api/refund
### Description
This API is used to issue a refund to an end user, allowing for either a full or partial refund of a previous transaction.
### Method
GET
### Endpoint
https://secure.vend-o.com/api/refund
### Parameters
#### Query Parameters
- **merchantId** (int32) - Required - Vendo's content provider identifier link
- **transactionId** (int32) - Required - Unique Vendo transaction id
- **actionType** (int32) - Required - Two types: 0 = 'only refund' 1 = 'refund + cancel subscription'
- **partial_amount** (float) - Optional - To do a partial refund, use this parameter by passing in the partial amount.
- **currency** (string) - Optional - 3-letter currency code of the amount to be refunded.
- **signature** (string) - Required - The URL signature.
### Response
#### Success Response (200)
- **5907** (int) - Transaction successfully refunded.
#### Error Handling
- **5900** - An exception occurred in the API.
- **5901** - Mandatory parameters missing.
- **5902** - Merchant-ID is invalid.
- **5903** - Transaction-ID is invalid.
- **5904** - Action-Type is invalid.
- **5905** - AuthToken is incorrect.
- **5906** - Transaction already refunded.
- **5908** - Refund rejected.
```
--------------------------------
### GET /v/oneclick
Source: https://docs.vendoservices.com/docs/one-clicks
Generates a one-click join link for existing members to purchase additional products.
```APIDOC
## GET /v/oneclick
### Description
Generates a one-click join link for existing members to purchase additional products without re-entering full payment details.
### Method
GET
### Endpoint
https://secure.vend-o.com/v/oneclick
### Parameters
#### Query Parameters
- **subscription** (integer) - Required - Vendo Subscription ID. Unique identifier for the current membership of the end-user.
- **offer** (integer) - Required - The Offer ID of the one-click offer.
- **offers** (integer) - Optional - A comma-separated list of offer IDs to show in the one-click session.
- **signature** (string) - Required - The URL Signature.
- **ref** (string) - Optional - Pass-through value returned in postback as merchant_reference.
- **site_name** (string) - Optional - Name of the site for white-labelled solutions.
- **site_url** (string) - Optional - URL of the site for white-labelled solutions.
### Request Example
https://secure.vend-o.com/v/oneclick?subscription=345&offer=12&offers=12,23,24&signature=OIPslx5X
```
--------------------------------
### Standard Join Link Generation
Source: https://docs.vendoservices.com/docs/standard-join-link
Construct a standard join link to initiate the user sign-up process. This link handles the initial membership payment and sets up automatic recurring charges.
```APIDOC
## GET /v/signup
### Description
Generates a standard join link for user sign-ups and membership payments.
### Method
GET
### Endpoint
https://secure.vend-o.com/v/signup
### Parameters
#### Query Parameters
- **site** (integer) - Required - Your site ID, assigned by Vendo. Example: 2
- **page** (string) - Optional - The page the user should start on. `join` for single-page process or `prejoin` for 2-step process.
- **country** (string) - Optional - Country the user resides in. 2-letter ISO country codes. Example: gb. Default: End user's country as determined from the IP address.
- **language** (string) - Optional - Language the user prefers. 2-letter ISO language codes. Example: en. Default: Preferred language as defined in end user's web browser.
- **billing_currency** (string) - Optional - Forces and blocks the display and billing currency shown to the end-user. Supported values: USD, EUR, GBP. Requires URL to be signed if set.
- **mdo_id** (integer) - Optional - Applies a % discount to all displayed offers to the end user. Requires URL to be signed if set.
- **signature** (string) - Optional - The URL signature. See documentation for signing URLs.
### Request Example
```http
GET https://secure.vend-o.com/v/signup?site=2&page=join&country=gb&language=en
```
### Response
This endpoint redirects the user to the join process. No direct response body is returned, but the user is presented with a web interface.
```
--------------------------------
### Signup Link with Offers and Affiliate ID
Source: https://docs.vendoservices.com/docs/standard-join-link
Specify Vendo Offer IDs and your Affiliate ID in the signup URL for targeted offers and reporting.
```HTTP
https://secure.vend-o.com/v/signup?site=5000&affiliate_id=999&offers=123,432,456
```
--------------------------------
### Transaction Type Reference
Source: https://docs.vendoservices.com/docs/transaction-types
A reference guide for the transaction_type and transaction_subtype values used in API postbacks.
```APIDOC
## Transaction Types Reference
### Description
This reference lists the possible values for the `transaction_type` and `transaction_subtype` parameters used in postback notifications.
### Parameters
- **transaction_type** (integer) - The primary category of the transaction.
- **transaction_subtype** (integer) - The specific sub-category of the transaction.
### Transaction Mapping
| transaction_type | Meaning | Subtypes (transaction_subtype) |
| :--- | :--- | :--- |
| 10 | Sign-up | 1, 2, 3, 10, 13, 62, 66, 100, 101, 102, 103, 104, 105, 106, 107, 110 |
| 11 | One-time Payment | 11 |
| 15 | Rebill | 15, 18 |
| 16 | Upgrade | 16 |
| 17 | Instant Upgrade | 17 |
| 20 | Chargeback | 20 |
| 21 | Void | 21 |
| 30 | Refund | 30, 31 |
| 32 | RDR Refund | 32 |
| 33 | Ethoca Alert | 33 |
| 34 | Verifi Alert | 34 |
| 40 | Revoke | 40 |
| 60 | Verification | 60 |
| 61 | Pre-Auth | 61 |
| 63 | Update Payment Method | 63 |
| 64 | Streamate Payment | 64 |
| 65 | Streamate Sign-up | 65 |
```