Member transactions and invoices

Inspect stored transaction outcomes, request receipt generation and retrieve an invoice stream. Local records, provider settlement, invoice/receipt documents and content permission are distinct results; start with the User subscriptions and Pricing selection.

TaskOperation
List transactions in this resourceTransaction list
Inspect one visible transactionTransaction detail
Render/download its invoiceInvoice download
Request stored receipt generationGenerate receipt

Read transactions in this resource

GET /api/v1/user/transactions

Lists this member's transactions restricted to the supplied resource. It does not filter to successful/settled statuses. Purchases and receipts are conditional read projections, not confirmation of provider completion.

Before you call

Establish member identity or configured Firebase identity. Requires active/unlocked context, user role/inherited permission and a valid resource. No writes or receipt generation are requested by this read.

Request

GET with no body/Content-Type.

NameLocationTypeRequirement / defaultMeaning
resourceheaderstringrequired contextPublic resource key selecting the member session and operation context.
tokenheaderstringmember contextExisting Wallkit token; user role or inherited permission.
firebase-tokenheaderstringFirebase-enabled contextConfigured provider ID token alongside Wallkit token; see credentials.
pagequeryintegeroptional; examples pass 1No explicit omitted-page default in the paginator call.
limitqueryintegeroptional; configured results_on_page (documented default: 10)Page size. Pass explicitly; omitted response limit uses controller default 10 and can differ if configuration changes.
filterqueryobject / JSON stringoptionalCriteriaFilter recognizes Transactions/Purchases field metadata, but this query does not join Purchases. Use transaction fields; do not rely on purchase-field filtering here.

Text criteria use substring matching; numeric fields accept supported scalar/comparison/array conditions. Invalid parsed criteria return HTTP 400. This action does not apply the criteria's ordering function; no stable sort order or working order/by/sort override is established. Do not infer newest-first from another list.

Result

HTTP 200 JSON items[] and paginator. Each item uses the account transaction projection, including conditional user/card/refunds/purchases/receipt/payment_source. Provider data is dynamic and recorded status can reflect the earlier confirmation operation's local assignment.

Example: inspect recorded transaction 4001

Use sample runtimes; the member's selected resource contains transaction 4001.

cURL

curl "${WALLKIT_API_BASE}/api/v1/user/transactions?page=1&limit=10" \
  -H "resource: ${RESOURCE_KEY}" \
  -H "token: ${USER_TOKEN}"

JavaScript

// Node.js 18+; built-in fetch.
async function main() {
  const url = new URL("/api/v1/user/transactions", process.env.WALLKIT_API_BASE);
  url.searchParams.set("page", "1");
  url.searchParams.set("limit", "10");
  const response = await fetch(url, { method: "GET", headers: {
    resource: process.env.RESOURCE_KEY, token: process.env.USER_TOKEN
  }});
  console.log(response.status, await response.json());
}
main().catch(console.error);

Python

# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen

url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/user/transactions") + "?" + urlencode({'page': '1', 'limit': '10'})
headers = {"resource": os.environ["RESOURCE_KEY"], "token": os.environ["USER_TOKEN"]}
request = Request(url, headers=headers, method="GET")
try:
    with urlopen(request) as response:
        print(response.status, json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))

HTTP 200 excerpt:

{"items":[{"id":4001,"status":"succeeded","amount":1200,"currency":"USD","purchases":[{"id":5001,"item_type":"subscription","item_id":2001,"amount":1200}],"receipt":null,"payment_source":null}]}

A missing receipt means no selected receipt record was returned, not a failed transaction. Missing source mapping is not proof of a free charge. Read the full field projection for other returned fields.

Consequential alternate: no matching resource history

HTTP 200 excerpt:

{"items":[]}

Show an empty state in this resource; this does not establish that the member has no purchases/transactions in other resources.

Recovery

