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
Parameters | Type | Required | Limitations | Details |
---|---|---|---|---|
customer | object[] | yes | Customer data. | |
customer.key | string | yes | Customer identification. The same value from customer creation. | |
key | string | optional | Payment 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. | |
amount | string | yes | A full amount of the purchase. Partnero will calculate partner's reward based on program settings. | |
product_id | string | optional | Product ID. It is used to for advanced commmission calculation. | |
product_type | string | optional | Product type or category. It is used to for advanced commmission calculation. | |
action | string | yes | Can be anything, but we prefer sale . It's visible in the program. | |
options | object[] | optional | ||
options.create_customer | string | optional | true or false | Use this option to create a customer and a transaction at the same time. |
customer.partner | object[] | optional | Partner data. Can be used when the customer is being created at the same time. | |
customer.partner.key | string | optional | Partner's key to whom you are willing to create a customer. Should be populated with UNIQUE_PARTNER_KEY . | |
customer.partner.id | string | optional | Alternatively, Partner ID can be used instead of key . | |
customer.partner.email | string | optional | Alternatively, 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
Parameters | Type | Required | Limitations | Details |
---|---|---|---|---|
key | string | optional | Payment 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. | |
amount | string | yes | A full amount of the purchase. Partnero will calculate partner's reward based on program settings. | |
amount_units | string | optional | ||
action | string | optional | For example, sale . | |
customer | object[] | yes | ||
customer.key | string | yes | The same value from customer creation (if customer exists). | |
customer.email | string | optional | ||
customer.name | string | optional | ||
product_id | string | optional | Product ID. It is used to for advanced commmission calculation. | |
product_type | string | optional | Product type or category. It is used to for advanced commmission calculation. | |
options | object[] | optional | ||
options.create_customer | string | optional | true or false | Use this option to create a customer and a transaction at the same time. |