Skip to content

Commit 3d0f408

Browse files
github-actions[bot]olivermrblshahednasser
authored
chore(docs): Updated API Reference (automated) (medusajs#13794)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
1 parent 1d63ed8 commit 3d0f408

File tree

67 files changed

+2475
-525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2475
-525
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.refundReason.create({
12+
value: "refund",
13+
label: "Refund",
14+
})
15+
.then(({ refund_reason }) => {
16+
console.log(refund_reason)
17+
})
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.refundReason.delete("ret_123")
12+
.then(({ deleted }) => {
13+
console.log(deleted)
14+
})
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.refundReason.retrieve("refr_123")
12+
.then(({ refund_reason }) => {
13+
console.log(refund_reason)
14+
})
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.refundReason.update("ret_123", {
12+
value: "refund",
13+
label: "Refund",
14+
})
15+
.then(({ refund_reason }) => {
16+
console.log(refund_reason)
17+
})

www/apps/api-reference/specs/admin/components/schemas/AdminCampaign.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ properties:
5151
- currency_code
5252
- limit
5353
- used
54+
- attribute
5455
properties:
5556
id:
5657
type: string
@@ -82,6 +83,13 @@ properties:
8283
property holds the total amount discounted so far. If the limit is
8384
`usage`, it holds the number of times the campaign's promotions have
8485
been used so far.
86+
attribute:
87+
type: string
88+
title: attribute
89+
description: The cart attribute to limit the budget by.
90+
externalDocs:
91+
url: >-
92+
https://docs.medusajs.com/resources/commerce-modules/promotion/campaign#attribute-based-budgets
8593
created_at:
8694
type: string
8795
format: date-time
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
type: object
2+
description: The calculated shipping option's details.
3+
x-schemaName: AdminCreateCalculatedShippingOption
4+
required:
5+
- price_type
6+
- name
7+
- service_zone_id
8+
- shipping_profile_id
9+
- provider_id
10+
properties:
11+
price_type:
12+
type: string
13+
title: price_type
14+
description: The calculated shipping option's price type.
15+
enum:
16+
- calculated
17+
- flat
18+
name:
19+
type: string
20+
title: name
21+
description: The calculated shipping option's name.
22+
service_zone_id:
23+
type: string
24+
title: service_zone_id
25+
description: The ID of the associated service zone.
26+
shipping_profile_id:
27+
type: string
28+
title: shipping_profile_id
29+
description: The ID of the associated shipping profile.
30+
data:
31+
type: object
32+
description: The calculated shipping option's data.
33+
externalDocs:
34+
url: >-
35+
https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property
36+
provider_id:
37+
type: string
38+
title: provider_id
39+
description: >-
40+
The ID of the fulfillment provider handling this calculated shipping
41+
option.
42+
type:
43+
$ref: ./AdminCreateShippingOptionType.yaml
44+
type_id:
45+
type: string
46+
title: type_id
47+
description: The ID of the shipping option type that this shipping option belongs to.
48+
rules:
49+
type: array
50+
description: The calculated shipping option's rules.
51+
items:
52+
$ref: ./AdminCreateShippingOptionRule.yaml
53+
metadata:
54+
type: object
55+
description: The shipping option's metadata, can hold custom key-value pairs.

www/apps/api-reference/specs/admin/components/schemas/AdminCreateShippingOption.yaml renamed to www/apps/api-reference/specs/admin/components/schemas/AdminCreateFlatRateShippingOption.yaml

Lines changed: 72 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
type: object
2-
description: The shipping option's details.
3-
x-schemaName: AdminCreateShippingOption
2+
description: The flat rate shipping option's details.
3+
x-schemaName: AdminCreateFlatRateShippingOption
44
required:
5+
- price_type
6+
- prices
57
- name
68
- service_zone_id
79
- shipping_profile_id
8-
- price_type
910
- provider_id
10-
- prices
1111
properties:
1212
name:
1313
type: string
1414
title: name
15-
description: The shipping option's name.
15+
description: The flat-rate shipping option's name.
1616
service_zone_id:
1717
type: string
1818
title: service_zone_id
@@ -24,8 +24,8 @@ properties:
2424
data:
2525
type: object
2626
description: >-
27-
The shipping option's data, useful for the fulfillment provider handling
28-
its processing.
27+
The flat-rate shipping option's data, useful for the fulfillment provider
28+
handling its processing.
2929
externalDocs:
3030
url: >-
3131
https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property
@@ -65,6 +65,35 @@ properties:
6565
type: number
6666
title: amount
6767
description: The price's amount.
68+
rules:
69+
type: array
70+
description: The price's rules.
71+
items:
72+
type: object
73+
description: The rule's details.
74+
x-schemaName: PriceRule
75+
required:
76+
- attribute
77+
- operator
78+
- value
79+
properties:
80+
attribute:
81+
type: string
82+
title: attribute
83+
description: The rule's attribute.
84+
operator:
85+
type: string
86+
description: The rule's operator.
87+
enum:
88+
- gt
89+
- lt
90+
- eq
91+
- lte
92+
- gte
93+
value:
94+
type: number
95+
title: value
96+
description: The rule's value.
6897
- type: object
6998
description: The price's details.
7099
x-schemaName: AdminCreateShippingOptionPriceWithRegion
@@ -80,12 +109,44 @@ properties:
80109
type: number
81110
title: amount
82111
description: The price's amount.
112+
rules:
113+
type: array
114+
description: The price's rules.
115+
items:
116+
type: object
117+
description: The rule's details.
118+
x-schemaName: PriceRule
119+
required:
120+
- attribute
121+
- operator
122+
- value
123+
properties:
124+
attribute:
125+
type: string
126+
title: attribute
127+
description: The rule's attribute.
128+
operator:
129+
type: string
130+
description: The rule's operator.
131+
enum:
132+
- gt
133+
- lt
134+
- eq
135+
- lte
136+
- gte
137+
value:
138+
type: number
139+
title: value
140+
description: The rule's value.
141+
type_id:
142+
type: string
143+
title: type_id
144+
description: The ID of the shipping option type that this shipping option belongs to.
83145
rules:
84146
type: array
85147
description: The shipping option's rules.
86148
items:
87149
$ref: ./AdminCreateShippingOptionRule.yaml
88-
type_id:
89-
type: string
90-
title: type_id
91-
description: The ID of the shipping option type that this shipping option belongs to.
150+
metadata:
151+
type: object
152+
description: The shipping option's metadata.

www/apps/api-reference/specs/admin/components/schemas/AdminCreateRefundReason.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description: The refund reason's details.
33
x-schemaName: AdminCreateRefundReason
44
required:
55
- label
6+
- code
67
properties:
78
label:
89
type: string
@@ -12,3 +13,10 @@ properties:
1213
type: string
1314
title: description
1415
description: The refund reason's description.
16+
code:
17+
type: string
18+
title: code
19+
description: The refund reason's code.
20+
metadata:
21+
type: object
22+
description: The refund reason's metadata. Can hold custom key-value pairs.

www/apps/api-reference/specs/admin/components/schemas/AdminRefund.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ properties:
3535
payment:
3636
$ref: ./BasePayment.yaml
3737
refund_reason:
38-
$ref: ./RefundReason.yaml
38+
$ref: ./BaseRefundReason.yaml

www/apps/api-reference/specs/admin/components/schemas/AdminRefundReason.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ x-schemaName: AdminRefundReason
44
required:
55
- id
66
- label
7-
- metadata
7+
- code
88
- created_at
99
- updated_at
1010
properties:
@@ -36,3 +36,7 @@ properties:
3636
format: date-time
3737
title: updated_at
3838
description: The date the refund reason was updated.
39+
code:
40+
type: string
41+
title: code
42+
description: The refund reason's code.

0 commit comments

Comments
 (0)