HTTPCode / responseCauseNext action
401auth_failed / auth_access_failMissing member or account/resource lock/suspension.Check existing session/resource context or administrator restrictions.
404resource_not_existsInvalid required header resource.Correct the supplied public resource key.
400invalid_filter / invalid_filter_date, with descriptionCriteria construction/validation fails.Correct the filter's supported field/value/date format; avoid unjoined purchase fields.
200items:[]No member/resource/filter match.Check scope/filter and show an empty state.

Other filter validation failures use invalid_ plus the failing field name; inspect description rather than a guessed closed error-code list.

Next task

Select an item.id for transaction detail. If a receipt is absent and the intended transaction qualifies, use generation request.

Read one transaction

GET /api/v1/user/transactions/{id}

Inspect the stored record with its purchases and conditional document/source details. Ordinary members must own the transaction; resource administrators can pass the source's administrator check. Unlike the list, this lookup does not require the transaction to belong to the header’s resource. A valid header resource is still required for context/administrator evaluation.

Before you call

Use an existing local transaction ID from returned account history. Preserve the intended account/resource association. This read does not confirm a charge, create a purchase or request a receipt.

Request

GET with no body/Content-Type; user role/inherited permission, active context and required resource.

NameLocationTypeRequirementMeaning
resourceheaderstringrequired contextPublic resource key selecting the member session and operation context.
tokenheaderstringmember contextExisting Wallkit token; user role or inherited permission.
firebase-tokenheaderstringFirebase-enabled contextConfigured provider ID token alongside Wallkit token; see credentials.
idpathinteger, digitsrequiredLocal Wallkit transaction ID, not provider transaction_id.

Result

HTTP 200 JSON account transaction fields directly at the top level, not item/items wrapper. A nullable receipt or empty purchases/refunds are valid conditional outcomes.

Example: inspect transaction 4001

Use sample runtimes; this member owns transaction 4001.

cURL

curl "${WALLKIT_API_BASE}/api/v1/user/transactions/4001" \
  -H "resource: ${RESOURCE_KEY}" \
  -H "token: ${USER_TOKEN}"

JavaScript

// Node.js 18+; built-in fetch.
async function main() {
  const url = new URL("/api/v1/user/transactions/4001", process.env.WALLKIT_API_BASE);
  
  const response = await fetch(url, { method: "GET", headers: {
    resource: process.env.RESOURCE_KEY, token: process.env.USER_TOKEN
  }});
  console.log(response.status, await response.json());
}
main().catch(console.error);

Python

# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen

url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/user/transactions/4001")
headers = {"resource": os.environ["RESOURCE_KEY"], "token": os.environ["USER_TOKEN"]}
request = Request(url, headers=headers, method="GET")
try:
    with urlopen(request) as response:
        print(response.status, json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))

HTTP 200 excerpt:

{"id":4001,"status":"succeeded","amount":1200,"currency":"USD","purchases":[{"id":5001,"item_type":"subscription","item_id":2001,"amount":1200}],"receipt":null,"refunds":[]}

This describes recorded account state. The absent receipt needs a separate generation/availability decision; succeeded is not independent provider settlement evidence for every originating flow.

Consequential alternate: missing/not visible

HTTP 404:

{"error":"transaction_not_exists","error_description":"Transactions not found","req_guid":"example-request"}

The same response covers missing record and a transaction not owned by a non-admin caller. Do not use it to distinguish another user's record existence.

Recovery

HTTPCode / responseCauseNext action
401auth_failed / auth_access_failMissing member or account/resource lock/suspension.Check existing session/resource context or administrator restrictions.
404resource_not_existsInvalid required header resource.Correct the supplied public resource key.
404transaction_not_existsRecord missing or not visible to this caller.Use an ID from this member's history and preserve the intended resource/context.

Next task

Use invoice download for an on-demand invoice stream, or generation for the separately stored receipt. A returned receipt.download_link goes to receipt download.

Render and download a transaction invoice

GET /api/v1/user/transactions/{id}/download

Renders the transaction's invoice view into a PDF response. This GET performs rendering; it does not request the separately stored receipt-generation flow. No successful-status restriction is checked here, so a downloadable invoice is not evidence of settled payment.

