Leat Docs
Register APIGiftcard & Prepaid

Prepaid Transactions

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

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-transactions

Headers

Authorization

Bearer {{ api_key }}

Accept

application/json

Body

contact_uuid string

REQUIRED_WITHOUT

The UUID of the Contact you want to create the Prepaid Transaction for. Required without contact_identifier_value.

contact_identifier_value string

REQUIRED_WITHOUT

The Contact Identifier used to conduct the transaction. Required without contact_uuid.

amount_in_cents integer

REQUIRED

The amount for the transaction, supply a round number in cents.

shop_uuid string

REQUIRED

The UUID of the Shop where the transaction takes place.

Response Example

{
    "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

1003

Invalid input.

55031

Contact not found.

60003

Contact identifier not found.

60004

Contact identifier inactive.

1008

Shop not found.

On this page