Peach
  1. orders
Peach
  • messaging
    • Send a pre-approved template message
      POST
    • Launch a Broadcast
      POST
  • contacts
    • Create a contact on Peach
      POST
  • orders
    • Create an order
      POST
    • Find order by ID
      GET
    • Create a refund for an order
      POST
  • medias
    • List available Medias
      GET
    • Add a Media
      POST
    • Remove a Media
      DELETE
  1. orders

Create an order

POST
/orders
orders
Create a new order for collecting payments from your customer on WhatsApp

Request

Authorization
Add parameter in header
Authorization
Example:
Authorization: ********************
Body Params application/json
id
string 
optional
This is the publicly visible order ID from your ordering system.
Example:
your_order_id
app_execution_id
string 
optional
This is the Peach's app execution ID, if available. If the order was created via Peach, then your APIs will receive them as part of the order creation request.
Example:
app_exec_1234
type
enum<string> 
optional
Type of products in the order.
Allowed values:
physical_goodsdigital_goods
contact
object (Contact) 
optional
name
string 
optional
Example:
Alfred Hitchcock
email
string 
optional
Example:
alfred@example.com
phone_number
string 
required
Example:
+19019019191 or +919876543210
items
array[object (LineItem) {4}] 
optional
name
string 
optional
Example:
Product 1
amount
integer 
optional
Cost for this line item, 12000 for Rs. 120.00
Example:
12000
quantity
integer 
optional
quantity
Example:
2
sale_amount
integer 
optional
Sale amount of this line item. 12000 for Rs. 120.00. Your sale amount might be different from the displayed price. Cost amount, if available, will appear in strikethrough text
Example:
12000
expiration
object (OrderExpiry) 
optional
timestamp
integer 
optional
Expiry timestamp in epoch. 1711929600 for 00:00 on Apr 1, 2024.
Example:
1711929600
description
string 
optional
Reason why the order expires after the expiry time.
Example:
Sorry, the event is booked.
currency
enum<string> 
optional
Curreny for the order totals, currently only INR is supported.
Allowed value:
INR
subtotal
integer 
optional
Subtotal for the order. 12380 for Rs. 123.80
Example:
12380
tax
object 
optional
value
integer 
optional
Total taxes for the order. 1200 for Rs. 12.00
Example:
1200
description
string 
optional
Example:
GST
shipping
object 
optional
value
integer 
optional
Total taxes for the order. 15,000 for Rs. 150.00
Example:
15000
description
string 
optional
Example:
Prime shipping
discount
object 
optional
value
integer 
optional
Discount value on the order. 1000 for Rs. 10.00
Example:
1000
description
string 
optional
Example:
10OFF on first purchase
total_amount
integer 
optional
Discount value on the order. 200 for Rs. 2.00
Example:
200
Example
{
  "id": "your_order_id",
  "app_execution_id": "app_exec_1234",
  "type": "physical_goods",
  "contact": {
    "name": "Alfred Hitchcock",
    "email": "alfred@example.com",
    "phone_number": "+19019019191 or +919876543210"
  },
  "items": [
    {
      "name": "Product 1",
      "amount": 12000,
      "quantity": 2,
      "sale_amount": 12000
    }
  ],
  "expiration": {
    "timestamp": 1711929600,
    "description": "Sorry, the event is booked."
  },
  "currency": "INR",
  "subtotal": 12380,
  "tax": {
    "value": 1200,
    "description": "GST"
  },
  "shipping": {
    "value": 15000,
    "description": "Prime shipping"
  },
  "discount": {
    "value": 1000,
    "description": "10OFF on first purchase"
  },
  "total_amount": 200
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/orders' \
--header 'Content-Type: application/json' \
--header 'Authorization;' \
--data-raw '{
    "id": "your_order_id",
    "app_execution_id": "app_exec_1234",
    "type": "physical_goods",
    "contact": {
        "name": "Alfred Hitchcock",
        "email": "alfred@example.com",
        "phone_number": "+19019019191 or +919876543210"
    },
    "items": [
        {
            "name": "Product 1",
            "amount": 12000,
            "quantity": 2,
            "sale_amount": 12000
        }
    ],
    "expiration": {
        "timestamp": 1711929600,
        "description": "Sorry, the event is booked."
    },
    "currency": "INR",
    "subtotal": 12380,
    "tax": {
        "value": 1200,
        "description": "GST"
    },
    "shipping": {
        "value": 15000,
        "description": "Prime shipping"
    },
    "discount": {
        "value": 1000,
        "description": "10OFF on first purchase"
    },
    "total_amount": 200
}'

Responses

🟢201Created
application/json
Created order successfully
Body
id
string 
optional
This is the publicly visible order ID from your ordering system.
Example:
your_order_id
app_execution_id
string 
optional
This is the Peach's app execution ID, if available. If the order was created via Peach, then your APIs will receive them as part of the order creation request.
Example:
app_exec_1234
type
enum<string> 
optional
Type of products in the order.
Allowed values:
physical_goodsdigital_goods
contact
object (Contact) 
optional
name
string 
optional
Example:
Alfred Hitchcock
email
string 
optional
Example:
alfred@example.com
phone_number
string 
required
Example:
+19019019191 or +919876543210
items
array[object (LineItem) {4}] 
optional
name
string 
optional
Example:
Product 1
amount
integer 
optional
Cost for this line item, 12000 for Rs. 120.00
Example:
12000
quantity
integer 
optional
quantity
Example:
2
sale_amount
integer 
optional
Sale amount of this line item. 12000 for Rs. 120.00. Your sale amount might be different from the displayed price. Cost amount, if available, will appear in strikethrough text
Example:
12000
expiration
object (OrderExpiry) 
optional
timestamp
integer 
optional
Expiry timestamp in epoch. 1711929600 for 00:00 on Apr 1, 2024.
Example:
1711929600
description
string 
optional
Reason why the order expires after the expiry time.
Example:
Sorry, the event is booked.
currency
enum<string> 
optional
Curreny for the order totals, currently only INR is supported.
Allowed value:
INR
subtotal
integer 
optional
Subtotal for the order. 12380 for Rs. 123.80
Example:
12380
tax
object 
optional
value
integer 
optional
Total taxes for the order. 1200 for Rs. 12.00
Example:
1200
description
string 
optional
Example:
GST
shipping
object 
optional
value
integer 
optional
Total taxes for the order. 15,000 for Rs. 150.00
Example:
15000
description
string 
optional
Example:
Prime shipping
discount
object 
optional
value
integer 
optional
Discount value on the order. 1000 for Rs. 10.00
Example:
1000
description
string 
optional
Example:
10OFF on first purchase
total_amount
integer 
optional
Discount value on the order. 200 for Rs. 2.00
Example:
200
Example
{
  "id": "your_order_id",
  "app_execution_id": "app_exec_1234",
  "type": "physical_goods",
  "contact": {
    "name": "Alfred Hitchcock",
    "email": "alfred@example.com",
    "phone_number": "+19019019191 or +919876543210"
  },
  "items": [
    {
      "name": "Product 1",
      "amount": 12000,
      "quantity": 2,
      "sale_amount": 12000
    }
  ],
  "expiration": {
    "timestamp": 1711929600,
    "description": "Sorry, the event is booked."
  },
  "currency": "INR",
  "subtotal": 12380,
  "tax": {
    "value": 1200,
    "description": "GST"
  },
  "shipping": {
    "value": 15000,
    "description": "Prime shipping"
  },
  "discount": {
    "value": 1000,
    "description": "10OFF on first purchase"
  },
  "total_amount": 200
}
🟠422Parameter Error
Previous
Create a contact on Peach
Next
Find order by ID
Built with