Transactions

Create a transaction

We recommend to send each transaction (about sales) to Partnero. When any customer makes a purchase, it is recommended to create a transaction.

Note: transactions can be created for referred customers only.

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

Request example

{
    "customer": {
        "id": "customer_456"
    },
    "key": "transaction_456_1",
    "amount": 99.99,
    "action": "sale"
}
{
    "key": "transaction_789_1",
    "amount": 50.99,
    "action": "sale",
    "options": {
        "create_customer": true // use this option to create a customer and a transaction at the same time
    },
    "customer": {
        "id": "customer_789",
        "name": "Robert",
        "surname": "Johnson",
        "email": "robert.johnson@partnero.com",
        "referring_customer": {
            "id": "customer_123"
        }
    }
}
{
    "customer": {
        "id": "customer_123"
    },
    "options": {
        // any options parameters
    },
    "transactions": [
        {
            "key": "transaction_123_m",
            "amount": 50.99,
            "action": "sale"
        },
        {
            "key": "transaction_456_m",
            "amount": 100.99,
            "action": "sale"
        }
    ]
}
{
    "options": {
        "create_customer": true // use this option to create a customer and a transaction at the same time
    },
    "customer": {
        "id": "customer_101112",
        "name": "Katy",
        "surname": "Perry",
        "email": "katy.perry@partnero.com",
        "referring_customer": {
            "id": "customer_123"
        }
    },
    "transactions": [
        {
            "key": "transaction_101112_1",
            "amount": 110.99,
            "action": "sale"
        },
        {
            "key": "transaction_101112_2",
            "amount": 199.99,
            "action": "sale"
        }
    ]
}

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_unitsstringoptionalCurrency code. e.g. USD, EUR, GBP etc.
actionstringyesCan be anything, but we prefer sale. It's visible in the program.
rewardedbooleanoptionalIf the transaction is already rewarded. Defaults to false.
rewardablebooleanoptionalIf the transaction is rewardable. Defaults to true.
optionsobject[]optional
options.create_customerstringoptionaltrue or falseUse this option to create a customer and a transaction at the same time.
customerobject[]yesCustomer data.
customer.idstringyes*Customer identification. The same value from customer creation. Must provide either id or key or email
customer.keystringyes*Customer identification. The same value from customer creation. Must provide either id or key or email
customer.emailstringyes*Customer email address. Must provide either key or email
customer.namestringoptionalCustomer name.
customer.surnamestringoptionalCustomer surname.
customer.created_atstringoptionalCustomer created at.
customer.referring_customerobject[]optionalReferring customer data. Can be used when the customer is being created at the same time.
customer.referring_customer.keystringoptionalReferring customer's referral key to whom you are willing to create a customer. Should be populated with UNIQUE_PARTNER_KEY.
customer.referring_customer.idstringoptionalAlternatively, Referring customer ID can be used instead of key.
customer.referring_customer.emailstringoptionalAlternatively, Referring customer email address can be used instead of key.

Response

