This is a sample of API doc
This repository explains how to use a sample YAML-based OAuth 2 Open API that allows access to a catalog and authenticated access to users, orders, shopping carts, payments and shipments information.
This sample API allows access to a catalog and authenticated access to users, orders, shopping carts, payments and shipments information at the following endpoints:
Service/Endpoint | YAML File | User Specific? |
---|---|---|
carts | carts.yaml | yes |
catalogs | catalogs.yaml | no |
customers | users.yaml | yes |
orders | orders.yaml | yes |
payments | payments.yaml | yes |
shipments | shipments.yaml | yes |
You will need an access token to access the sample API endpoints. An OAuth token that contains the customerID grants API access.
Authorization (customer ID): 043fa14b-f6b5-4b96-9cd3-b5f0819b6283
Get or update cart items for a specific customer
This endpoint retrieves all cart items for a specific customer.
GET https://example.com/api/v1/c/cart/
Parameter | Description |
---|---|
ID | The customer ID |
This endpoint updates a cart for a specific customer.
PUT https://example.com/api/v1/c/carts/
Parameter | Description |
---|---|
ID | The customer ID |
All users (authenticated or unauthenticated) can view available catalog items.
This endpoint retrieves all catalog items.
GET https://example.com/api/v1/c/catalogs
None
This endpoint adds a catalog items.
POST https://example.com/api/v1/c/catalogs
None
This endpoint updates a catalog item.
PATCH https://example.com/api/v1/c/catalogs/
Parameter | Description |
---|---|
ID | The ID of the catalog item |
This endpoint deletes a catalog item.
DELETE https://example.com/api/v1/c/catalogs/
Parameter | Description |
---|---|
ID | The ID of the catalog item |
Retrieve and maintain customer data using this endpoint.
This endpoint retrieves a single customer.
GET https://example.com/api/v1/c/customers/
Parameter | Description |
---|---|
ID | The ID of the catalog item |
This endpoint adds a specific customer.
POST https://example.com/api/v1/c/customers
None
This endpoint updates a specific customer.
PATCH https://example.com/api/v1/c/customers/
Parameter | Description |
---|---|
ID | The ID of the customer |
This endpoint deletes a specific customer.
DELETE https://example.com/api/v1/c/customers/
Parameter | Description |
---|---|
ID | The ID of the customer |
List all orders for a customer or add to a specific customer order using this endpoint.
This endpoint retrieves all orders for a single customer.
GET https://example.com/api/v1/c/orders/
Parameter | Description |
---|---|
ID | The ID of the customer |
Note: The order endpoint gets the shipment status from the shipments endpoint, using the shipmentID from successful shipments. See Shipments for more information about the shipmentID.
This example API sends a variety of status codes but can be generally categorized as below.
Error Code | Meaning |
---|---|
2XX | Success |
4XX | Client errors e.g. request validation errors |
5xx | Server errors e.g. database connectivity or internal service call errors |