Transactions

Transactions represent sales actions made by the customers.

Create a transaction

Create a new transaction.

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

Request example

{
    "customer": {
        "key": "customer_123"
    },
    "key": "transaction_123",
    "amount": 99.99,
    "product_id": "prod_123",  // optional
    "product_type": "monthly", // optional
    "action": "sale"
}
{
    "key": "transaction_456",
    "amount": 50.99,
    "action": "sale",
    "options": {
        "create_customer": true // use this option to create a customer and a transaction at the same time
    },
    "customer": {
        "key": "customer_456",
        "name": "Robert",
        "surname": "Johnson",
        "email": "robert.johnson@partnero.com",
        "partner": {
            "id": "partner_123"
        }
    }
}
{
    "customer": {
        "key": "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": {
        "key": "customer_789",
        "name": "Katy",
        "surname": "Perry",
        "email": "katy.perry@partnero.com",
        "partner": {
            "id": "partner_123"
        }
    },
    "transactions": [
        {
            "key": "transaction_123_3",
            "amount": 110.99,
            "action": "sale"
        },
        {
            "key": "transaction_123_4",
            "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.
product_idstringoptionalProduct ID. It is used to for advanced commission calculation.
product_typestringoptionalProduct type or category. It is used to for advanced commission calculation.
optionsobject[]optional
options.create_customerstringoptionaltrue or falseUse this option to create a customer and a transaction at the same time.
customerobject[]yesCustomer data.
customer.keystringyes*Customer identification. The same value from customer creation. Must provide either 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.partnerobject[]optionalPartner data. Can be used when the customer is being created at the same time.
customer.partner.keystringoptionalPartner's referral 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.

Response

{
    "data": {
        "key": "transaction_123",
        "action": "sale",
        "amount": 99.99,
        "partner": "partner_123",
        "customer": "customer_123",
        "credit": false,
        "is_currency": true,
        "amount_units": "USD",
        "created_at": "2025-05-07T05:32:48.000000Z",
        "deleted_at": null,
        "rewards": [
            {
                "key": "transaction_123",
                "action": "sale",
                "status": "ok",
                "customer": "customer_123",
                "partner": "partner_123",
                "amount": 29.997,
                "amount_units": "USD",
                "is_currency": true,
                "credit": false,
                "created_at": "2025-05-07T05:32:48.000000Z",
                "deleted_at": null,
                "product_type_data": {
                    "product_id": "prod_123",
                    "product_type": "monthly"
                }
            }
        ]
    },
    "status": 1
}
{
    "data": [
        {
            "key": "transaction_123_m",
            "action": "sale",
            "amount": 50.99,
            "partner": "partner_123",
            "customer": "customer_123",
            "credit": false,
            "is_currency": true,
            "amount_units": "USD",
            "created_at": "2025-05-07T12:33:52.000000Z",
            "deleted_at": null,
            "rewards": [
                {
                    "key": "transaction_123_m",
                    "action": "sale",
                    "status": "ok",
                    "customer": "customer_123",
                    "partner": "partner_123",
                    "amount": 15.297,
                    "amount_units": "USD",
                    "is_currency": true,
                    "credit": false,
                    "created_at": "2025-05-07T12:33:52.000000Z",
                    "deleted_at": null,
                    "product_type_data": []
                }
            ]
        },
        {
            "key": "transaction_456_m",
            "action": "sale",
            "amount": 100.99,
            "partner": "partner_123",
            "customer": "customer_123",
            "credit": false,
            "is_currency": true,
            "amount_units": "USD",
            "created_at": "2025-05-07T12:33:52.000000Z",
            "deleted_at": null,
            "rewards": [
                {
                    "key": "transaction_456_m",
                    "action": "sale",
                    "status": "ok",
                    "customer": "customer_123",
                    "partner": "partner_123",
                    "amount": 30.297,
                    "amount_units": "USD",
                    "is_currency": true,
                    "credit": false,
                    "created_at": "2025-05-07T12:33:52.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_123

Request parameters

ParametersTypeRequiredDetails
keystringyesTransaction key.

Response

{
    "data": {
        "key": "transaction_123",
        "action": "sale",
        "amount": 99.99,
        "partner": "partner_123",
        "customer": "customer_123",
        "credit": false,
        "is_currency": true,
        "amount_units": "USD",
        "created_at": "2025-05-07T10:22:38.000000Z",
        "deleted_at": null,
        "rewards": [
            {
                "key": "transaction_123",
                "action": "sale",
                "status": "ok",
                "customer": "customer_123",
                "partner": "partner_123",
                "amount": 29.997,
                "amount_units": "USD",
                "is_currency": true,
                "credit": false,
                "created_at": "2025-05-07T10:22:38.000000Z",
                "deleted_at": null,
                "product_type_data": {
                    "product_id": "prod_123",
                    "product_type": "monthly"
                }
            }
        ]
    },
    "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_123",
            "action": "sale",
            "amount": 99.99,
            "partner": "partner_123",
            "customer": "customer_123",
            "credit": false,
            "is_currency": true,
            "amount_units": "USD",
            "created_at": "2025-05-07T05:32:48.000000Z",
            "deleted_at": null,
            "rewards": [
                {
                    "key": "transaction_123",
                    "action": "sale",
                    "status": "ok",
                    "customer": "customer_123",
                    "partner": "partner_123",
                    "amount": 29.997,
                    "amount_units": "USD",
                    "is_currency": true,
                    "credit": false,
                    "created_at": "2025-05-07T05:32:48.000000Z",
                    "deleted_at": null,
                    "product_type_data": {
                        "product_id": "prod_123",
                        "product_type": "monthly"
                    }
                }
            ]
        },
        ...
    ],
    "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": 2
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Archive a transaction

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

Request example

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

Request parameters

ParametersTypeRequiredDetails
keystringyesTransaction key.

Response

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

Revoke archived transaction

Revoke archived transaction.

POST https://api.partnero.com/v1/transactions/{key}/revoke-archive

Request example

POST https://api.partnero.com/v1/transactions/transaction_123/revoke-archive

Request parameters

ParametersTypeRequiredDetails
keystringyesTransaction key.

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_123

Request parameters

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

Response

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