{
    "data": {
        "key": "transaction_456_1",
        "action": "sale",
        "amount": 99.99,
        "partner": "customer_123",
        "customer": "customer_456",
        "credit": false,
        "is_currency": false,
        "amount_units": null,
        "created_at": "2025-05-12T17:50:17.000000Z",
        "deleted_at": null,
        "rewards": [
            {
                "key": "transaction_456_1",
                "action": "sale",
                "status": "ok",
                "referred_customer": "customer_456",
                "customer": "customer_123",
                "amount": 19.998,
                "amount_units": "USD",
                "is_currency": true,
                "credit": false,
                "created_at": "2025-05-12T17:50:17.000000Z",
                "deleted_at": null,
                "product_type_data": []
            },
            {
                "key": "transaction_456_1",
                "action": "sale",
                "status": "ok",
                "referred_customer": "customer_456",
                "customer": "customer_456",
                "amount": 9.999,
                "amount_units": "USD",
                "is_currency": true,
                "credit": false,
                "created_at": "2025-05-12T17:50:17.000000Z",
                "deleted_at": null,
                "product_type_data": []
            }
        ]
    },
    "status": 1
}
{
    "data": [
        {
            "key": "transaction_456_1_m",
            "action": "sale",
            "amount": 50.99,
            "customer": "customer_123",
            "referred_customer": "customer_456",
            "credit": false,
            "is_currency": false,
            "amount_units": null,
            "created_at": "2025-05-12T17:56:14.000000Z",
            "deleted_at": null,
            "rewards": [
                {
                    "key": "transaction_456_1_m",
                    "action": "sale",
                    "status": "ok",
                    "referred_customer": "customer_456",
                    "customer": "customer_123",
                    "amount": 10.198,
                    "amount_units": "USD",
                    "is_currency": true,
                    "credit": false,
                    "created_at": "2025-05-12T17:56:15.000000Z",
                    "deleted_at": null,
                    "product_type_data": []
                },
                {
                    "key": "transaction_456_1_m",
                    "action": "sale",
                    "status": "ok",
                    "referred_customer": "customer_456",
                    "customer": "customer_456",
                    "amount": 5.099,
                    "amount_units": "USD",
                    "is_currency": true,
                    "credit": false,
                    "created_at": "2025-05-12T17:56:15.000000Z",
                    "deleted_at": null,
                    "product_type_data": []
                }
            ]
        },
        {
            "key": "transaction_456_2_m",
            "action": "sale",
            "amount": 100.99,
            "customer": "customer_123",
            "referred_customer": "customer_456",
            "credit": false,
            "is_currency": false,
            "amount_units": null,
            "created_at": "2025-05-12T17:56:15.000000Z",
            "deleted_at": null,
            "rewards": [
                {
                    "key": "transaction_456_2_m",
                    "action": "sale",
                    "status": "ok",
                    "referred_customer": "customer_456",
                    "customer": "customer_123",
                    "amount": 20.198,
                    "amount_units": "USD",
                    "is_currency": true,
                    "credit": false,
                    "created_at": "2025-05-12T17:56:15.000000Z",
                    "deleted_at": null,
                    "product_type_data": []
                },
                {
                    "key": "transaction_456_2_m",
                    "action": "sale",
                    "status": "ok",
                    "referred_customer": "customer_456",
                    "customer": "customer_456",
                    "amount": 10.099,
                    "amount_units": "USD",
                    "is_currency": true,
                    "credit": false,
                    "created_at": "2025-05-12T17:56:15.000000Z",
                    "deleted_at": null,
                    "product_type_data": []
                }
            ]
        }
    ],
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Fetch a transaction

Fetch an existing transaction.

GET https://api.partnero.com/v1/transactions/{key}

Request example

GET https://api.partnero.com/v1/transactions/transaction_456_1

Request parameters

ParametersTypeRequiredDetails
keystringyesTransaction key.

Response

{
    "data": {
        "key": "transaction_456_1",
        "action": "sale",
        "amount": 99.99,
        "partner": "customer_123",
        "customer": "customer_456",
        "credit": false,
        "is_currency": true,
        "amount_units": "USD",
        "created_at": "2025-05-12T17:50:17.000000Z",
        "deleted_at": null,
        "rewards": [
            {
                "key": "transaction_456_1",
                "action": "sale",
                "status": "ok",
                "referred_customer": "customer_456",
                "customer": "customer_123",
                "amount": 19.998,
                "amount_units": "USD",
                "is_currency": true,
                "credit": false,
                "created_at": "2025-05-12T17:50:17.000000Z",
                "deleted_at": null,
                "product_type_data": []
            },
            {
                "key": "transaction_456_1",
                "action": "sale",
                "status": "ok",
                "referred_customer": "customer_456",
                "customer": "customer_456",
                "amount": 9.999,
                "amount_units": "USD",
                "is_currency": true,
                "credit": false,
                "created_at": "2025-05-12T17:50:17.000000Z",
                "deleted_at": null,
                "product_type_data": []
            }
        ]
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Get a list of transactions

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

Request parameters

ParametersTypeRequiredLimitationsDetails
keystringoptionalTransaction ID.
limitintegernoA limit on the number of items to be returned. Limits can range between 1 and 250, and the default is 15.
pageintegernoThe default is 1.

Response

{
    "data": [
        {
            "key": "transaction_456_1",
            "action": "sale",
            "amount": 99.99,
            "customer": "customer_123",
            "referred_customer": "customer_456",
            "credit": false,
            "is_currency": true,
            "amount_units": "USD",
            "created_at": "2025-05-12T17:50:17.000000Z",
            "deleted_at": null,
            "rewards": [
                {
                    "key": "transaction_456_1",
                    "action": "sale",
                    "status": "ok",
                    "referred_customer": "customer_456",
                    "customer": "customer_123",
                    "amount": 19.998,
                    "amount_units": "USD",
                    "is_currency": true,
                    "credit": false,
                    "created_at": "2025-05-12T17:50:17.000000Z",
                    "deleted_at": null,
                    "product_type_data": []
                },
                {
                    "key": "transaction_456_1",
                    "action": "sale",
                    "status": "ok",
                    "referred_customer": "customer_456",
                    "customer": "customer_456",
                    "amount": 9.999,
                    "amount_units": "USD",
                    "is_currency": true,
                    "credit": false,
                    "created_at": "2025-05-12T17:50:17.000000Z",
                    "deleted_at": null,
                    "product_type_data": []
                }
            ]
        },
        ...
    ],
    "links": {
        "first": "https://api.partnero.com/v1/transactions?page=1",
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.partnero.com/v1/transactions",
        "per_page": 10,
        "to": 6
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Get customer's balance

Get the balance of a customer.

GET https://api.partnero.com/v1/customers/{id}/balance

Request example

GET https://api.partnero.com/v1/customers/customer_123/balance

Request parameters

ParametersTypeRequiredDetails
idstringyesMust provide unique customer identifier.

Response

{
    "data": {
        "customer": {
            "email": "alice.brown@partnero.com",
            "created_at": "2025-05-12T15:41:47.000000Z",
            "updated_at": "2025-05-12T15:41:47.000000Z",
            "name": "Alice",
            "id": "customer_123",
            "surname": "Brown",
            "tos": true,
            "approved": true,
            "status": "active",
            "custom_fields": [],
            "referring_customer": null,
            "referrals_count": 1,
            "metadata": {
                "date_of_birth": null
            },
            "referral_link": "https://partnero.com?ref=ref_123",
            "referral_links": [
                "https://partnero.com?ref=ref_123"
            ]
        },
        "balance": {
            "currency": [
                {
                    "amount": 39.998,
                    "amount_units": "USD",
                    "is_currency": true
                }
            ],
            "non_currency": [
                {
                    "reward_type": "custom",
                    "commission_type": "generic_coupon",
                    "reward_value": "APITEST001163HQ9",
                    "created_at": "2025-05-12T15:42:44.000000Z"
                }
            ]
        }
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Create credit note for a customer

Create a credit note for a customer balance.

POST https://api.partnero.com/v1/customers/{id}/balance/credit

Request example

POST https://api.partnero.com/v1/customers/customer_123/balance/credit
{
  "amount": 100,
  "amount_units": "USD",
  "is_currency": true
}

Request parameters

ParametersTypeRequiredDetails
idstringyesMust provide unique customer identifier.
amountnumberyesAmount to credit.
amount_unitsstringyesUnit of the amount.
is_currencybooleanyesWhether the amount is a currency. Possible values: true or false.

Response

{
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Delete a transaction

Delete an existing transaction.

DELETE https://api.partnero.com/v1/transactions/{key}

Request example

DELETE https://api.partnero.com/v1/transactions/transaction_456_1

Request parameters

ParametersTypeRequiredDetails
keystringyesTransaction key. Must provide key if not provided in URL.

Response

{
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json