Prepaid Balances
Prepaid Balances are like giftcards, though directly linked to a Contact. You can use a prepaid balance as a small digital wallet for your contacts, where they can store a balance in cents. There are calls for showing a contact's prepaid balance, as well as making a transaction on it.
Create Prepaid Transaction
This API call generates a Prepaid Transaction for a specified Contact. Necessary parameters include either the Contact's UUID or their unique identifier value, the amount in cents for the transaction, and the Shop UUID where the transaction is occurring. Using this method ensures and accurate and up-to-date record of the Contact's Prepaid balance.
POST
https://api.piggy.eu/api//prepaid-transactionsHeaders
Authorization
Bearer {{ api_key }}Accept
application/jsonBody
contact_uuidstringREQUIRED_WITHOUTThe UUID of the Contact you want to create the Prepaid Transaction for. Required without contact_identifier_value.
contact_identifier_valuestringREQUIRED_WITHOUTThe Contact Identifier used to conduct the transaction. Required without contact_uuid.
amount_in_centsintegerREQUIREDThe amount for the transaction, supply a round number in cents.
shop_uuidstringREQUIREDThe UUID of the Shop where the transaction takes place.
Response Example
Show more
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"data": {
"uuid": "3cff98cb-644e-4148-bf34-bac842ac602e",
"amount_in_cents": -1000,
"prepaid_balance": {
"balance_in_cents": 4000,
"balance": "€40.00"
},
"created_at": "2023-11-12T19:49:22+00:00",
"shop": {
"id": 15,
"uuid": "123123",
"reference": null,
"name": "Krusty Krab"
},
"contact_identifier": {
"name": "Krabby Membership",
"value": "cilwjefwnsvidjfkjskjf",
"active": true
}
},
"meta": []
}Code
Message
1003Invalid input.
55031Contact not found.
60003Contact identifier not found.
60004Contact identifier inactive.
1008Shop not found.
