docs: update api-reference project for v2 (#7307)

* remove everything v1 and make v2 default

* move main v2 rewrites to book

* move rewrites to book + other fixes
This commit is contained in:
Shahed Nasser
2024-05-16 10:02:35 +03:00
committed by GitHub
parent 9b1998b9b2
commit 22f30f54fd
2148 changed files with 8965 additions and 140283 deletions

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/api-keys' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/admin/api-keys' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X DELETE '{backend_url}/admin/api-keys/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/api-keys/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/admin/api-keys/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/admin/api-keys/{id}/revoke' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/apps' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,8 +0,0 @@
curl -X POST '{backend_url}/admin/apps/authorizations' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"application_name": "example",
"state": "ready",
"code": "token"
}'

View File

@@ -1,2 +0,0 @@
curl -X DELETE '{backend_url}/admin/auth' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/auth' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/auth' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com",
"password": "supersecret"
}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/auth/token' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com",
"password": "supersecret"
}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/batch-jobs' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,7 +0,0 @@
curl -X POST '{backend_url}/admin/batch-jobs' \
-H 'Content-Type: application/json' \
-H 'x-medusa-access-token: {api_token}' \
--data-raw '{
"type": "product-export",
"context": { }
}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/batch-jobs/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl -X POST '{backend_url}/admin/batch-jobs/{id}/cancel' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl -X POST '{backend_url}/admin/batch-jobs/{id}/confirm' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/campaigns' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/admin/campaigns' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X DELETE '{backend_url}/admin/campaigns/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/campaigns/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +1,6 @@
curl -X POST '{backend_url}/admin/store' \
curl -X POST '{backend_url}/admin/campaigns/{id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"name": "Medusa Store"
}'
"name": "Moriah"
}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/collections' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +1,2 @@
curl -X POST '{backend_url}/admin/collections' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"title": "New Collection"
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +1,2 @@
curl -X DELETE '{backend_url}/admin/collections/{id}' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/collections/{id}' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +1,2 @@
curl -X POST '{backend_url}/admin/collections/{id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"title": "New Collection"
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,8 +0,0 @@
curl -X DELETE '{backend_url}/admin/collections/{id}/products/batch' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"product_ids": [
"prod_01G1G5V2MBA328390B5AXJ610F"
]
}'

View File

@@ -1,8 +0,0 @@
curl -X POST '{backend_url}/admin/collections/{id}/products/batch' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"product_ids": [
"prod_01G1G5V2MBA328390B5AXJ610F"
]
}'

View File

@@ -1,2 +1,2 @@
curl -X POST '{backend_url}/admin/currencies' \
-H 'x-medusa-access-token: {api_token}'
curl '{backend_url}/admin/currencies' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/currencies/{code}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/currencies/{code}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"includes_tax": true
}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/customer-groups' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +1,2 @@
curl -X POST '{backend_url}/admin/customer-groups' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"name": "VIP"
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +1,2 @@
curl -X DELETE '{backend_url}/admin/customer-groups/{id}' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/customer-groups/{id}' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +1,2 @@
curl -X POST '{backend_url}/admin/customer-groups/{id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"name": "VIP"
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/customer-groups/{id}/customers' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,10 +0,0 @@
curl -X DELETE '{backend_url}/admin/customer-groups/{id}/customers/batch' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"customer_ids": [
{
"id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2"
}
]
}'

View File

@@ -2,9 +2,9 @@ curl -X POST '{backend_url}/admin/customer-groups/{id}/customers/batch' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"customer_ids": [
{
"id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2"
}
]
}'
"customer_ids": [
{
"id": "id_dx2Wieq4uGG"
}
]
}'

View File

@@ -0,0 +1,10 @@
curl -X POST '{backend_url}/admin/customer-groups/{id}/customers/remove' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"customer_ids": [
{
"id": "id_oAhMZi39hsjIOqPA6"
}
]
}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/customers' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,9 +1,2 @@
curl -X POST '{backend_url}/admin/customers' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com",
"first_name": "Caterina",
"last_name": "Yost",
"password": "supersecret"
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X DELETE '{backend_url}/admin/customers/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/customers/{id}' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +1,2 @@
curl -X POST '{backend_url}/admin/customers/{id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"first_name": "Dolly"
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/customers/{id}/addresses' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/admin/customers/{id}/addresses' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X DELETE '{backend_url}/admin/customers/{id}/addresses/{address_id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/customers/{id}/addresses/{address_id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/admin/customers/{id}/addresses/{address_id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/discounts' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,12 +0,0 @@
curl -X POST '{backend_url}/admin/discounts' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"code": "TEST",
"rule": {
"type": "fixed",
"value": 10,
"allocation": "item"
},
"regions": ["reg_XXXXXXXX"]
}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/discounts/code/{code}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/discounts/{id}/conditions' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"operator": "in"
}'

View File

