注文 API
明細、配送先住所、状態(pending、processing、shipped、delivered、cancelled)を持つ注文。メモリ上の固定データで、書き込みはアプリの再起動まで残ります。
あなたのアカウントでこれらのエンドポイントが使えます。各エンドポイントのページの Try it でリクエストを送れます。
- GET
https://api.testingapis.com/api/OrdersList orders with filtering, sorting, search and paginationList orders with filtering, sorting, search and pagination. - POST
https://api.testingapis.com/api/OrdersCreate a orderCreate a order. - GET
https://api.testingapis.com/api/Orders/{id}Get a order by IDGet a order by ID. - PUT
https://api.testingapis.com/api/Orders/{id}Update a orderUpdate a order.
リクエストの例
List orders with filtering, sorting, search and pagination. 完全なリファレンスと Send ボタン(英語).
cURL
curl -X GET "https://api.testingapis.com/api/Orders?limit=2"レスポンス · 200 OK
[
{
"id": 1,
"userId": 101,
"items": [{"productId": 8, "title": "Running Sneakers", "quantity": 1, "price": 89.99}],
"total": 89.99,
"status": "delivered",
"shippingAddress": {
"street": "123 Main St",
"city": "New York",
"state": "NY",
"zip": "10001",
… (3 more lines)サインインして詳細を見る
これらのエンドポイントのパラメータ、リクエストとレスポンスの例、ライブの Try it パネルは、サインインしたメンバー向けです。アカウントは無料で、数秒で作成できます。
絞り込み、並べ替え、ページネーション
一覧エンドポイントは limit、page、offset、sort、order、q を受け付け、任意のフィールド名を完全一致の絞り込みに使えます。件数は X-Total-Count ヘッダーで返ります。書き込みはサーバーを再起動するまでメモリに残るので、テストで自由にレコードを作成・変更・削除できます。 クエリパラメータのリファレンス.