Skip to navigation

Refund a sale

View as Markdown

Called by your server when a sale you reported is refunded. amount is the total refunded on the invoice so far, in the sale’s minor unit; leave it out for the whole sale. A retry of the same total adds nothing and a higher total adds the difference. taxAmount is the total tax refunded so far; it is required for a partial refund of a sale with tax, and kept on the refund for your records only: the commission is reduced by the refunded share of the sale (amount over the sale’s amount), whatever the tax split. An unpaid commission is reduced pro rata; a paid one becomes a recovery for you to review. Every call is real: try it on a test directory.

curl -X POST https://v1.api.partnerpage.io/api/deal-registration/private/v1alpha/tracking/refund/ \
-H "Authorization: Token $PARTNERPAGE_API_KEY" -H "Content-Type: application/json" \
-d '{"trackingId":"pp_trk_…","invoiceId":"inv_123","amount":5000}'

Authentication

AuthorizationToken

Your API key, sent as Authorization: Token <your API key>

Request

This endpoint expects an object.
trackingIdstringRequiredformat: "^pp_trk_[A-Za-z0-9]{24}$"1-40 characters

The directory’s Tracking ID, from Settings › Partner links (pp_trk_…).

invoiceIdstringRequired1-255 characters
The invoice ID of the sale.
amountlong or nullOptional1-1000000000000000

The total refunded on the invoice so far, in the sale’s minor unit; left out for the whole sale.

taxAmountlong or nullOptional0-1000000000000000

The total tax refunded on the invoice so far, in the same unit. Required for a partial refund of a sale with tax; kept for your records, as the commission is reduced by the refunded share of the sale’s amount whatever the tax split.

Response

Refund recorded, or nothing new when the total was already recorded (refundId null)

saleIdstringformat: "uuid"
invoiceIdstring
refundedAmountinteger
refundIdstring or nullformat: "uuid"

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error