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
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 | Currency code. e.g. USD, EUR, GBP etc. | |
action | string | yes | Can be anything, but we prefer sale . It's visible in the program. | |
rewarded | boolean | optional | If the transaction is already rewarded. Defaults to false . | |
rewardable | boolean | optional | If the transaction is rewardable. Defaults to true . | |
product_id | string | optional | Product ID. It is used to for advanced commission calculation. | |
product_type | string | optional | Product type or category. It is used to for advanced commission 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. |
customer | object[] | yes | Customer data. | |
customer.key | string | yes* | Customer identification. The same value from customer creation. Must provide either key or email | |
customer.email | string | yes* | Customer email address. Must provide either key or email | |
customer.name | string | optional | Customer name. | |
customer.surname | string | optional | Customer surname. | |
customer.created_at | string | optional | Customer created at. | |
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 referral 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 . |
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
Parameters | Type | Required | Details |
---|---|---|---|
key | string | yes | Transaction 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
Parameters | Type | Required | Limitations | Details |
---|---|---|---|---|
key | string | optional | Transaction ID. | |
limit | integer | no | A limit on the number of items to be returned. Limits can range between 1 and 250, and the default is 15. | |
page | integer | no | The 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
Parameters | Type | Required | Details |
---|---|---|---|
key | string | yes | Transaction 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
Parameters | Type | Required | Details |
---|---|---|---|
key | string | yes | Transaction 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
Parameters | Type | Required | Details |
---|---|---|---|
key | string | yes | Transaction key. Must provide key if not provided in URL. |
Response
{
"status": 1
}
Response Code: 200 OK
Content-Type: application/json