Before you call

Requires active member context, user-role/inherited permission and valid resource. Non-admin lookup requires transaction owner; administrator context can retrieve by ID. The lookup does not require the transaction to belong to the header’s resource. Select a known local transaction ID belonging to the intended account/context.

Request

GET with no body/Content-Type.

NameLocationTypeRequirementMeaning
resourceheaderstringrequired contextPublic resource key selecting the member session and operation context.
tokenheaderstringmember contextExisting Wallkit token; user role or inherited permission.
firebase-tokenheaderstringFirebase-enabled contextConfigured provider ID token alongside Wallkit token; see credentials.
idpathinteger, digitsrequiredLocal transaction ID.

Result

Successful binary PDF stream, not a JSON envelope. The handler sets no explicit success status. The generator sets Content-Type application/force-download and invokes the PDF library's Output with filename Transaction_4001.pdf for this ID. The library can manage final stream headers; no fixed Content-Disposition/header override guarantee is established by the handler. This is direct output, not a redirect URL.

Example: retrieve transaction 4001's invoice

Use sample runtimes. Adapt the binary response separately from JSON error bodies; never unconditionally call response.json for this operation.

cURL

curl "${WALLKIT_API_BASE}/api/v1/user/transactions/4001/download" \
  -H "resource: ${RESOURCE_KEY}" \
  -H "token: ${USER_TOKEN}" \
  --dump-header download-headers.txt \
  --output download-body.bin

Inspect download-headers.txt and HTTP status before treating download-body.bin as a PDF; the request can return JSON errors. These are illustrative local output filenames, not files created during authoring.

JavaScript

// Node.js 18+; built-in fetch. Separate binary from JSON errors.
async function main() {
  const url = new URL("/api/v1/user/transactions/4001/download", process.env.WALLKIT_API_BASE);
  const response = await fetch(url, { method: "GET", headers: { resource: process.env.RESOURCE_KEY, token: process.env.USER_TOKEN } });
  const mediaType = response.headers.get("content-type") || "";
  if (mediaType.includes("application/json")) {
    console.log(response.status, await response.json());
  } else if (!response.ok) {
    console.log(response.status, await response.text());
  } else {
    const bytes = await response.arrayBuffer();
    console.log(response.status, mediaType, bytes.byteLength);
  }
}
main().catch(console.error);

Python

# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen

url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/user/transactions/4001/download")
request = Request(url, headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["USER_TOKEN"]}, method="GET")
try:
    with urlopen(request) as response:
        media_type = response.headers.get("Content-Type", "")
        if "application/json" in media_type:
            print(response.status, json.load(response))
        else:
            print(response.status, media_type, len(response.read()))
except HTTPError as error:
    media_type = error.headers.get("Content-Type", "")
    if "application/json" in media_type:
        print(error.code, json.load(error))
    else:
        print(error.code, error.read().decode("utf-8", errors="replace"))

Successful response description: PDF bytes for the rendered transaction invoice, with generator filename Transaction_4001.pdf. JSON success example is N/A because the operation streams binary content. Inspect media type/status before opening the output as a PDF.

Consequential alternate: invoice rendering fails

HTTP 409:

{"error":"transaction_invoice_error","error_description":"Something went wrong while downloading a file.","req_guid":"example-request"}

This is the generator's wrapped PDF failure. The caller must handle JSON and refrain from displaying that body as an invoice; it does not invalidate or refund the transaction.

Recovery

HTTPCode / responseCauseNext action
401auth_failed / auth_access_failMissing member or account/resource lock/suspension.Check existing session/resource context or administrator restrictions.
404resource_not_existsInvalid required header resource.Correct the supplied public resource key.
404transaction_not_existsMissing/not-owned transaction.Select a transaction ID visible in the member's history.
409transaction_invoice_errorInvoice rendering/output exception.Keep the description/request reference for the integration owner; check rendering configuration rather than submitting another payment.

