Open the panel

Store Credit PRO ​

Store credit is a balance a customer can spend on anything in your store, in any vendor, for all or part of the price. Each time you give credit it can have its own expiry ("valid for 30 days"); the customer sees one balance, and the credit that expires first is spent first. Unlike a gift card, it has no code, no scope and no card to send.

Store credit of a customer ​

GET/customers/{key}/credit
Scope credit:readLimit read (600 per minute)

Path

NameTypeRequiredDescription
keystringYesAvatar UUID (key).

Example

bash
curl "https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit" \
  -H "Authorization: Bearer $FASTY_KEY"
js
const res = await fetch('https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit', {
  headers: {
    Authorization: `Bearer ${process.env.FASTY_KEY}`,
  },
})
const data = await res.json()
python
import os, requests

res = requests.get(
    "https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit",
    headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}"},
)
data = res.json()
lsl
llHTTPRequest(API + "/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit",
    [HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
     HTTP_BODY_MAXLENGTH, 16384],
    "");

Response: 200 OK

json
{
  "avatar_key": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "balance": 350,
  "next_expiry": {
    "amount": 250,
    "expires_at": "2026-12-14T18:27:03.848Z"
  },
  "lots": [
    {
      "id": "5d0c2f6e-8a41-4b7e-9c3d-2e6f1a7b8c90",
      "balance": 250,
      "value": 250,
      "expires_at": "2026-12-14T18:27:03.848Z",
      "source": "panel",
      "note": "Sorry for the late delivery",
      "created_at": "2026-11-14T18:27:03.844Z"
    },
    {
      "id": "0a9e7d3c-1f2b-4c5d-8e6f-7a8b9c0d1e2f",
      "balance": 100,
      "value": 100,
      "expires_at": null,
      "source": "panel",
      "note": "",
      "created_at": "2026-11-02T15:10:41.120Z"
    }
  ]
}

Give store credit ​

POST/customers/{key}/credit
Scope credit:writeLimit change (120 per minute)

Store credit works on anything in the store, in any vendor (all or part of the price; the rest in L$). Send only amount for credit that never expires, or amount and days ("valid for 30 days"). Each call is a lot with its own expiry; the customer sees one balance.

Send {"amount": 250} for credit that never expires, or {"amount": 250, "days": 30} for credit valid for 30 days. The customer gets an IM in Second Life; send "notify": false to give it quietly.

Always send an Idempotency-Key

Without one, a retry after a timeout gives the credit twice.

Path

NameTypeRequiredDescription
keystringYesAvatar UUID (key).

Body

NameTypeRequiredDescription
amountintegerYesL$ of store credit to give. From 1 to 1,000,000.
daysinteger or nullNoValid for this many days from now. Leave it out (or null) for credit that never expires. From 1 to 3,650.
notestringNoOnly the store sees it. Up to 200 characters.
notifybooleanNoSend the customer an IM in Second Life (default true).

Example

bash
curl -X POST "https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit" \
  -H "Authorization: Bearer $FASTY_KEY" \
  -H "Idempotency-Key: my-unique-id-123" \
  -H "Content-Type: application/json" \
  -d '{"amount":250,"days":30,"note":"Sorry for the late delivery"}'
js
const res = await fetch('https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.FASTY_KEY}`,
    'Idempotency-Key': 'my-unique-id-123',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"amount":250,"days":30,"note":"Sorry for the late delivery"}),
})
const data = await res.json()
python
import os, requests

res = requests.post(
    "https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit",
    headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}", "Idempotency-Key": "my-unique-id-123"},
    json={"amount":250,"days":30,"note":"Sorry for the late delivery"},
)
data = res.json()
lsl
llHTTPRequest(API + "/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit",
    [HTTP_METHOD, "POST",
     HTTP_MIMETYPE, "application/json",
     HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
     HTTP_CUSTOM_HEADER, "Idempotency-Key", "my-unique-id-123"],
    "{\"amount\":250,\"days\":30,\"note\":\"Sorry for the late delivery\"}");

Response: 201 Created

json
{
  "avatar_key": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "lot_id": "5d0c2f6e-8a41-4b7e-9c3d-2e6f1a7b8c90",
  "amount": 250,
  "expires_at": "2026-12-14T18:27:03.848Z",
  "balance": 350
}

Remove store credit ​

POST/customers/{key}/credit/remove
Scope credit:writeLimit change (120 per minute)

Comes out of the lots that expire first. Credit held right now for a payment in a vendor stays.

Taking more than the balance stops at zero, and removed says what really came out.

Path

NameTypeRequiredDescription
keystringYesAvatar UUID (key).

Body

NameTypeRequiredDescription
amountintegerYesL$ to remove. More than the balance stops at zero. From 1 to 1,000,000.
notestringNoA note, kept in the history. Up to 120 characters.

Example

bash
curl -X POST "https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit/remove" \
  -H "Authorization: Bearer $FASTY_KEY" \
  -H "Idempotency-Key: my-unique-id-123" \
  -H "Content-Type: application/json" \
  -d '{"amount":50,"note":"Given by mistake"}'
js
const res = await fetch('https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit/remove', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.FASTY_KEY}`,
    'Idempotency-Key': 'my-unique-id-123',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"amount":50,"note":"Given by mistake"}),
})
const data = await res.json()
python
import os, requests

res = requests.post(
    "https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit/remove",
    headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}", "Idempotency-Key": "my-unique-id-123"},
    json={"amount":50,"note":"Given by mistake"},
)
data = res.json()
lsl
llHTTPRequest(API + "/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit/remove",
    [HTTP_METHOD, "POST",
     HTTP_MIMETYPE, "application/json",
     HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
     HTTP_CUSTOM_HEADER, "Idempotency-Key", "my-unique-id-123"],
    "{\"amount\":50,\"note\":\"Given by mistake\"}");

Response: 200 OK

json
{
  "avatar_key": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "removed": 50,
  "balance": 300
}

The store credit object ​

FieldTypeDescription
avatar_keystringAvatar UUID (key).
balanceintegerStore credit the customer can use now, in L$. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
next_expiryobject or nullThe next lot to expire, or null when nothing expires.
next_expiry.amountintegerAmount in L$. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
next_expiry.expires_atstringISO 8601 date and time (UTC).
lotsarray of objectsLots with balance, the first to expire first (that is also the order they are spent in). Up to 60.
lots[].idstringThe id.
lots[].balanceintegerL$ left in this lot. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
lots[].valueintegerL$ given in this lot. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
lots[].expires_atstring or nullWhen what is left expires (null = never).
lots[].sourcestringpanel, import…
lots[].notestringA note, kept in the history.
lots[].created_atstringISO 8601 date and time (UTC).