Management API · Points and member support
Create a points adjustment
POST/v1/members/{id}/points_adjustments
Adds or removes points by hand. Use it for goodwill after a bad order, to fix a mistake, or to bring balances over from a previous program. Don't use it to credit orders: send those to POST /v1/orders so they earn at the right rate and refunds work.
Permissions: Secret key with points:adjust.
Guide
Points and rewardsRequest headers#
Idempotency-KeystringRequiredRequired on this endpoint. Any string up to 255 characters; use a UUID v4. Missing returns400 idempotency_key_required.Max Length 255
Path parameters#
idstring (uuid)RequiredThe member id.
Request body#
pointsintegerRequiredPositive to add, negative to remove. Not zero.reasonstringRequiredgoodwill,correction,migrationorother.One ofgoodwill,correction,migration,othernotestringWhy, for your team. For exampleCold latte at South Congress.counts_toward_tierbooleanDefaultfalse. Whentrue, positive points also add tolifetime_pointsand can move the member up a tier. Use it formigrationso guests keep their status.Default false
Returns the activity entry it created. This is the goodwill adjustment from Maya's history above, made on October 27 when she had 308 Beans:
unPLUG records which secret key made every adjustment. A negative adjustment can't take the balance below zero: removing 500 Beans from Maya now, with 420, fails and nothing changes.
Response fields#
Returns 201 with ActivityEntry
idstring (uuid)typestringWhat happened. See the table below. May grow.One ofearn,bonus,redeem,adjust,reverse,expirepointsintegerSigned change:62for an earn,-500for a redeem.balance_afterintegerThe member'spoints_balanceright after this entry.descriptionstringA short line you can show the guest, for exampleVisit at South CongressorFree drip coffee.order_idstring (uuid)NullableThe order that caused it, forearn,bonus,redeemandreverse.reward_idstring (uuid)NullableThe reward bought, forredeem.adjustment_reasonstringNullableForadjust:goodwill,correction,migrationorother.One ofgoodwill,correction,migration,othercreated_atstring (date-time)
Error descriptions#
The Idempotency-Key header is missing.
points is zero or not an integer, or reason isn't one of the four values.
No member with this id.
The member was deleted.
A negative adjustment is larger than the balance.
This key was used with a different body.
Any endpoint can also return the common errors.