Operations
Create operation
Perform operation in UDS. On success operation appears in operations list in UDS Admin and customer receives push notification about purchase.
Marketing policy
Depends on company discount policy (baseDiscountPolicy field) in company settings. Two values are supported:
- APPLY_DISCOUNT — reduce the bill amount: the customer receives a discount in currency units at the rate specified in participant.discountRate;
- CHARGE_SCORES — accrue bonus points: the customer receives bonus points at the rate specified in participant.cashbackRate.
Key points
- Fields total and points should come from user input but cash field should be calculated using POST /operations/calc;
- Customer will be identified with either promo code passed in parameter code or with participant uid in parameter participant -> uid or by participant's phone in parameter participant -> phone; Difference between them is that with participant -> uid or participant -> phone is not permitted to withdraw points; If given parameter is participant -> uid or participant -> phone then points must be equal to 0.0; Otherwise an error will occurs with code withdrawNotPermitted;
- Only one identifier parameter must be passed: either code, or phone, or uid;
- All numbers should be scaled to two decimal places with "round half up" method. The points value can only be rounded down;
- cash, points and total fields MUST correlate with the "Discount method" setting in UDS;
- The nonce field is a UUID-like string that can only be used once. It is recommended to prevent duplicate operations in case of request retries;
- The externalId field is the cashier identifier. It may only contain Latin letters, digits, and the characters _, -;
- If the register sends cashier information, enable the Staff module in UDS to view detailed cashier data;
- If UDS returns an error, do not finalize the payment in your system until the issue is corrected and a new request is sent successfully.
Errors
| Status | Error Code | Description |
|---|---|---|
| 400 | badRequest | Form validation errors occurred. See JSON errors property for detailed information about errors. |
| 400 | invalidChecksum | Given total, cash and points fields don't correlate with company marketing settings. |
| 400 | withdrawNotPermitted | Method was called with participant -> uid or participant -> phone parameter and points field doesn't equal to 0.0. |
| 400 | insufficientFunds | Given points value greater than actual customer reward point balance. |
| 400 | priceListOnly | Company marketing settings forbid purchases with using reward points, except of price list operations. |
| 400 | discountLimitExceed | Given points/total rate more than allowed by marketing settings. |
| 400 | purchaseByPhoneDisabled | Trying to make purchase by phone when it is disabled in company settings. |
| 401 | unauthorized | Invalid company ID or API Key. |
| 404 | notFound | Customer related to given code or ID is not found. |
| 404 | cashierNotFound | externalCashierId is specified but cashier related to it is not found. |
post/operations
Request body
Example request
{
"tags": [
1
]
}Response
Operation
Changes
No recorded changes to this endpoint across all 1 revision of this API.