For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update sale

This endpoint allows merchants to manually update sales which aren't directly associated with any payment processors, notably in case of a refund. Unless the underlying commission has been paid already, any change in the charged amount will trigger the commission value to be recalculated accordingly.

Also note that merchants cannot manually update sales associated with a payment processor like Stripe or Paddle.

Request

Method
URL

PUT

https://api.getrewardful.com/v1/sales/:id

Parameters

Parameter
Required?
Description

id

yes

ID of the sale to update

currency

yes

ISO currency code in which the sale is denominated

charged_at

yes

Time at which the sale was charged

invoiced_at

yes

Time at which the sale was invoiced

label

no

Description of the sale (e.g. name of the product)

external_id

yes

The technical ID of the sale as in the merchant system

charge_amount_cents

yes

The charged amount of the sale, in cents

refund_amount_cents

yes

The refunded amount of the sale, in cents

tax_amount_cents

yes

The tax amount of the sale, in cents

Example

curl --request POST \
  --url https://api.getrewardful.com/v1/sales/d154e622-278a-4103-b191-5cbebae4047a \
  -u YOUR_API_SECRET: \
  -d "label=Super sale" \
  -d charged_at=2020-10-18T16:13:12.109Z \
  -d invoiced_at=2020-10-18T16:13:12.109Z \
  -d currency=USD \
  -d external_id=abc-123 \
  -d charge_amount_cents=5000 \
  -d refund_amount_cents=0 \
  -d tax_amount_cents=0

Response

Response code
Body

200

A sale object (JSON)

Invalid parameters

Response code
Body

422

JSON object describing validation errors.

Not found

Response code
Body

404

JSON object describing the error.

Authentication failure

Response code
Body

401

Description of the authentication failure.

Last updated

Was this helpful?