Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save somewherewarm-snippets/6203a294111c2ce5a2e88e8af0f0a000 to your computer and use it in GitHub Desktop.
Save somewherewarm-snippets/6203a294111c2ce5a2e88e8af0f0a000 to your computer and use it in GitHub Desktop.
curl -X POST https://example.com/wp-json/wc/v3/orders \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"set_paid": false,
"billing": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "john.doe@example.com",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"address_1": "969 Market",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"line_items": [
{
"product_id": 93,
"quantity": 2
},
{
"product_id": 22,
"variation_id": 23,
"quantity": 1
}
],
"shipping_lines": [
{
"method_id": "flat_rate",
"method_title": "Flat Rate",
"total": "10.00"
}
],
"gift_cards": [
{
"code": "4TZ8-JK7F-3WLQ-SKP3",
"amount": 70
}
]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment