Create a transaction
curl --request POST \
--url https://rewardservice-staging.withbenji.com/reward_transaction/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"reward_authentication_token": "<string>"
}
'{
"code": "ok",
"data": {
"reward_transactions": [{
"created_date": "2024-08-23T19:55:12.015047+00:00",
"last_updated_date": "2024-08-23T19:57:12.015047+00:00",
"status": 2,
"external_order_id": "5856681787572",
"id": 1,
"merchant_id": 1,
"partner_id": 1,
"campaign_id": 1,
"reward_amount": 266,
"transaction_amount": 885.95,
"transaction_type": 1,
"user_id": 1
}]
}
}
Create a transaction
Create a transaction using the reward transaction authentication token from the previous step.
POST
/
reward_transaction
/
create
Create a transaction
curl --request POST \
--url https://rewardservice-staging.withbenji.com/reward_transaction/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"reward_authentication_token": "<string>"
}
'{
"code": "ok",
"data": {
"reward_transactions": [{
"created_date": "2024-08-23T19:55:12.015047+00:00",
"last_updated_date": "2024-08-23T19:57:12.015047+00:00",
"status": 2,
"external_order_id": "5856681787572",
"id": 1,
"merchant_id": 1,
"partner_id": 1,
"campaign_id": 1,
"reward_amount": 266,
"transaction_amount": 885.95,
"transaction_type": 1,
"user_id": 1
}]
}
}
Documentation Index
Fetch the complete documentation index at: https://docs.withbenji.com/llms.txt
Use this file to discover all available pages before exploring further.
The
x-api-key header value to be used on this API is a user-based access token.The token received from the authenticate reward transaction API call.
Return values
An array of reward transaction objects created with this transaction
Hide items
Hide items
A reward transaction object property
Hide properties
Hide properties
Benji Platform reward transaction identifier
The ID of the partner associated with this transaction in the Benji Platform
The ID of the campaign triggered for this transaction in the Benji Platform
The ID of the user associated with the transaction in the Benji Platform
The ID of the merchant partner associated with this campaign in the Benji Platform
The total dollar amount of the transaction
The total amount of rewards earned or redeemed on this transaction
The external reference of the order on the merchant partner system
Integer representing an enum of one of the following transaction type values:
Show possible transaction type values
Show possible transaction type values
- EARN (1) : Indicating an earn transaction type
- REDEEM (2) : Indicating a redeem transaction type
Integer representing an enum of one of the following transaction status values:
Show possible transaction status values
Show possible transaction status values
- PENDING (1) : Indicating a transaction that is pending and has not been confirmed by the partner yet
- CONFIRMED (2) : Indicating a transaction that has been confirmed by the partner
- FAILED (3) : Indicating a transaction that has been rejected by the partner
If status is FAILED, the reason why this transaction was rejected
Datetime indicating the last status change. For instance, if the status is CONFIRMED, this date will indicate when the transaction was confirmed
The transaction date
{
"code": "ok",
"data": {
"reward_transactions": [{
"created_date": "2024-08-23T19:55:12.015047+00:00",
"last_updated_date": "2024-08-23T19:57:12.015047+00:00",
"status": 2,
"external_order_id": "5856681787572",
"id": 1,
"merchant_id": 1,
"partner_id": 1,
"campaign_id": 1,
"reward_amount": 266,
"transaction_amount": 885.95,
"transaction_type": 1,
"user_id": 1
}]
}
}
Make sure to store the returned reward transaction ID. You can use this ID to get the status of the reward transaction when receiving reward_transaction_update webhooks.
The transaction authentication token is valid for 10 minutes.
Was this page helpful?
⌘I