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

Create sale

This endpoint allows merchants to create records of sales directly in Rewardful.

Request

Method
URL

POST

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

Parameters

Parameter
Required?
Description

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

referral_id

yes

ID of the existing referral who made the purchase

Example

curl --request POST \
  --url https://api.getrewardful.com/v1/sales \
  -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 \
  -d referral_id=d154e622-278a-4103-b191-5cbebae4047a

Response

Response code
Body

200

A sale object (JSON)

Invalid parameters

Response code
Body

422

JSON object describing validation errors.

Authentication failure

Response code
Body

401

Description of the authentication failure.

Last updated

Was this helpful?