Transaction Tracking

Once a Partnero customer is created, it’s crucial to notify Partnero when that customer makes a purchase. This ensures that partners are properly rewarded.

There are multiple options available to send data when a key business event, such as a customer making a purchase on your platform, occurs.

Payment Gateway integration

The recommended method is to connect your Payment Gateway. Partnero currently fully supports:

This is the simplest method to handle transactions. It not only includes transaction creation but also covers refunds and other related actions.

Partnero API transaction tracking

Partnero API is built with RESTful principles and provides the most flexible and robust option to send transaction details for a customer to Partnero via secure API calls. For more details, you can read the reference documentation.

To create a transactions and assign it to a customer on your Partnero account, the Transaction create method needs to be called:

POST https://api.partnero.com/v1/transactions

Request example

{
    "customer": {
        "key": "CUSTOMER_KEY"
    },
    "key": "transaction_123",
    "amount": 99.99,
    "product_id": "prod_123", // optional
    "product_type": "monthly", // optional
    "action": "sale"
}
{
    "customer": {
        "key": "CUSTOMER_KEY"
    },
    "key": "transaction_123",
    "amount": 99.99,
    "product_id": "prod_123", // optional
    "product_type": "monthly", // optional
    "action": "sale",
    "options": {
        "create_customer": true // use this option to create a customer and a transaction at the same time
    },
    "partner": {
        "key": "UNIQUE_PARTNER_KEY" // use this option to create a customer and a transaction at the same time
    }
}

Request parameters

ParametersTypeRequiredLimitationsDetails
customerobject[]yesCustomer data.
customer.keystringyesCustomer identification. The same value from customer creation.
keystringoptionalPayment ID. It is not required but recommended (must be unique). We recommend using a payment ID on your system. Later can be used to refund/delete transactions.
amountstringyesA full amount of the purchase. Partnero will calculate partner's reward based on program settings.
product_idstringoptionalProduct ID. It is used to for advanced commmission calculation.
product_typestringoptionalProduct type or category. It is used to for advanced commmission calculation.
actionstringyesCan be anything, but we prefer sale. It's visible in the program.
optionsobject[]optional
options.create_customerstringoptionaltrue or falseUse this option to create a customer and a transaction at the same time.
customer.partnerobject[]optionalPartner data. Can be used when the customer is being created at the same time.
customer.partner.keystringoptionalPartner's key to whom you are willing to create a customer. Should be populated with UNIQUE_PARTNER_KEY.
customer.partner.idstringoptionalAlternatively, Partner ID can be used instead of key.
customer.partner.emailstringoptionalAlternatively, Partner email address can be used instead of key.

For complete integration, we suggest incorporating the Transaction delete method as well to handle refunds and chargebacks.

Partnero JavaScript transaction tracking

This method allows you to send transaction data via JavaScript calls. Please note that this method is not fully secure and is disabled by default. We recommend using the API or Payment Gateway instead. To use this method, it must be enabled on your program’s Integration page.

Execute this script immediately following a successful sale.

<script>
    po('transactions', 'create', {
        data: {
            key: 'transaction_123',
            amount: 99.99,
            amount_units: 'usd',
            product_id: 'prod_123', // optional
            product_type: 'monthly', // optional
            customer: {
                key: 'customer_123456'
            }
        }
    });
</script>
<script>
    po('transactions', 'create', {
        data: {
            key: 'transaction_123',
            amount: 99.99,
            amount_units: 'usd',
            product_id: 'prod_123', // optional
            product_type: 'monthly', // optional
            customer: {
                key: 'customer_123456'
            }
        },
    	options: {
    		create_customer: true // use this option to create a customer and a transaction at the same time
    	}   
    });
</script>

Request parameters

ParametersTypeRequiredLimitationsDetails
keystringoptionalPayment ID. It is not required but recommended (must be unique). We recommend using a payment ID on your system. Later can be used to refund/delete transactions.
amountstringyesA full amount of the purchase. Partnero will calculate partner's reward based on program settings.
amount_unitsstringoptional
actionstringoptionalFor example, sale.
customerobject[]yes
customer.keystringyesThe same value from customer creation (if customer exists).
customer.emailstringoptional
customer.namestringoptional
product_idstringoptionalProduct ID. It is used to for advanced commmission calculation.
product_typestringoptionalProduct type or category. It is used to for advanced commmission calculation.
optionsobject[]optional
options.create_customerstringoptionaltrue or falseUse this option to create a customer and a transaction at the same time.