Transactions
Creating transactions
We recommend to send each transaction (about sales) to Partnero. When any customer makes a purchase, it is recommended to create a transaction.
Creating a transaction for referral
POST https://api.partnero.com/v1/transactions
{
"key": "invoice_1",
"amount": 100,
"action": "sale",
"customer": {
"id": "referred_id",
"key": "referred_key"
}
}
Crediting a customer
POST https://api.partnero.com/v1/customers/(:id)/balance/credit
{
"amount": 10,
"is_currency": true,
"amount_units": "usd"
// what you can credit depends on what kinda rewards you have
}
Get balance of a customer
GET https://api.partnero.com/v1/customers/(:id)/balance
{
"data": {
"customer": {
"email": "some.name10@email.com",
"created_at": "2023-09-21T04:59:31.000000Z",
"updated_at": "2023-09-21T07:13:41.000000Z",
"name": "Some Name 10",
"id": "idforreferring-10",
"surname": null,
"tos": true,
"approved": true,
"status": "active",
"referring_customer": null,
"referrals_count": 2,
"referral_link": "https://referral.test?ref=keyforreferring-10",
"referral_links": [
"https://referral.test?ref=keyforreferring-10"
]
},
"balance": {
"currency": [
{
"amount": 3,
"amount_units": "USD",
"is_currency": true
}
]
}
},
"status": 1
}