Migrate transactions
Migrate transactions from an old system to Masivo
curl --request POST \
--url https://app.masivo.ai/api/storefront/v1/customers/migrate/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"customers": [
{
"id": "<string>",
"transactions": [
{
"brand_id": "<string>",
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<string>",
"type": "ACCUMULATION",
"issued_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"amount": 123,
"cost": 123,
"store_id": "<string>",
"channel_id": "<string>",
"event": {
"type": "PURCHASE",
"order": {
"purchase_id": "<string>",
"channel_id": "<string>",
"store_id": "<string>",
"value": 20.95,
"discounted_value": 10.95,
"products": [
{
"sku": "<string>",
"amount": 123,
"value": 123,
"discounted_value": 123,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
}
],
"shipping": {
"value": 3.25,
"discounted_value": 2.25,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
},
"payment_method": "CREDIT",
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"metadata": {}
}
},
"funded_by": "<string>"
}
]
}
]
}'
This response does not have an example.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Your customer unique identifier
What brand triggered this transaction
What reward was earned or spent
Why was this transaction created
What kind of transaction is it
ACCUMULATION
, REDEMPTION
, EXPIRATION
, MIGRATION
, TRANSFER
, REVERSAL
When was the transaction requested to be created
When did the transaction took effect
Negative if customer spent, positive if earned
Total cost of the given rewards
What store triggered this transaction
What channel triggered this transaction
Data of the event that triggered this transaction
The type of the event
"PURCHASE"
The order in case of a PURCHASE event
The id of a placed order in your system
The order total or subtotal
20.95
The order total or subtotal after discounts
10.95
The payment method used in the order
CREDIT
, DEBIT
, CASH
, BANK_TRANSFER
, OTHER
The channel unique identifier in your system
The store unique identifier in your system
The shipping information of the order
The rewards to redeem in the order
The metadata of the order
Who funded the rewards used in this transaction
Response
Customer transactions enqueued successfully
curl --request POST \
--url https://app.masivo.ai/api/storefront/v1/customers/migrate/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"customers": [
{
"id": "<string>",
"transactions": [
{
"brand_id": "<string>",
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": "<string>",
"type": "ACCUMULATION",
"issued_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"amount": 123,
"cost": 123,
"store_id": "<string>",
"channel_id": "<string>",
"event": {
"type": "PURCHASE",
"order": {
"purchase_id": "<string>",
"channel_id": "<string>",
"store_id": "<string>",
"value": 20.95,
"discounted_value": 10.95,
"products": [
{
"sku": "<string>",
"amount": 123,
"value": 123,
"discounted_value": 123,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
}
],
"shipping": {
"value": 3.25,
"discounted_value": 2.25,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
},
"payment_method": "CREDIT",
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"metadata": {}
}
},
"funded_by": "<string>"
}
]
}
]
}'
This response does not have an example.