Skip to content

Commit

Permalink
Add sample response for PUT wc/v3/orders/batch with both success and …
Browse files Browse the repository at this point in the history
…error cases
  • Loading branch information
hafizrahman committed Dec 12, 2024
1 parent cebfe75 commit 44bc77a
Showing 1 changed file with 160 additions and 0 deletions.
160 changes: 160 additions & 0 deletions example/src/test/resources/wc/orders-batch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"update": [
{
"id": 1032,
"parent_id": 0,
"status": "completed",
"currency": "USD",
"version": "9.4.3",
"prices_include_tax": false,
"date_created": "2024-12-04T11:21:17",
"date_modified": "2024-12-04T11:23:19",
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "3.00",
"shipping_tax": "0.00",
"cart_tax": "0.00",
"total": "224.00",
"total_tax": "0.00",
"customer_id": 0,
"order_key": "wc_order_XXXXXXXXXXXX",
"billing": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"state": "",
"postcode": "",
"country": "",
"email": "",
"phone": ""
},
"shipping": {
"first_name": "",
"last_name": "",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"state": "",
"postcode": "",
"country": "",
"phone": ""
},
"payment_method": "",
"payment_method_title": "",
"transaction_id": "",
"customer_ip_address": "",
"customer_user_agent": "",
"created_via": "rest-api",
"customer_note": "Asdasd",
"date_completed": "2024-12-04T11:23:19",
"date_paid": "2024-12-04T11:23:19",
"cart_hash": "",
"number": "1032",
"meta_data": [
{
"id": 18608,
"key": "_wc_order_attribution_source_type",
"value": "mobile_app"
}
],
"line_items": [
{
"id": 162,
"name": "Album",
"product_id": 71,
"variation_id": 0,
"quantity": 1,
"tax_class": "",
"subtotal": "216.00",
"subtotal_tax": "0.00",
"total": "216.00",
"total_tax": "0.00",
"taxes": [],
"meta_data": [],
"sku": "woo-album",
"price": 216,
"image": {
"id": "100",
"src": "https://example.com/images/album-1.jpg"
},
"parent_name": null,
"bundled_by": "",
"bundled_item_title": "",
"bundled_items": []
}
],
"tax_lines": [],
"shipping_lines": [
{
"id": 166,
"method_title": "Reg ship",
"method_id": "flat_rate",
"instance_id": "",
"total": "3.00",
"total_tax": "0.00",
"taxes": [],
"meta_data": []
}
],
"fee_lines": [
{
"id": 165,
"name": "Just for you",
"tax_class": "",
"tax_status": "none",
"amount": "",
"total": "5.00",
"total_tax": "0.00",
"taxes": [],
"meta_data": []
}
],
"coupon_lines": [],
"refunds": [],
"payment_url": "https://example.com/checkout/order-pay/1032/",
"is_editable": false,
"needs_payment": false,
"needs_processing": true,
"date_created_gmt": "2024-12-04T04:21:17",
"date_modified_gmt": "2024-12-04T04:23:19",
"date_completed_gmt": "2024-12-04T04:23:19",
"date_paid_gmt": "2024-12-04T04:23:19",
"currency_symbol": "$",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc/v3/orders/1032",
"targetHints": {
"allow": [
"GET",
"POST",
"PUT",
"PATCH",
"DELETE"
]
}
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc/v3/orders"
}
]
}
},
{
"id": "525",
"error": {
"code": "woocommerce_rest_shop_order_invalid_id",
"message": "Id tidak valid.",
"data": {
"status": 400
}
}
}
]
}

0 comments on commit 44bc77a

Please sign in to comment.