Make an order

In this step, we are going to see how to create an order. You need to have understood the last step.

Send only the order regarding Cherry Checkout (the one where a customer added a Cherry on top).

Request :

{
  "trackId": "ODR-5736",
  "orderPrice": 85.90,
  "cherryPrice": 2,
  "currency": "eur",
  "status": "validated",
  "customer": {
    "firstname": "Michael",
    "lastname": "Jackson",
    "email": "kingofpop@mjcompany.com",
    "birthday": "1958-08-29",
    "gender": "m",
    "address": "55 rue de la république",
    "zipCode": "75000",
    "city": "Paris",
    "country": "France"
  }
}
		
Order
trackId* string The order ID, must be unique for each new order.
orderPrice* float The order total price, without the Cherry Checkout participation value.
cherryPrice integer The Cherry Checkout price that you invoiced to the customer. A warning is sending if the amount is different that the one expected.
currency* string The order currency.
Accepted values: 'chf', 'eur'
status string The order statut.
Accepted values: 'validated', 'canceled'
customer* Customer A customer ID
Customer
firstname* string Customer firstname.
lastname* string Customer name.
email* string Customer e-mail address.
birthday string Customer birthdate. Desired format: 'YYYY-MM-DD'
gender string Customer gender.
Desired value: 'm', 'f'
address string Customer address, with number, and street name.
zipCode string Customer ZIP code
city string Customer city
country string Customer country

Answer :

{
  "trackId": "ODR-5736",
  "orderPrice": 85.90,
  "cherryPrice": 2,
  "currency": "eur",
  "status": "validated",
  "mode": "test"
}
		
200 - Success
trackId string The track ID as saved earlier.
orderPrice float The total order amount as saved.
cherryPrice integer The participation amount as saved. You can check if it is the same invoiced to your customer.
currency string The currency order as saved.
status string The Cherry Checkout order statut.
Possible values : 'validated' ou 'canceled'
mode string The order saved mode.
Possible values : 'prod' ou 'test'
400 - Bad Request
trackId already exists 3001 You already have made an order with this track ID.
no charity available 3004 This exception appear when no charity is linked to your e-commerce website. In this case, contact us.
customer not set 3006 You haven’t defined the customer field.
customer email is missing 3010 You didn’t give the customer e-mail address.
unknown error 3030 There is an unknown error when creating your order. Please contact-us.
orderPrice required 3031 The order amount hasn’t been send or is not correct.
wrong currency 3032 The currency is not correct.
wrong status 3033 The order statut is not correct.
unknown error 3040 There is an unknown error when creating your order. Please contact-us.
invalid customer email 3041 The customer e-mail is wrong.
missing customer firstname 3042 You didn’t send the customer first name.
missing customer lastname 3043 You didn’t send the customer name.
500 - Server Error
server error 8000 8999 We have a server error.

Conclusion

If you don’t have any request error, you can check if it has been successfully added into your dashboard. Now that you’re able to make an order, we are going to see how to change it or cancel it.


Do you need help?

Don’t hesitate to contact our technical team if you have any problem.