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
/customers/{key}/creditPath
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Avatar UUID (key). |
Example
curl "https://api.fastyvendor.com/api/v1/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit" \
-H "Authorization: Bearer $FASTY_KEY"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()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()llHTTPRequest(API + "/customers/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/credit",
[HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
HTTP_BODY_MAXLENGTH, 16384],
"");Response: 200 OK
{
"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
/customers/{key}/creditStore 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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Avatar UUID (key). |
Body
| Name | Type | Required | Description |
|---|---|---|---|
amount | integer | Yes | L$ of store credit to give. From 1 to 1,000,000. |
days | integer or null | No | Valid for this many days from now. Leave it out (or null) for credit that never expires. From 1 to 3,650. |
note | string | No | Only the store sees it. Up to 200 characters. |
notify | boolean | No | Send the customer an IM in Second Life (default true). |
Example
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"}'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()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()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
{
"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
/customers/{key}/credit/removeComes 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
| Name | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Avatar UUID (key). |
Body
| Name | Type | Required | Description |
|---|---|---|---|
amount | integer | Yes | L$ to remove. More than the balance stops at zero. From 1 to 1,000,000. |
note | string | No | A note, kept in the history. Up to 120 characters. |
Example
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"}'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()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()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
{
"avatar_key": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"removed": 50,
"balance": 300
}The store credit object
| Field | Type | Description |
|---|---|---|
avatar_key | string | Avatar UUID (key). |
balance | integer | Store credit the customer can use now, in L$. From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
next_expiry | object or null | The next lot to expire, or null when nothing expires. |
next_expiry.amount | integer | Amount in L$. From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
next_expiry.expires_at | string | ISO 8601 date and time (UTC). |
lots | array of objects | Lots with balance, the first to expire first (that is also the order they are spent in). Up to 60. |
lots[].id | string | The id. |
lots[].balance | integer | L$ left in this lot. From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
lots[].value | integer | L$ given in this lot. From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
lots[].expires_at | string or null | When what is left expires (null = never). |
lots[].source | string | panel, import… |
lots[].note | string | A note, kept in the history. |
lots[].created_at | string | ISO 8601 date and time (UTC). |