@@ -1,2 +0,0 @@
curl -X DELETE '{backend_url}/admin/discounts/{id}/conditions/{condition_id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/discounts/{id}/conditions/{condition_id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,8 +0,0 @@
curl -X POST '{backend_url}/admin/discounts/{id}/conditions/{condition}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"products": [
"prod_01G1G5V2MBA328390B5AXJ610F"
]
}'

View File

@@ -1,6 +0,0 @@
curl -X DELETE '{backend_url}/admin/discounts/{id}/conditions/{condition_id}/batch' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"resources": [{ "id": "item_id" }]
}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/discounts/{id}/conditions/{condition_id}/batch' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"resources": [{ "id": "item_id" }]
}'

View File

@@ -1,2 +0,0 @@
curl -X DELETE '{backend_url}/admin/discounts/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/discounts/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/discounts/{id}/dynamic-codes' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"code": "TEST"
}'

View File

@@ -1,2 +0,0 @@
curl -X DELETE '{backend_url}/admin/discounts/{id}/dynamic-codes/{code}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl -X DELETE '{backend_url}/admin/discounts/{id}/regions/{region_id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl -X POST '{backend_url}/admin/discounts/{id}/regions/{region_id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/draft-orders' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,17 +0,0 @@
curl -X POST '{backend_url}/admin/draft-orders' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com",
"region_id": "{region_id}"
"items": [
{
"quantity": 1
}
],
"shipping_methods": [
{
"option_id": "{option_id}"
}
]
}'

View File

@@ -1,2 +0,0 @@
curl -X DELETE '{backend_url}/admin/draft-orders/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/draft-orders/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/draft-orders/{id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com"
}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/draft-orders/{id}/line-items' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"quantity": 1
}'

View File

@@ -1,2 +0,0 @@
curl -X DELETE '{backend_url}/admin/draft-orders/{id}/line-items/{line_id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/draft-orders/{id}/line-items/{line_id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"quantity": 1
}'

View File

@@ -1,2 +0,0 @@
curl -X POST '{backend_url}/admin/draft-orders/{id}/pay' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,10 @@
curl -X POST '{backend_url}/admin/fulfillment/shipping-options/{id}/rules/batch/add' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"rules": [
{
"attribute": "{value}"
}
]
}'

View File

@@ -0,0 +1,8 @@
curl -X POST '{backend_url}/admin/fulfillment/shipping-options/{id}/rules/batch/remove' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"rule_ids": [
"{value}"
]
}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/gift-cards' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/gift-cards' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"region_id": "{region_id}"
}'

View File

@@ -1,2 +0,0 @@
curl -X DELETE '{backend_url}/admin/gift-cards/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/gift-cards/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +0,0 @@
curl -X POST '{backend_url}/admin/gift-cards/{id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"region_id": "{region_id}"
}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/inventory-items' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +1,2 @@
curl -X POST '{backend_url}/admin/inventory-items' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"variant_id": "variant_123",
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +1,2 @@
curl -X DELETE '{backend_url}/admin/inventory-items/{id}' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/inventory-items/{id}' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +1,2 @@
curl -X POST '{backend_url}/admin/inventory-items/{id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"origin_country": "US"
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/inventory-items/{id}/location-levels' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -2,6 +2,6 @@ curl -X POST '{backend_url}/admin/inventory-items/{id}/location-levels' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"location_id": "sloc_123",
"stocked_quantity": 10
}'
"location_id": "{value}",
"stocked_quantity": 1506469662949376
}'

View File

@@ -1,2 +1,2 @@
curl -X DELETE '{backend_url}/admin/inventory-items/{id}/location-levels/{location_id}' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,6 +1,2 @@
curl -X POST '{backend_url}/admin/inventory-items/{id}/location-levels/{location_id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"stocked_quantity": 15
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/admin/invites' \
-H 'x-medusa-access-token: {api_token}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,7 +1,2 @@
curl -X POST '{backend_url}/admin/invites' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"user": "user@example.com",
"role": "admin"
}'
-H 'x-medusa-access-token: {api_token}'

View File

@@ -2,10 +2,6 @@ curl -X POST '{backend_url}/admin/invites/accept' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"token": "{token}",
"user": {
"first_name": "Brigitte",
"last_name": "Collier",
"password": "supersecret"
}
}'
"first_name": "{value}",
"last_name": "{value}"
}'

View File

@@ -0,0 +1,2 @@
curl -X DELETE '{backend_url}/admin/invites/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/invites/{id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/admin/invites/{id}/resend' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl -X DELETE '{backend_url}/admin/invites/{invite_id}' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl -X POST '{backend_url}/admin/invites/{invite_id}/resend' \
-H 'x-medusa-access-token: {api_token}'

View File

@@ -1,2 +0,0 @@
curl '{backend_url}/admin/notes' \
-H 'x-medusa-access-token: {api_token}'

Some files were not shown because too many files have changed in this diff Show More