Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Update order and checkout order endpoint documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hsingyuc committed Oct 10, 2023
1 parent 65014d8 commit d8c1eee
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/StoreApi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ Available resources in the Store API are listed below, with links to more detail
| [`Cart Coupons`](docs/cart-coupons.md) | `GET`, `POST`, `DELETE` | [`/wc/store/v1/cart/coupons`](docs/cart-coupons.md#list-cart-coupons) |
| | `GET`, `DELETE` | [`/wc/store/v1/cart/coupon/:code`](docs/cart-coupons.md#single-cart-coupon) |
| [`Checkout`](docs/checkout.md) | `GET`, `POST` | [`/wc/store/v1/checkout`](docs/checkout.md)
| [`Checkout order`](docs/checkout-order.md) | `POST` | [`/wc/store/v1/checkout`](docs/checkout-order.md) |
| [`Order`](docs/order.md) | `GET` | [`/wc/store/v1/order`](docs/order.md)
| [`Checkout order`](docs/checkout-order.md) | `POST` | [`/wc/store/v1/checkout/:id`](docs/checkout-order.md) |
| [`Order`](docs/order.md) | `GET` | [`/wc/store/v1/order/:id`](docs/order.md)
| [`Products`](docs/products.md) | `GET` | [`/wc/store/v1/products`](docs/products.md#list-products) |
| | `GET` | [`/wc/store/v1/products/:id`](docs/products.md#single-product) |
| [`Product Collection Data`](docs/product-collection-data.md) | `GET` | [`/wc/store/v1/products/collection-data`](docs/product-collection-data.md) |
Expand Down
7 changes: 2 additions & 5 deletions src/StoreApi/docs/checkout-order.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

## Table of Contents <!-- omit in toc -->

- [Get Checkout Order Data](#get-checkout-order-data)
- [Process Order and Payment](#process-order-and-payment)
- [Payment Data](#payment-data)

The checkout order API facilitates the processing of existing orders and handling payments.

All checkout order endpoints require [Nonce Tokens](nonce-tokens.md).

- [Get Checkout Order Data](#get-checkout-order-data)
- [Process Order and Payment](#process-order-and-payment)

## Process Order and Payment

Accepts the final chosen payment method, and any additional payment data, then attempts payment and
Expand Down Expand Up @@ -164,7 +161,7 @@ For further information on generating a `stripe_source` please check [the Stripe

[We're hiring!](https://woocommerce.com/careers/) Come work with us!

🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/checkout.md)
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/checkout-order.md)

<!-- /FEEDBACK -->

32 changes: 16 additions & 16 deletions src/StoreApi/docs/order.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@

## Table of Contents <!-- omit in toc -->

- [Get Order](#get-order)
- [Responses](#responses)
- [Order Response](#order-response)
- [Error Response](#error-response)
- [Get Order](#get-order)

The order API returns the pay-for-order order.

## Get Order

```http
GET /order/{ORDER_ID}?key={KEY}&billing_email={BILLING_EMAIL}
```

There is one required parameter for this endpoint which is `key`. `billing_email` must be added for guest orders.

```sh
curl "https://example-store.com/wp-json/wc/store/v1/order/{ORDER_ID}?key={KEY}&billing_email={BILLING_EMAIL}"
```

Returns the full order object response (see [Order Response](#order-response)).

## Responses

Order endpoints return responses in the same format as `/cart`; an order object which includes order items, applied coupons, shipping addresses and rates, and non-sensitive customer data.
Expand Down Expand Up @@ -230,27 +244,13 @@ If an order action cannot be performed, an error response will be returned. This
}
```

## Get Order

```http
GET /order/{ORDER_ID}?key={KEY}&billing_email={BILLING_EMAIL}
```

There is one required parameter for this endpoint which is `key`. `billing_email` must be added for guest orders.

```sh
curl "https://example-store.com/wp-json/wc/store/v1/order/{ORDER_ID}?key={KEY}&billing_email={BILLING_EMAIL}"
```

Returns the full order object response (see [Order Response](#order-response)).

<!-- FEEDBACK -->

---

[We're hiring!](https://woocommerce.com/careers/) Come work with us!

🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/cart.md)
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/order.md)

<!-- /FEEDBACK -->

0 comments on commit d8c1eee

Please sign in to comment.