Next task

Display/download the valid PDF in your application. If the integration needs the separately stored receipt link, use receipt-generation request and read the selected receipt record through detail.

Request receipt generation

POST /api/v1/user/transaction/{id}/receipt/generate

Requests the receipt-generation event for a transaction owned by this member in this resource. An acknowledgement is not the generated PDF, delivery or immediate link availability. The action does not check successful status before enqueueing; the generation helper later requires a successful transaction, can delete previous receipt records/files and stores a new PDF.

Before you call

Use a known local transaction ID in the member/resource pair. Requires active member context, user-role/inherited permission and valid resource. Ensure the intended transaction's recorded outcome is suitable before requesting generation; this does not repair payment state. There is no duplicate-generation/idempotency guarantee.

Request

POST with no required body or request Content-Type. The handler reads only the path ID/context.

NameLocationTypeRequirementMeaning
resourceheaderstringrequired contextPublic resource key selecting the member session and operation context.
tokenheaderstringmember contextExisting Wallkit token; user role or inherited permission.
firebase-tokenheaderstringFirebase-enabled contextConfigured provider ID token alongside Wallkit token; see credentials.
idpathnumeric identifier, cast to integerrequiredLocal transaction ID. This registered placeholder is not digit-regex restricted like the plural transaction route.

Result

HTTP 200 JSON success:boolean true means the event request returned without a caught exception. No receipt ID/link or completion state is returned. The event uses a configured service queue/delay; it does not promise completion timing.

Example: request transaction 4001's receipt

Use sample runtimes. Assume this member owns the transaction in the supplied resource.

cURL

curl "${WALLKIT_API_BASE}/api/v1/user/transaction/4001/receipt/generate" \
  -X POST \
  -H "resource: ${RESOURCE_KEY}" \
  -H "token: ${USER_TOKEN}" \
  -H "Accept: application/json"

JavaScript

// Node.js 18+; built-in fetch.
async function main() {
  const url = new URL("/api/v1/user/transaction/4001/receipt/generate", process.env.WALLKIT_API_BASE);
  const headers = {
    resource: process.env.RESOURCE_KEY,
    token: process.env.USER_TOKEN,
    Accept: "application/json"
  };
  const response = await fetch(url, {
    method: "POST", headers
  });
  console.log(response.status, await response.json());
}
main().catch(console.error);

Python

# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urljoin
from urllib.request import Request, urlopen

url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/user/transaction/4001/receipt/generate")
headers = {
    "resource": os.environ["RESOURCE_KEY"],
    "token": os.environ["USER_TOKEN"],
    "Accept": "application/json"
}
request = Request(url, headers=headers, method="POST")
try:
    with urlopen(request) as response:
        print(response.status, json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))

HTTP 200:

{"success":true}

The generation request was acknowledged. Read transaction detail later for its existing receipt field; do not turn success:true into a claim that a receipt was generated or sent.

Consequential alternate: transaction outside member/resource scope

HTTP 404:

{"error":"transaction_not_found","error_description":"Transaction not found","req_guid":"example-request"}

Missing record, wrong owner and resource mismatch share this response. This request's scope is stricter than transaction detail/download.

Recovery

HTTPCode / responseCauseNext action
401auth_failed / auth_access_failMissing member or account/resource lock/suspension.Check existing session/resource context or administrator restrictions.
404resource_not_existsInvalid required header resource.Correct the supplied public resource key.
404transaction_not_foundNo record matches local ID, member and resource.Select that member's transaction in the intended resource.
409generate_receipt_errorCaught event/generation-request exception.Retain request details for the integration owner; inspect existing receipt state before repeating a request.

Next task

Use transaction detail to inspect receipt when available, then its supplied link with receipt download. Keep generation acknowledgement, document availability and payment completion separate.

Full diagram

Use the arrow keys to scroll. Escape closes this view.

Search documentation

Enter at least 2 characters.

    ↑ ↓ move through results · Enter opens · Escape closes