Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Method Objective

The method allows importing order history or updating of orders previously imported or created by tracking, as well as changing order statuses.

Don't use this method to create new orders. The creation of new orders should be done by tracking user activity in a way that is appropriate for your platform. See REST API, JS SDK or Mobile SDKs.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/sync/ordersPOSTapplication/json

Parameters

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredStore Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
ordersArrayrequiredArray with orders. See the description below.

Order Object

NameTypeRequirementDescription
idstringrequiredOrder ID. If the Order ID and Order Number aren't the same, it's recommended to use the Order Number value. This will allow for easy comparison of orders on both sides. Also, note that the source of this property must be the same as the one used in the User Activity Tracking (Purchase Event).
statusstringrequiredOrder Status. The status matching must be set there in advance: Account > Settings > Order Statuses
channelstringrequiredThe name of the sales channel. Any string value, such as "website", "offline", "mobile_ios", "mobile_android", "infokiosk", "pos", "callcenter", etc.
datenumberrequiredOrder date in UNIX timestamp format.
valueObjectrequiredDescribes the parts from which the final cost of the order is calculated. See the description below.
itemsArrayrequired in some cases

Describes the products of the order. See the description below. 

This property should be missing if the synchronization of the status of an existing order is performed.

offlinebooleanoptionallySets whether the order was created offline or not. Default: false.
emailstringoptionallyUser's email.
phonestringoptionallyUser's phone.
loyalty_idstringoptionallyUser's Loyalty ID.
location_idstringoptionallyUser's Location. Should match the value from the previously given list of locations (HTTP API, XML feed).
promocodestringoptionallyThe promo code that the user applied at checkout.
delivery_typestringoptionallyDelivery Type, e.g. "self_pickup", "delivery", "pickup_point", etc.
delivery_addressstringoptionallyShipping address.
delivery_datestringoptionallyDate of delivery, planned or completed. Format: YYYY-MM-DD.
delivery_timestringoptionallyTime of delivery, planned or completed. Format: hh:mm.
payment_typestringoptionallyThe method of payment, such as "cash", "card", "wire", etc.

Value Object

NameTypeRequirementDescription
totalnumberrequired

Order's total value. 

The "total" value should be equal to the "cash" plus the "bonuses" plus the "delivery" minus the "discount" values.

cashnumberoptionallyDescribes how much of the order's value was paid by cash.
bonusesnumberoptionallyDescribes how much of the order's value was paid by bonuses.
deliverynumberoptionallyDescribes the cost of delivery of the order.
discountnumberoptionallyDescribes the amount of discount (in money) applied to the order.

Items Array

NameTypeRequirementDescription
idstringrequiredProduct ID.
pricenumberrequiredCost per unit of product.
quantitynumberrequiredThe product quantity in the order.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

403 ForbiddenThe request was unsuccessful.
404 Not FoundThere are no mandatory parameters in the query.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

Request Example

curl 'https://api.personaclick.com/segments/add' \
  -X 'POST' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d 'shop_id=0d42fd8b713d0752776ca589cc0056&shop_secret=0123456789abcdef0123456789abcdef&email=john.doe%40examplemail.com&phone=4400114527199&segment_id=100500'

  • No labels