PlanewardPlaneward Docs
PlanewardPlaneward Docs
Welcome

Developers

REST APIAuthenticationWebhooksMCPEmbedded projectsTask description contentDeveloper hub

API

List payments GETCreate a payment POSTGet a payment GETUpdate a payment PATCHRecord a purchase POSTReverse a purchase POST
Payments

Record a purchase

Idempotent on `externalRef`. `201` when recorded, `200` when already recorded. Amount is integer minor units.

POST
/purchases

Idempotent on externalRef. 201 when recorded, 200 when already recorded. Amount is integer minor units.

Authorization

x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/purchases" \  -H "Content-Type: application/json" \  -d '{    "externalRef": "string",    "amount": 0,    "buyer": {}  }'
{  "data": {    "status": "recorded",    "warning": "amount_mismatch",    "payment": {      "id": "string",      "amount": 0,      "status": "string",      "paidAt": "2019-08-24T14:15:22Z",      "note": "string",      "invoiceId": "string",      "currency": "string",      "source": "INVOICE",      "sourceLabel": "string",      "externalRef": "string",      "contactId": "string",      "opportunityId": "string",      "items": [        {          "name": "string",          "sku": "string",          "quantity": 0,          "unitAmount": 0        }      ],      "metaEventId": "string",      "metaSend": true,      "reversedAt": "2019-08-24T14:15:22Z",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "customer": {        "id": "string",        "name": "string",        "email": "string",        "company": "string"      },      "invoice": {        "id": "string",        "invoiceNumber": "string"      },      "metaConversion": {        "id": "string",        "siteId": "string",        "paymentId": "string",        "eventName": "string",        "eventId": "string",        "contactId": "string",        "value": 0,        "currency": "string",        "eventTime": "2019-08-24T14:15:22Z",        "status": "QUEUED",        "skipReason": "string",        "reversed": true,        "attempts": 0,        "lastError": "string",        "sentAt": "2019-08-24T14:15:22Z",        "exportedAt": "2019-08-24T14:15:22Z"      }    },    "siteVisit": {      "credited": true,      "siteId": "string"    }  }}

Update a payment PATCH

A new `amount` on a completed payment posts a ledger adjustment and re-splits revenue share; `adjustmentNote` records why. `status: REFUNDED` on a completed payment runs the full refund (ledger, revenue share, plan access). Refunded payments accept only `note` and `paidAt`. Invoice payments cannot change `amount` (edit the invoice). `customerId` is locked once the payment granted a plan, paid an invoice, or posted to the ledger. Changing `amount` and refunding in one request is rejected. Omit `paidAt` to keep the payment's current paid date.

Reverse a purchase POST

Marks the payment refunded. Idempotent if already refunded.

externalRef*string
amount*integer

Integer minor units

currency?string
paidAt?string

When the buyer paid (ISO-8601). A value that isn't a valid date returns 400.

Formatdate-time
sourceLabel?string
opportunityId?string
invoiceId?string
items?array<>
note?string
buyer*
siteVisit?

The pw_site / pw_vid values your app received from a linked-domain link. Verified against the site's pageviews in this workspace; an unverifiable visit never fails the purchase.

meta?