BackstageClient.refundRequests
BackstageClient.refundRequests in @ticketlayer/backstage.
@ticketlayer/backstage / BackstageClient / refundRequests
refundRequests: {
approveRequest: (requestId: string, request: {
notes?: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>;
createRequest: (request: {
orderId: string;
reason?: string;
refundTo?: "original" | "account_credit";
type: "refund" | "exchange";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>;
listRequests: (options?: {
status?: "failed" | "pending" | "approved" | "rejected" | "processed";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}[]>;
processRequest: (requestId: string, requestOptions?: RequestOptions) => Promise<{
refunds: {
amount: number;
currency: string;
id: string;
paymentId: string;
status: string;
}[];
request: {
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
};
}>;
rejectRequest: (requestId: string, request: {
notes?: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>;
updateRequest: (requestId: string, request: {
refundTo: "original" | "account_credit";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>;
};Defined in: client.ts:5038
Refund Requests methods
approveRequest()#
approveRequest: (requestId: string, request: {
notes?: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>;Approve a refund request Approves a pending refund or exchange request. Approving does not move money; process the request to do that.
Parameters#
| Parameter | Type |
|---|---|
requestId | string |
request | { notes?: string; } |
request.notes? | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>
Operation Id#
approveRefundRequest
createRequest()#
createRequest: (request: {
orderId: string;
reason?: string;
refundTo?: "original" | "account_credit";
type: "refund" | "exchange";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>;Create a refund request Raises a refund or exchange request against an order on behalf of the customer.
Parameters#
| Parameter | Type |
|---|---|
request | { orderId: string; reason?: string; refundTo?: "original" | "account_credit"; type: "refund" | "exchange"; } |
request.orderId | string |
request.reason? | string |
request.refundTo? | "original" | "account_credit" |
request.type? | "refund" | "exchange" |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>
Operation Id#
createRefundRequest
listRequests()#
listRequests: (options?: {
status?: "failed" | "pending" | "approved" | "rejected" | "processed";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}[]>;List refund requests Lists refund and exchange requests the actor may see, optionally filtered by status. Each request carries the fields the caller's access tiers reach: refundrequests.read for the selling or the event-owning account shows every documented field, and refundrequests.list alone shows only public fields, which a request has none of.
Parameters#
| Parameter | Type |
|---|---|
options? | { status?: "failed" | "pending" | "approved" | "rejected" | "processed"; } |
options.status? | "failed" | "pending" | "approved" | "rejected" | "processed" |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}[]>
Operation Id#
listRefundRequests
processRequest()#
processRequest: (requestId: string, requestOptions?: RequestOptions) => Promise<{
refunds: {
amount: number;
currency: string;
id: string;
paymentId: string;
status: string;
}[];
request: {
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
};
}>;Process an approved refund request
Executes an approved refund: reverses the payments behind the order through the payments domain and reports the refunds it created. Once they have succeeded the order is refunded in full (less the booking fee, when the policy keeps it): it moves to refunded, its passes are cancelled, and order.refunded is sent.
Parameters#
| Parameter | Type |
|---|---|
requestId | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
refunds: {
amount: number;
currency: string;
id: string;
paymentId: string;
status: string;
}[];
request: {
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
};
}>
Operation Id#
processRefundRequest
rejectRequest()#
rejectRequest: (requestId: string, request: {
notes?: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>;Reject a refund request Rejects a pending refund or exchange request, with optional notes for the audit trail.
Parameters#
| Parameter | Type |
|---|---|
requestId | string |
request | { notes?: string; } |
request.notes? | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>
Operation Id#
rejectRefundRequest
updateRequest()#
updateRequest: (requestId: string, request: {
refundTo: "original" | "account_credit";
}, requestOptions?: RequestOptions) => Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>;Change where a refund request pays out
Sets where the money goes when the request is processed (refundTo): back to how the order was paid, or into the customer's account credit. Staff use it to override what the requester asked for, while the request is requested or approved (an auto-approved request included); a processed or rejected request is REFUND_REQUEST_CLOSED. Account credit needs a customer on the order (STORED_VALUE_CUSTOMER_REQUIRED). Needs refundrequests.decide on the account that decides the request.
Parameters#
| Parameter | Type | Description |
|---|---|---|
requestId | string | - |
request | { refundTo: "original" | "account_credit"; } | - |
request.refundTo | "original" | "account_credit" | Description Where the money goes when the request is processed, in place of what the requester asked for: back to how the order was paid, or into the customer's account credit (which needs a customer on the order). |
requestOptions? | RequestOptions | - |
Returns#
Promise<{
accountId: string;
createdAt: string;
id: string;
notes: string | null;
orderId: string;
organisationId: string;
reason: string | null;
refundTo: "original" | "account_credit";
status: "failed" | "pending" | "approved" | "rejected" | "processed";
type: "refund" | "exchange";
updatedAt: string;
}>
Operation Id#
updateRefundRequest