Skip to main content
POST
/
v1
/
transactions
Create transaction
curl --request POST \
  --url https://api.example.com/v1/transactions
{
  "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
}

Endpoint

POST https://api.partnero.com/v1/transactions
Partnero automatically calculates the commission based on your program settings.

Request body

Transaction fields
ParameterTypeRequiredDescription
keystringNoUnique transaction ID (recommended for refund handling)
amountnumberYes*Transaction amount. Partnero calculates commission based on program settings
rewardnumberYes*Set the commission amount directly instead of calculating from amount
amount_unitsstringNoCurrency code (e.g., USD, EUR, GBP)
actionstringNoTransaction type (e.g., sale)
product_idstringNoProduct ID for advanced commission rules
product_typestringNoProduct type/category for advanced commission rules
rewardedbooleanNoWhether the transaction is already rewarded (default: false)
rewardablebooleanNoWhether the transaction is eligible for rewards (default: true)
created_atintegerNoUnix timestamp to backdate the transaction
*Provide either amount or reward. Customer identification
ParameterTypeRequiredDescription
customer.keystringYes*Customer’s unique key
customer.emailstringYes*Customer’s email (alternative to key)
*Provide at least one: key or email. Create customer with transaction (options.create_customer: true) When the customer doesn’t exist yet, you can create them and the transaction in a single request.
ParameterTypeDescription
options.create_customerbooleanCreate customer and transaction simultaneously
customer.namestringCustomer’s first name
customer.surnamestringCustomer’s last name
customer.tagsarrayTags to assign to the customer
customer.created_atstringCustomer creation date
customer.partner.keystringPartner key for attribution
customer.partner.idstringPartner ID for attribution
customer.partner.emailstringPartner email for attribution
options.referral_urlstringReferral URL for custom link attribution
Multiple products For transactions with multiple products:
ParameterTypeDescription
productsarrayArray of product objects
products[].product_idstringProduct ID (required)
products[].product_pricenumberProduct price (required)
Bulk transactions
ParameterTypeDescription
transactionsarrayArray of transaction objects for bulk creation
transactions[].amountnumberTransaction amount (required)
transactions[].keystringUnique transaction ID
transactions[].actionstringTransaction type
transactions[].amount_unitsstringCurrency code
transactions[].product_idstringProduct ID
transactions[].product_typestringProduct type
transactions[].rewardedbooleanAlready rewarded
transactions[].rewardablebooleanEligible for rewards

Request

curl --location 'https://api.partnero.com/v1/transactions' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "customer": {
      "key": "customer_123"
    },
    "key": "transaction_123",
    "amount": 99.99,
    "amount_units": "USD",
    "product_id": "prod_123",
    "product_type": "monthly",
    "action": "sale"
  }'

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
}

Response fields

FieldTypeDescription
keystringTransaction identifier
actionstringTransaction type
amountnumberTransaction amount
amount_unitsstringCurrency code
partnerstringAttributed partner key
customerstringCustomer key
creditbooleanWhether this is a credit transaction
is_currencybooleanWhether the amount is monetary
created_atstringISO 8601 timestamp
deleted_atstring|nullDeletion timestamp if archived/refunded
FieldTypeDescription
keystringReward identifier (matches transaction key)
actionstringReward origin
statusstringReward status (ok, review_period, rejected)
customerstringCustomer key
partnerstringPartner key
amountnumberCommission amount
amount_unitsstringCurrency code
is_currencybooleanWhether the amount is monetary
creditbooleanWhether this is a credit reward
created_atstringISO 8601 timestamp
deleted_atstring|nullDeletion timestamp
product_type_dataobjectProduct ID and type (if provided)

Error responses

StatusErrorSolution
400Customer not foundCreate customer first or use options.create_customer
400Duplicate keyTransaction with this key already exists
422Validation errorCheck required fields (amount/reward and customer identification)
Use unique transaction keys (like invoice IDs) to enable refund handling. When you delete a transaction by key, the associated commission is automatically reversed.