Skip to main content
PATCH
cURL
Updates an existing affiliate sale that was created via the Public API. Use this endpoint to modify sale details such as the total amount, commission, status, or customer information. Only sales created through the public API (POST /affiliate_sales, including website, ios, and android with manual attribution) can be updated with this endpoint. Sales from other sources (e.g., Shopify, SDK cart attribution) cannot be modified via this API.

Important Behavior

  • Commission recalculation: If you update total without providing commission, the commission will be automatically recalculated based on campaign rules.
  • Audit logging: Every successful update is recorded in an internal audit log for support and debugging purposes.
  • Cancelled sales: Sales with status cancelled cannot be updated.

Path Parameters

Request Body

All fields are optional. Only include the fields you want to update.

Request Example

Update the total and let commission recalculate:
Update status to paid:
Update multiple fields with explicit commission:

Response Example

200 OK - Sale updated successfully:

Response Fields

Error Responses

404 Not Found - Sale does not exist or does not belong to your organization:
422 Unprocessable Entity - Validation or business rule error:

Use Cases

This endpoint is useful for:
  • Order Adjustments: Update the total when an order is modified (e.g., partial refund, add-ons)
  • Commission Corrections: Override the commission for special cases or promotions
  • Status Management: Mark sales as paid or cancelled
  • Data Corrections: Fix customer information or sale dates
  • Sync with External Systems: Keep Growi in sync when orders are modified in your system

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
integer
required

ID of the affiliate sale to update

Body

application/json
total
integer

Total amount in cents. If provided without commission, commission is recalculated automatically.

subtotal
integer

Subtotal in cents

currency
enum<string>

Currency code

Available options:
usd,
eur,
gbp
occurred_at
string

When the sale occurred (ISO 8601 string or Unix timestamp)

due_at
string

When the commission becomes due (ISO 8601 string or Unix timestamp)

customer_email
string<email> | null

Customer email address

customer_name
string | null

Customer name

commission
integer

Commission amount in cents. Omit to auto-recalculate when total is updated.

status
enum<string>

Sale status

Available options:
unpaid,
paid,
paid_externally,
cancelled
sub_id
string

Custom source/sub-ID tag (e.g., instagram, youtube) for platform-level tracking

Example:

"instagram"

Response

Affiliate sale updated successfully

data
object