docs: update store cURL examples in OAS (#9099)

This commit is contained in:
Shahed Nasser
2024-09-16 15:37:11 +03:00
committed by GitHub
parent 8584031041
commit 35ffaf73d7
79 changed files with 183 additions and 89 deletions

View File

@@ -1 +1 @@
curl -X POST '{backend_url}/auth/customer/{auth_provider}'
curl -X POST '{backend_url}/auth/customer/github'

View File

@@ -1 +1 @@
curl -X POST '{backend_url}/auth/customer/{auth_provider}/callback'
curl -X POST '{backend_url}/auth/customer/github/callback?code=123'

View File

@@ -1 +1,6 @@
curl -X POST '{backend_url}/auth/customer/{auth_provider}/register'
curl -X POST '{backend_url}/auth/customer/emailpass/register' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "customer@gmail.com",
"password": "supersecret"
}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/auth/token/refresh' \
-H 'Authorization: Bearer {token}'

View File

@@ -1 +1,2 @@
curl -X POST '{backend_url}/store/carts'
curl -X POST '{backend_url}/store/carts' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/carts/{id}'
curl '{backend_url}/store/carts/{id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl -X POST '{backend_url}/store/carts/{id}'
curl -X POST '{backend_url}/store/carts/{id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl -X POST '{backend_url}/store/carts/{id}/complete'
curl -X POST '{backend_url}/store/carts/{id}/complete' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1,5 +1,6 @@
curl -X POST '{backend_url}/store/carts/{id}/line-items' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"variant_id": "{value}",
"quantity": 3360689747918848,

View File

@@ -1 +1,2 @@
curl -X DELETE '{backend_url}/store/carts/{id}/line-items/{line_id}'
curl -X DELETE '{backend_url}/store/carts/{id}/line-items/{line_id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1,5 +1,6 @@
curl -X POST '{backend_url}/store/carts/{id}/line-items/{line_id}' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"quantity": 8980402259623936,
"metadata": {}

View File

@@ -1 +1,2 @@
curl -X DELETE '{backend_url}/store/carts/{id}/promotions'
curl -X DELETE '{backend_url}/store/carts/{id}/promotions' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1,5 +1,6 @@
curl -X POST '{backend_url}/store/carts/{id}/promotions' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"promo_codes": [
"{value}"

View File

@@ -1,5 +1,6 @@
curl -X POST '{backend_url}/store/carts/{id}/shipping-methods' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"option_id": "{value}"
}'

View File

@@ -1 +1,2 @@
curl -X POST '{backend_url}/store/carts/{id}/taxes'
curl -X POST '{backend_url}/store/carts/{id}/taxes' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/collections'
curl '{backend_url}/store/collections' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/collections/{id}'
curl '{backend_url}/store/collections/{id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/currencies'
curl '{backend_url}/store/currencies' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/currencies/{code}'
curl '{backend_url}/store/currencies/{code}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1,5 +1,7 @@
curl -X POST '{backend_url}/store/customers' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"email": "Monserrate.Leannon88@yahoo.com",
"company_name": "{value}",

View File

@@ -1,2 +1,3 @@
curl '{backend_url}/store/customers/me' \
-H 'Authorization: Bearer {access_token}'
-H 'Authorization: Bearer {access_token}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1,6 +1,7 @@
curl -X POST '{backend_url}/store/customers/me' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"company_name": "{value}",
"first_name": "{value}",

View File

@@ -1,2 +1,3 @@
curl '{backend_url}/store/customers/me/addresses' \
-H 'Authorization: Bearer {access_token}'
-H 'Authorization: Bearer {access_token}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1,6 +1,7 @@
curl -X POST '{backend_url}/store/customers/me/addresses' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"metadata": {},
"first_name": "{value}",

View File

@@ -1,2 +1,3 @@
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Authorization: Bearer {access_token}'

View File

@@ -1,2 +1,3 @@
curl '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Authorization: Bearer {access_token}'
-H 'Authorization: Bearer {access_token}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1,17 +1,7 @@
curl -X POST '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"metadata": {},
"first_name": "{value}",
"last_name": "{value}",
"phone": "{value}",
"company": "{value}",
"address_1": "{value}",
"address_2": "{value}",
"city": "{value}",
"country_code": "{value}",
"province": "{value}",
"postal_code": "{value}",
"address_name": "{value}"
}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/orders'
curl '{backend_url}/store/orders' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/orders/{id}'
curl '{backend_url}/store/orders/{id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1,5 +1,6 @@
curl -X POST '{backend_url}/store/payment-collections' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"cart_id": "{value}",
"region_id": "{value}",

View File

@@ -1,5 +1,6 @@
curl -X POST '{backend_url}/store/payment-collections/{id}/payment-sessions' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"provider_id": "{value}"
}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/payment-providers'
curl '{backend_url}/store/payment-providers' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/product-categories'
curl '{backend_url}/store/product-categories' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/product-categories/{id}'
curl '{backend_url}/store/product-categories/{id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/products'
curl '{backend_url}/store/products' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/products/{id}'
curl '{backend_url}/store/products/{id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/regions'
curl '{backend_url}/store/regions' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/return-reasons'
curl '{backend_url}/store/return-reasons' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/return-reasons/{id}'
curl '{backend_url}/store/return-reasons/{id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}'

View File

@@ -1,5 +1,6 @@
curl -X POST '{backend_url}/store/return' \
-H 'Content-Type: application/json' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
--data-raw '{
"order_id": "{value}",
"items": [

View File

@@ -1 +1,2 @@
curl '{backend_url}/store/shipping-options'
curl '{backend_url}/store/shipping-options' \
-H 'x-publishable-api-key: {your_publishable_api_key}'