@medalsocial/sdk 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/dist/openapi/medal-social.openapi.json +361 -0
- package/dist/src/index.d.mts +165 -1
- package/dist/src/index.d.ts +165 -1
- package/dist/src/index.js +59 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +59 -0
- package/dist/src/index.mjs.map +1 -1
- package/dist/src/openapi.generated.d.mts +237 -0
- package/dist/src/openapi.generated.d.ts +237 -0
- package/dist/src/openapi.generated.js.map +1 -1
- package/openapi/medal-social.openapi.yaml +267 -0
- package/package.json +1 -1
- package/skills/resources/SKILL.md +4 -0
|
@@ -576,6 +576,59 @@ interface paths {
|
|
|
576
576
|
patch?: never;
|
|
577
577
|
trace?: never;
|
|
578
578
|
};
|
|
579
|
+
"/api/v1/bookings/{id}/payment": {
|
|
580
|
+
parameters: {
|
|
581
|
+
query?: never;
|
|
582
|
+
header?: never;
|
|
583
|
+
path: {
|
|
584
|
+
id: components["parameters"]["Id"];
|
|
585
|
+
};
|
|
586
|
+
cookie?: never;
|
|
587
|
+
};
|
|
588
|
+
/**
|
|
589
|
+
* Read the newest payment attempt on a booking
|
|
590
|
+
* @description Returns the newest attempt only. A booking with no payment yet, an unknown booking id and another workspace's booking all answer 404 alike, so this is not an existence oracle.
|
|
591
|
+
*/
|
|
592
|
+
get: operations["getBookingPayment"];
|
|
593
|
+
put?: never;
|
|
594
|
+
/**
|
|
595
|
+
* Start a Vipps payment for a booking
|
|
596
|
+
* @description Reserves (or charges) the booking's amount and returns the wallet redirect URL. The customer must have accepted your terms before this call — `terms_accepted` must be literally `true`, and a body omitting it is a 400. One live payment per booking: a second while one is outstanding answers 409, as does a booking that is not payable or a refusal from Vipps. A `return_url` this workspace's own sites do not vouch for answers 422, not 400 — the URL parses, it is just not yours. 403 when the payments switch or the bookings module is off.
|
|
597
|
+
*/
|
|
598
|
+
post: operations["startBookingPayment"];
|
|
599
|
+
delete?: never;
|
|
600
|
+
options?: never;
|
|
601
|
+
head?: never;
|
|
602
|
+
patch?: never;
|
|
603
|
+
trace?: never;
|
|
604
|
+
};
|
|
605
|
+
"/api/v1/bookings/manage/{token}/payment": {
|
|
606
|
+
parameters: {
|
|
607
|
+
query?: never;
|
|
608
|
+
header?: never;
|
|
609
|
+
path: {
|
|
610
|
+
/** @description The show-once manage token handed out when the booking was created. Possession of it authorizes the customer's own cancel or reschedule. */
|
|
611
|
+
token: components["parameters"]["ManageToken"];
|
|
612
|
+
};
|
|
613
|
+
cookie?: never;
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* Read the payment on the customer's own booking
|
|
617
|
+
* @description An unknown token, another workspace's token and a booking with no payment yet all answer 404 alike.
|
|
618
|
+
*/
|
|
619
|
+
get: operations["getManageBookingPayment"];
|
|
620
|
+
put?: never;
|
|
621
|
+
/**
|
|
622
|
+
* Start a payment on the customer's behalf
|
|
623
|
+
* @description The manage-token twin of `startBookingPayment` — same body, same responses; only the credential that authorizes it differs.
|
|
624
|
+
*/
|
|
625
|
+
post: operations["startManageBookingPayment"];
|
|
626
|
+
delete?: never;
|
|
627
|
+
options?: never;
|
|
628
|
+
head?: never;
|
|
629
|
+
patch?: never;
|
|
630
|
+
trace?: never;
|
|
631
|
+
};
|
|
579
632
|
"/api/v1/bookings/manage/{token}": {
|
|
580
633
|
parameters: {
|
|
581
634
|
query?: never;
|
|
@@ -1666,6 +1719,16 @@ interface components {
|
|
|
1666
1719
|
BookingCancelledBy: "customer" | "staff" | "system";
|
|
1667
1720
|
/** @enum {string} */
|
|
1668
1721
|
BookingPaymentStatus: "none" | "reserved" | "captured" | "refunded";
|
|
1722
|
+
/**
|
|
1723
|
+
* @description What a booking must have paid before the business honours it: nothing, a reservation captured later, or the full amount up front.
|
|
1724
|
+
* @enum {string}
|
|
1725
|
+
*/
|
|
1726
|
+
BookingPaymentMode: "none" | "reserve" | "prepay";
|
|
1727
|
+
/**
|
|
1728
|
+
* @description The state of one payment attempt, in Medal's vocabulary rather than the wallet's — a Vipps payment stays AUTHORIZED after a capture, so read the øre aggregates to learn what actually moved.
|
|
1729
|
+
* @enum {string}
|
|
1730
|
+
*/
|
|
1731
|
+
BookingPaymentState: "created" | "authorized" | "captured" | "cancelled" | "refunded" | "failed" | "expired";
|
|
1669
1732
|
/** @enum {string} */
|
|
1670
1733
|
BookingCreatedVia: "web" | "dashboard" | "walk_in" | "api";
|
|
1671
1734
|
/** @enum {string} */
|
|
@@ -1696,6 +1759,8 @@ interface components {
|
|
|
1696
1759
|
/** @description On a booking created by a reschedule, the booking it replaced. */
|
|
1697
1760
|
rescheduled_from_id: string | null;
|
|
1698
1761
|
payment_status: components["schemas"]["BookingPaymentStatus"];
|
|
1762
|
+
/** @description What this booking required when it was made — frozen at creation. `payment_status: none` cannot tell "owes nothing" from "has not paid yet"; this can. */
|
|
1763
|
+
payment_mode: components["schemas"]["BookingPaymentMode"];
|
|
1699
1764
|
/** @description Price in integer øre. Never a float and never kroner. */
|
|
1700
1765
|
amount_ore: number | null;
|
|
1701
1766
|
/** @description Customer-visible note. */
|
|
@@ -1722,6 +1787,8 @@ interface components {
|
|
|
1722
1787
|
/** @description Resource types this service needs, e.g. `["staff"]`. */
|
|
1723
1788
|
resource_requirements: string[];
|
|
1724
1789
|
bookable_online: boolean;
|
|
1790
|
+
/** @description Per-service payment requirement. `null` means no override — the workspace rule decides. */
|
|
1791
|
+
payment: components["schemas"]["BookingPaymentMode"] | null;
|
|
1725
1792
|
max_per_booking: number | null;
|
|
1726
1793
|
color: string | null;
|
|
1727
1794
|
sort_order: number | null;
|
|
@@ -1840,6 +1907,8 @@ interface components {
|
|
|
1840
1907
|
/** @description Price in integer øre. */
|
|
1841
1908
|
amount_ore: number | null;
|
|
1842
1909
|
payment_status: components["schemas"]["BookingPaymentStatus"] | null;
|
|
1910
|
+
/** @description What this booking requires — what a manage page checks before offering «Betal nå». */
|
|
1911
|
+
payment_mode: components["schemas"]["BookingPaymentMode"];
|
|
1843
1912
|
/** @description IANA zone the booking's local times should be rendered in. */
|
|
1844
1913
|
time_zone: string | null;
|
|
1845
1914
|
cancel_window_hours: number | null;
|
|
@@ -1866,6 +1935,64 @@ interface components {
|
|
|
1866
1935
|
new_start_ts: components["schemas"]["BookingTimestampInput"];
|
|
1867
1936
|
new_resource_id?: string;
|
|
1868
1937
|
};
|
|
1938
|
+
/** @description Body for `startBookingPayment` and `startManageBookingPayment`. */
|
|
1939
|
+
StartBookingPaymentInput: {
|
|
1940
|
+
/** @description Where the wallet returns the customer. Must be a URL one of this workspace's own sites vouches for; anything else answers 422. */
|
|
1941
|
+
return_url: string;
|
|
1942
|
+
/**
|
|
1943
|
+
* @description Must be literally `true`. The customer has to actively accept the merchant's terms BEFORE a payment is initiated, so omitting it or sending `false` is a 400 and leaves no payment behind.
|
|
1944
|
+
* @constant
|
|
1945
|
+
*/
|
|
1946
|
+
terms_accepted: true;
|
|
1947
|
+
/** @description The caller's own version label for the terms that were accepted. */
|
|
1948
|
+
terms_version?: string;
|
|
1949
|
+
/** @description The exact text that was accepted, stored with the consent record. */
|
|
1950
|
+
terms_text?: string;
|
|
1951
|
+
};
|
|
1952
|
+
/** @description The result of starting a payment. `redirect_url` is handed over here and nowhere else. */
|
|
1953
|
+
BookingPaymentStart: {
|
|
1954
|
+
/** @description The wallet reference for this attempt. */
|
|
1955
|
+
reference: string;
|
|
1956
|
+
/** @description Send the customer here UNCHANGED — hand it to the Vipps Widget SDK. SHOW-ONCE: it is not returned by `getBookingPayment`, and the payment behind it expires after ten minutes. */
|
|
1957
|
+
redirect_url: string;
|
|
1958
|
+
state: components["schemas"]["BookingPaymentState"];
|
|
1959
|
+
};
|
|
1960
|
+
/** @description One payment attempt on a booking. Money is integer øre, and the four aggregates are numbers rather than nulls — "nothing captured" is `0`. `redirect_url`, the wallet's own refusal text and the trace id are deliberately absent. */
|
|
1961
|
+
BookingPayment: {
|
|
1962
|
+
reference: string;
|
|
1963
|
+
/** @constant */
|
|
1964
|
+
provider: "vipps";
|
|
1965
|
+
state: components["schemas"]["BookingPaymentState"];
|
|
1966
|
+
/**
|
|
1967
|
+
* @description Never `none` — a payment exists only where one was required.
|
|
1968
|
+
* @enum {string}
|
|
1969
|
+
*/
|
|
1970
|
+
mode: "reserve" | "prepay";
|
|
1971
|
+
/** @description 1 for the first attempt on this booking, incrementing per retry. */
|
|
1972
|
+
attempt: number;
|
|
1973
|
+
/** @description The amount this attempt is for, in integer øre. */
|
|
1974
|
+
amount_ore: number;
|
|
1975
|
+
authorized_ore: number;
|
|
1976
|
+
captured_ore: number;
|
|
1977
|
+
refunded_ore: number;
|
|
1978
|
+
cancelled_ore: number;
|
|
1979
|
+
/** @constant */
|
|
1980
|
+
currency: "NOK";
|
|
1981
|
+
/**
|
|
1982
|
+
* Format: date-time
|
|
1983
|
+
* @description The last moment a capture is GUARANTEED to succeed. The card behind the wallet may release the reservation afterwards, so a capture past it can fail even though the payment still looks authorized. Null until the customer has approved.
|
|
1984
|
+
*/
|
|
1985
|
+
capture_guaranteed_until: string | null;
|
|
1986
|
+
terms_version: string | null;
|
|
1987
|
+
/** Format: date-time */
|
|
1988
|
+
terms_accepted_at: string | null;
|
|
1989
|
+
/** @description The wallet's numeric error code from the last failed operation — what a caller branches on. */
|
|
1990
|
+
failure_code: string | null;
|
|
1991
|
+
/** Format: date-time */
|
|
1992
|
+
created_at: string | null;
|
|
1993
|
+
/** Format: date-time */
|
|
1994
|
+
updated_at: string | null;
|
|
1995
|
+
};
|
|
1869
1996
|
/** @description Pagination for a bookings page. `truncated` is the extra statement: the underlying read is capped, and when the cap binds there are matching bookings no cursor from this call reaches — narrow the window. */
|
|
1870
1997
|
BookingsPagination: {
|
|
1871
1998
|
has_more: boolean;
|
|
@@ -2210,6 +2337,8 @@ interface components {
|
|
|
2210
2337
|
ApiResponse_BookingCreateResult: components["schemas"]["Envelope_BookingCreateResult"];
|
|
2211
2338
|
ApiResponse_BookingActionResult: components["schemas"]["Envelope_BookingActionResult"];
|
|
2212
2339
|
ApiResponse_BookingRescheduleResult: components["schemas"]["Envelope_BookingRescheduleResult"];
|
|
2340
|
+
ApiResponse_BookingPaymentStart: components["schemas"]["Envelope_BookingPaymentStart"];
|
|
2341
|
+
ApiResponse_BookingPayment: components["schemas"]["Envelope_BookingPayment"];
|
|
2213
2342
|
ApiResponse_ManageSummary: components["schemas"]["Envelope_ManageSummary"];
|
|
2214
2343
|
ApiResponse_PortalLoginStartResult: components["schemas"]["Envelope_PortalLoginStartResult"];
|
|
2215
2344
|
ApiResponse_PortalSession: components["schemas"]["Envelope_PortalSession"];
|
|
@@ -2361,6 +2490,12 @@ interface components {
|
|
|
2361
2490
|
Envelope_BookingRescheduleResult: {
|
|
2362
2491
|
data: components["schemas"]["BookingRescheduleResult"];
|
|
2363
2492
|
};
|
|
2493
|
+
Envelope_BookingPaymentStart: {
|
|
2494
|
+
data: components["schemas"]["BookingPaymentStart"];
|
|
2495
|
+
};
|
|
2496
|
+
Envelope_BookingPayment: {
|
|
2497
|
+
data: components["schemas"]["BookingPayment"];
|
|
2498
|
+
};
|
|
2364
2499
|
Envelope_ManageSummary: {
|
|
2365
2500
|
data: components["schemas"]["ManageSummary"];
|
|
2366
2501
|
};
|
|
@@ -3934,6 +4069,108 @@ interface operations {
|
|
|
3934
4069
|
default: components["responses"]["ApiError"];
|
|
3935
4070
|
};
|
|
3936
4071
|
};
|
|
4072
|
+
getBookingPayment: {
|
|
4073
|
+
parameters: {
|
|
4074
|
+
query?: never;
|
|
4075
|
+
header?: never;
|
|
4076
|
+
path: {
|
|
4077
|
+
id: components["parameters"]["Id"];
|
|
4078
|
+
};
|
|
4079
|
+
cookie?: never;
|
|
4080
|
+
};
|
|
4081
|
+
requestBody?: never;
|
|
4082
|
+
responses: {
|
|
4083
|
+
/** @description The payment. `redirect_url` is deliberately absent here. */
|
|
4084
|
+
200: {
|
|
4085
|
+
headers: {
|
|
4086
|
+
[name: string]: unknown;
|
|
4087
|
+
};
|
|
4088
|
+
content: {
|
|
4089
|
+
"application/json": components["schemas"]["ApiResponse_BookingPayment"];
|
|
4090
|
+
};
|
|
4091
|
+
};
|
|
4092
|
+
default: components["responses"]["ApiError"];
|
|
4093
|
+
};
|
|
4094
|
+
};
|
|
4095
|
+
startBookingPayment: {
|
|
4096
|
+
parameters: {
|
|
4097
|
+
query?: never;
|
|
4098
|
+
header?: never;
|
|
4099
|
+
path: {
|
|
4100
|
+
id: components["parameters"]["Id"];
|
|
4101
|
+
};
|
|
4102
|
+
cookie?: never;
|
|
4103
|
+
};
|
|
4104
|
+
requestBody: {
|
|
4105
|
+
content: {
|
|
4106
|
+
"application/json": components["schemas"]["StartBookingPaymentInput"];
|
|
4107
|
+
};
|
|
4108
|
+
};
|
|
4109
|
+
responses: {
|
|
4110
|
+
/** @description The reference and the SHOW-ONCE redirect URL. The URL is never returned again — the payment behind it expires after ten minutes, so a cached one leads into a payment that no longer exists. */
|
|
4111
|
+
200: {
|
|
4112
|
+
headers: {
|
|
4113
|
+
[name: string]: unknown;
|
|
4114
|
+
};
|
|
4115
|
+
content: {
|
|
4116
|
+
"application/json": components["schemas"]["ApiResponse_BookingPaymentStart"];
|
|
4117
|
+
};
|
|
4118
|
+
};
|
|
4119
|
+
default: components["responses"]["ApiError"];
|
|
4120
|
+
};
|
|
4121
|
+
};
|
|
4122
|
+
getManageBookingPayment: {
|
|
4123
|
+
parameters: {
|
|
4124
|
+
query?: never;
|
|
4125
|
+
header?: never;
|
|
4126
|
+
path: {
|
|
4127
|
+
/** @description The show-once manage token handed out when the booking was created. Possession of it authorizes the customer's own cancel or reschedule. */
|
|
4128
|
+
token: components["parameters"]["ManageToken"];
|
|
4129
|
+
};
|
|
4130
|
+
cookie?: never;
|
|
4131
|
+
};
|
|
4132
|
+
requestBody?: never;
|
|
4133
|
+
responses: {
|
|
4134
|
+
/** @description The payment. `redirect_url` is deliberately absent here. */
|
|
4135
|
+
200: {
|
|
4136
|
+
headers: {
|
|
4137
|
+
[name: string]: unknown;
|
|
4138
|
+
};
|
|
4139
|
+
content: {
|
|
4140
|
+
"application/json": components["schemas"]["ApiResponse_BookingPayment"];
|
|
4141
|
+
};
|
|
4142
|
+
};
|
|
4143
|
+
default: components["responses"]["ApiError"];
|
|
4144
|
+
};
|
|
4145
|
+
};
|
|
4146
|
+
startManageBookingPayment: {
|
|
4147
|
+
parameters: {
|
|
4148
|
+
query?: never;
|
|
4149
|
+
header?: never;
|
|
4150
|
+
path: {
|
|
4151
|
+
/** @description The show-once manage token handed out when the booking was created. Possession of it authorizes the customer's own cancel or reschedule. */
|
|
4152
|
+
token: components["parameters"]["ManageToken"];
|
|
4153
|
+
};
|
|
4154
|
+
cookie?: never;
|
|
4155
|
+
};
|
|
4156
|
+
requestBody: {
|
|
4157
|
+
content: {
|
|
4158
|
+
"application/json": components["schemas"]["StartBookingPaymentInput"];
|
|
4159
|
+
};
|
|
4160
|
+
};
|
|
4161
|
+
responses: {
|
|
4162
|
+
/** @description The reference and the show-once redirect URL. */
|
|
4163
|
+
200: {
|
|
4164
|
+
headers: {
|
|
4165
|
+
[name: string]: unknown;
|
|
4166
|
+
};
|
|
4167
|
+
content: {
|
|
4168
|
+
"application/json": components["schemas"]["ApiResponse_BookingPaymentStart"];
|
|
4169
|
+
};
|
|
4170
|
+
};
|
|
4171
|
+
default: components["responses"]["ApiError"];
|
|
4172
|
+
};
|
|
4173
|
+
};
|
|
3937
4174
|
getManagedBooking: {
|
|
3938
4175
|
parameters: {
|
|
3939
4176
|
query?: never;
|
|
@@ -576,6 +576,59 @@ interface paths {
|
|
|
576
576
|
patch?: never;
|
|
577
577
|
trace?: never;
|
|
578
578
|
};
|
|
579
|
+
"/api/v1/bookings/{id}/payment": {
|
|
580
|
+
parameters: {
|
|
581
|
+
query?: never;
|
|
582
|
+
header?: never;
|
|
583
|
+
path: {
|
|
584
|
+
id: components["parameters"]["Id"];
|
|
585
|
+
};
|
|
586
|
+
cookie?: never;
|
|
587
|
+
};
|
|
588
|
+
/**
|
|
589
|
+
* Read the newest payment attempt on a booking
|
|
590
|
+
* @description Returns the newest attempt only. A booking with no payment yet, an unknown booking id and another workspace's booking all answer 404 alike, so this is not an existence oracle.
|
|
591
|
+
*/
|
|
592
|
+
get: operations["getBookingPayment"];
|
|
593
|
+
put?: never;
|
|
594
|
+
/**
|
|
595
|
+
* Start a Vipps payment for a booking
|
|
596
|
+
* @description Reserves (or charges) the booking's amount and returns the wallet redirect URL. The customer must have accepted your terms before this call — `terms_accepted` must be literally `true`, and a body omitting it is a 400. One live payment per booking: a second while one is outstanding answers 409, as does a booking that is not payable or a refusal from Vipps. A `return_url` this workspace's own sites do not vouch for answers 422, not 400 — the URL parses, it is just not yours. 403 when the payments switch or the bookings module is off.
|
|
597
|
+
*/
|
|
598
|
+
post: operations["startBookingPayment"];
|
|
599
|
+
delete?: never;
|
|
600
|
+
options?: never;
|
|
601
|
+
head?: never;
|
|
602
|
+
patch?: never;
|
|
603
|
+
trace?: never;
|
|
604
|
+
};
|
|
605
|
+
"/api/v1/bookings/manage/{token}/payment": {
|
|
606
|
+
parameters: {
|
|
607
|
+
query?: never;
|
|
608
|
+
header?: never;
|
|
609
|
+
path: {
|
|
610
|
+
/** @description The show-once manage token handed out when the booking was created. Possession of it authorizes the customer's own cancel or reschedule. */
|
|
611
|
+
token: components["parameters"]["ManageToken"];
|
|
612
|
+
};
|
|
613
|
+
cookie?: never;
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* Read the payment on the customer's own booking
|
|
617
|
+
* @description An unknown token, another workspace's token and a booking with no payment yet all answer 404 alike.
|
|
618
|
+
*/
|
|
619
|
+
get: operations["getManageBookingPayment"];
|
|
620
|
+
put?: never;
|
|
621
|
+
/**
|
|
622
|
+
* Start a payment on the customer's behalf
|
|
623
|
+
* @description The manage-token twin of `startBookingPayment` — same body, same responses; only the credential that authorizes it differs.
|
|
624
|
+
*/
|
|
625
|
+
post: operations["startManageBookingPayment"];
|
|
626
|
+
delete?: never;
|
|
627
|
+
options?: never;
|
|
628
|
+
head?: never;
|
|
629
|
+
patch?: never;
|
|
630
|
+
trace?: never;
|
|
631
|
+
};
|
|
579
632
|
"/api/v1/bookings/manage/{token}": {
|
|
580
633
|
parameters: {
|
|
581
634
|
query?: never;
|
|
@@ -1666,6 +1719,16 @@ interface components {
|
|
|
1666
1719
|
BookingCancelledBy: "customer" | "staff" | "system";
|
|
1667
1720
|
/** @enum {string} */
|
|
1668
1721
|
BookingPaymentStatus: "none" | "reserved" | "captured" | "refunded";
|
|
1722
|
+
/**
|
|
1723
|
+
* @description What a booking must have paid before the business honours it: nothing, a reservation captured later, or the full amount up front.
|
|
1724
|
+
* @enum {string}
|
|
1725
|
+
*/
|
|
1726
|
+
BookingPaymentMode: "none" | "reserve" | "prepay";
|
|
1727
|
+
/**
|
|
1728
|
+
* @description The state of one payment attempt, in Medal's vocabulary rather than the wallet's — a Vipps payment stays AUTHORIZED after a capture, so read the øre aggregates to learn what actually moved.
|
|
1729
|
+
* @enum {string}
|
|
1730
|
+
*/
|
|
1731
|
+
BookingPaymentState: "created" | "authorized" | "captured" | "cancelled" | "refunded" | "failed" | "expired";
|
|
1669
1732
|
/** @enum {string} */
|
|
1670
1733
|
BookingCreatedVia: "web" | "dashboard" | "walk_in" | "api";
|
|
1671
1734
|
/** @enum {string} */
|
|
@@ -1696,6 +1759,8 @@ interface components {
|
|
|
1696
1759
|
/** @description On a booking created by a reschedule, the booking it replaced. */
|
|
1697
1760
|
rescheduled_from_id: string | null;
|
|
1698
1761
|
payment_status: components["schemas"]["BookingPaymentStatus"];
|
|
1762
|
+
/** @description What this booking required when it was made — frozen at creation. `payment_status: none` cannot tell "owes nothing" from "has not paid yet"; this can. */
|
|
1763
|
+
payment_mode: components["schemas"]["BookingPaymentMode"];
|
|
1699
1764
|
/** @description Price in integer øre. Never a float and never kroner. */
|
|
1700
1765
|
amount_ore: number | null;
|
|
1701
1766
|
/** @description Customer-visible note. */
|
|
@@ -1722,6 +1787,8 @@ interface components {
|
|
|
1722
1787
|
/** @description Resource types this service needs, e.g. `["staff"]`. */
|
|
1723
1788
|
resource_requirements: string[];
|
|
1724
1789
|
bookable_online: boolean;
|
|
1790
|
+
/** @description Per-service payment requirement. `null` means no override — the workspace rule decides. */
|
|
1791
|
+
payment: components["schemas"]["BookingPaymentMode"] | null;
|
|
1725
1792
|
max_per_booking: number | null;
|
|
1726
1793
|
color: string | null;
|
|
1727
1794
|
sort_order: number | null;
|
|
@@ -1840,6 +1907,8 @@ interface components {
|
|
|
1840
1907
|
/** @description Price in integer øre. */
|
|
1841
1908
|
amount_ore: number | null;
|
|
1842
1909
|
payment_status: components["schemas"]["BookingPaymentStatus"] | null;
|
|
1910
|
+
/** @description What this booking requires — what a manage page checks before offering «Betal nå». */
|
|
1911
|
+
payment_mode: components["schemas"]["BookingPaymentMode"];
|
|
1843
1912
|
/** @description IANA zone the booking's local times should be rendered in. */
|
|
1844
1913
|
time_zone: string | null;
|
|
1845
1914
|
cancel_window_hours: number | null;
|
|
@@ -1866,6 +1935,64 @@ interface components {
|
|
|
1866
1935
|
new_start_ts: components["schemas"]["BookingTimestampInput"];
|
|
1867
1936
|
new_resource_id?: string;
|
|
1868
1937
|
};
|
|
1938
|
+
/** @description Body for `startBookingPayment` and `startManageBookingPayment`. */
|
|
1939
|
+
StartBookingPaymentInput: {
|
|
1940
|
+
/** @description Where the wallet returns the customer. Must be a URL one of this workspace's own sites vouches for; anything else answers 422. */
|
|
1941
|
+
return_url: string;
|
|
1942
|
+
/**
|
|
1943
|
+
* @description Must be literally `true`. The customer has to actively accept the merchant's terms BEFORE a payment is initiated, so omitting it or sending `false` is a 400 and leaves no payment behind.
|
|
1944
|
+
* @constant
|
|
1945
|
+
*/
|
|
1946
|
+
terms_accepted: true;
|
|
1947
|
+
/** @description The caller's own version label for the terms that were accepted. */
|
|
1948
|
+
terms_version?: string;
|
|
1949
|
+
/** @description The exact text that was accepted, stored with the consent record. */
|
|
1950
|
+
terms_text?: string;
|
|
1951
|
+
};
|
|
1952
|
+
/** @description The result of starting a payment. `redirect_url` is handed over here and nowhere else. */
|
|
1953
|
+
BookingPaymentStart: {
|
|
1954
|
+
/** @description The wallet reference for this attempt. */
|
|
1955
|
+
reference: string;
|
|
1956
|
+
/** @description Send the customer here UNCHANGED — hand it to the Vipps Widget SDK. SHOW-ONCE: it is not returned by `getBookingPayment`, and the payment behind it expires after ten minutes. */
|
|
1957
|
+
redirect_url: string;
|
|
1958
|
+
state: components["schemas"]["BookingPaymentState"];
|
|
1959
|
+
};
|
|
1960
|
+
/** @description One payment attempt on a booking. Money is integer øre, and the four aggregates are numbers rather than nulls — "nothing captured" is `0`. `redirect_url`, the wallet's own refusal text and the trace id are deliberately absent. */
|
|
1961
|
+
BookingPayment: {
|
|
1962
|
+
reference: string;
|
|
1963
|
+
/** @constant */
|
|
1964
|
+
provider: "vipps";
|
|
1965
|
+
state: components["schemas"]["BookingPaymentState"];
|
|
1966
|
+
/**
|
|
1967
|
+
* @description Never `none` — a payment exists only where one was required.
|
|
1968
|
+
* @enum {string}
|
|
1969
|
+
*/
|
|
1970
|
+
mode: "reserve" | "prepay";
|
|
1971
|
+
/** @description 1 for the first attempt on this booking, incrementing per retry. */
|
|
1972
|
+
attempt: number;
|
|
1973
|
+
/** @description The amount this attempt is for, in integer øre. */
|
|
1974
|
+
amount_ore: number;
|
|
1975
|
+
authorized_ore: number;
|
|
1976
|
+
captured_ore: number;
|
|
1977
|
+
refunded_ore: number;
|
|
1978
|
+
cancelled_ore: number;
|
|
1979
|
+
/** @constant */
|
|
1980
|
+
currency: "NOK";
|
|
1981
|
+
/**
|
|
1982
|
+
* Format: date-time
|
|
1983
|
+
* @description The last moment a capture is GUARANTEED to succeed. The card behind the wallet may release the reservation afterwards, so a capture past it can fail even though the payment still looks authorized. Null until the customer has approved.
|
|
1984
|
+
*/
|
|
1985
|
+
capture_guaranteed_until: string | null;
|
|
1986
|
+
terms_version: string | null;
|
|
1987
|
+
/** Format: date-time */
|
|
1988
|
+
terms_accepted_at: string | null;
|
|
1989
|
+
/** @description The wallet's numeric error code from the last failed operation — what a caller branches on. */
|
|
1990
|
+
failure_code: string | null;
|
|
1991
|
+
/** Format: date-time */
|
|
1992
|
+
created_at: string | null;
|
|
1993
|
+
/** Format: date-time */
|
|
1994
|
+
updated_at: string | null;
|
|
1995
|
+
};
|
|
1869
1996
|
/** @description Pagination for a bookings page. `truncated` is the extra statement: the underlying read is capped, and when the cap binds there are matching bookings no cursor from this call reaches — narrow the window. */
|
|
1870
1997
|
BookingsPagination: {
|
|
1871
1998
|
has_more: boolean;
|
|
@@ -2210,6 +2337,8 @@ interface components {
|
|
|
2210
2337
|
ApiResponse_BookingCreateResult: components["schemas"]["Envelope_BookingCreateResult"];
|
|
2211
2338
|
ApiResponse_BookingActionResult: components["schemas"]["Envelope_BookingActionResult"];
|
|
2212
2339
|
ApiResponse_BookingRescheduleResult: components["schemas"]["Envelope_BookingRescheduleResult"];
|
|
2340
|
+
ApiResponse_BookingPaymentStart: components["schemas"]["Envelope_BookingPaymentStart"];
|
|
2341
|
+
ApiResponse_BookingPayment: components["schemas"]["Envelope_BookingPayment"];
|
|
2213
2342
|
ApiResponse_ManageSummary: components["schemas"]["Envelope_ManageSummary"];
|
|
2214
2343
|
ApiResponse_PortalLoginStartResult: components["schemas"]["Envelope_PortalLoginStartResult"];
|
|
2215
2344
|
ApiResponse_PortalSession: components["schemas"]["Envelope_PortalSession"];
|
|
@@ -2361,6 +2490,12 @@ interface components {
|
|
|
2361
2490
|
Envelope_BookingRescheduleResult: {
|
|
2362
2491
|
data: components["schemas"]["BookingRescheduleResult"];
|
|
2363
2492
|
};
|
|
2493
|
+
Envelope_BookingPaymentStart: {
|
|
2494
|
+
data: components["schemas"]["BookingPaymentStart"];
|
|
2495
|
+
};
|
|
2496
|
+
Envelope_BookingPayment: {
|
|
2497
|
+
data: components["schemas"]["BookingPayment"];
|
|
2498
|
+
};
|
|
2364
2499
|
Envelope_ManageSummary: {
|
|
2365
2500
|
data: components["schemas"]["ManageSummary"];
|
|
2366
2501
|
};
|
|
@@ -3934,6 +4069,108 @@ interface operations {
|
|
|
3934
4069
|
default: components["responses"]["ApiError"];
|
|
3935
4070
|
};
|
|
3936
4071
|
};
|
|
4072
|
+
getBookingPayment: {
|
|
4073
|
+
parameters: {
|
|
4074
|
+
query?: never;
|
|
4075
|
+
header?: never;
|
|
4076
|
+
path: {
|
|
4077
|
+
id: components["parameters"]["Id"];
|
|
4078
|
+
};
|
|
4079
|
+
cookie?: never;
|
|
4080
|
+
};
|
|
4081
|
+
requestBody?: never;
|
|
4082
|
+
responses: {
|
|
4083
|
+
/** @description The payment. `redirect_url` is deliberately absent here. */
|
|
4084
|
+
200: {
|
|
4085
|
+
headers: {
|
|
4086
|
+
[name: string]: unknown;
|
|
4087
|
+
};
|
|
4088
|
+
content: {
|
|
4089
|
+
"application/json": components["schemas"]["ApiResponse_BookingPayment"];
|
|
4090
|
+
};
|
|
4091
|
+
};
|
|
4092
|
+
default: components["responses"]["ApiError"];
|
|
4093
|
+
};
|
|
4094
|
+
};
|
|
4095
|
+
startBookingPayment: {
|
|
4096
|
+
parameters: {
|
|
4097
|
+
query?: never;
|
|
4098
|
+
header?: never;
|
|
4099
|
+
path: {
|
|
4100
|
+
id: components["parameters"]["Id"];
|
|
4101
|
+
};
|
|
4102
|
+
cookie?: never;
|
|
4103
|
+
};
|
|
4104
|
+
requestBody: {
|
|
4105
|
+
content: {
|
|
4106
|
+
"application/json": components["schemas"]["StartBookingPaymentInput"];
|
|
4107
|
+
};
|
|
4108
|
+
};
|
|
4109
|
+
responses: {
|
|
4110
|
+
/** @description The reference and the SHOW-ONCE redirect URL. The URL is never returned again — the payment behind it expires after ten minutes, so a cached one leads into a payment that no longer exists. */
|
|
4111
|
+
200: {
|
|
4112
|
+
headers: {
|
|
4113
|
+
[name: string]: unknown;
|
|
4114
|
+
};
|
|
4115
|
+
content: {
|
|
4116
|
+
"application/json": components["schemas"]["ApiResponse_BookingPaymentStart"];
|
|
4117
|
+
};
|
|
4118
|
+
};
|
|
4119
|
+
default: components["responses"]["ApiError"];
|
|
4120
|
+
};
|
|
4121
|
+
};
|
|
4122
|
+
getManageBookingPayment: {
|
|
4123
|
+
parameters: {
|
|
4124
|
+
query?: never;
|
|
4125
|
+
header?: never;
|
|
4126
|
+
path: {
|
|
4127
|
+
/** @description The show-once manage token handed out when the booking was created. Possession of it authorizes the customer's own cancel or reschedule. */
|
|
4128
|
+
token: components["parameters"]["ManageToken"];
|
|
4129
|
+
};
|
|
4130
|
+
cookie?: never;
|
|
4131
|
+
};
|
|
4132
|
+
requestBody?: never;
|
|
4133
|
+
responses: {
|
|
4134
|
+
/** @description The payment. `redirect_url` is deliberately absent here. */
|
|
4135
|
+
200: {
|
|
4136
|
+
headers: {
|
|
4137
|
+
[name: string]: unknown;
|
|
4138
|
+
};
|
|
4139
|
+
content: {
|
|
4140
|
+
"application/json": components["schemas"]["ApiResponse_BookingPayment"];
|
|
4141
|
+
};
|
|
4142
|
+
};
|
|
4143
|
+
default: components["responses"]["ApiError"];
|
|
4144
|
+
};
|
|
4145
|
+
};
|
|
4146
|
+
startManageBookingPayment: {
|
|
4147
|
+
parameters: {
|
|
4148
|
+
query?: never;
|
|
4149
|
+
header?: never;
|
|
4150
|
+
path: {
|
|
4151
|
+
/** @description The show-once manage token handed out when the booking was created. Possession of it authorizes the customer's own cancel or reschedule. */
|
|
4152
|
+
token: components["parameters"]["ManageToken"];
|
|
4153
|
+
};
|
|
4154
|
+
cookie?: never;
|
|
4155
|
+
};
|
|
4156
|
+
requestBody: {
|
|
4157
|
+
content: {
|
|
4158
|
+
"application/json": components["schemas"]["StartBookingPaymentInput"];
|
|
4159
|
+
};
|
|
4160
|
+
};
|
|
4161
|
+
responses: {
|
|
4162
|
+
/** @description The reference and the show-once redirect URL. */
|
|
4163
|
+
200: {
|
|
4164
|
+
headers: {
|
|
4165
|
+
[name: string]: unknown;
|
|
4166
|
+
};
|
|
4167
|
+
content: {
|
|
4168
|
+
"application/json": components["schemas"]["ApiResponse_BookingPaymentStart"];
|
|
4169
|
+
};
|
|
4170
|
+
};
|
|
4171
|
+
default: components["responses"]["ApiError"];
|
|
4172
|
+
};
|
|
4173
|
+
};
|
|
3937
4174
|
getManagedBooking: {
|
|
3938
4175
|
parameters: {
|
|
3939
4176
|
query?: never;
|