Skip to main content

Purchase

Status: Trusted Tester

Purchases are a receipt of items sold to your organization. When selling to another organization you will want to create an Order instead.

Purchases generated by the platform to record the wholesale fees that are charged to a partner for products they sell to their customers. One time fees and each renewal will appear as separate line items broken out per customer.

All amounts will be specified in the minor unit of the purchase's currency. For example in the case of USD that would be cents. For more info on converting between minor and major units see this wikipedia article.

idstringrequired

A platform generated identifier for the purchase

typestringrequired

Possible values: [purchases]

attributes object
createdAtdate-time

The time at which the purchase was created

statusCodestring

The payment status of the purchase will be one of the following:

  • draft: Indicates the purchase is not closed yet. New line items can be added when the purchase is in this state.
  • due: The purchase has been finalized and is ready to be paid.
  • overdue: The purchase is unpaid and has past the due date
  • paid: The full amount has been paid.
  • uncollectible: After multiple failed attempts to collect payment it's unlikely that this purchase will be paid

Possible values: [draft, due, overdue, paid, uncollectible]

Default value: draft
discountAmountinteger

The sum of all price reductions applied to products

taxAmountinteger

The sum of all taxes applied to items of the purchase

totalinteger

The total amount the purchase is for, accounting for any applied discounts or taxes

currencyCodestring

The 3 letter currency code as defined by ISO 4217

Possible values: >= 3 characters and <= 3 characters

Example: CAD
lineItems object[]
  • Array [
  • skustring

    The unique identifier of a product or service

    customerIdstring

    The ID of the organization that purchased the product

    unitAmountinteger

    The wholesale cost of the product before discounts or taxes are applied.

    discountAmountinteger

    The total amount the cost of this product has been reduced by

    taxAmountinteger

    The total amount of tax charged for this product

    totalinteger

    The final cost of the product accounting for any applied discounts or taxes

  • ]
  • relationships object
    partner object

    The partner that the purchase receipt is being sent to. They will be the one who purchased the product at a wholesale rate and activated it for one of their customers

    data objectrequired
    idstringrequired

    Possible values: >= 3 characters and <= 4 characters

    typestringrequired

    Possible values: [partner]

    Purchase
    {
    "id": "string",
    "type": "purchases",
    "attributes": {
    "createdAt": "2024-07-29T15:51:28.071Z",
    "statusCode": "draft",
    "discountAmount": 0,
    "taxAmount": 0,
    "total": 0,
    "currencyCode": "CAD",
    "lineItems": [
    {
    "sku": "string",
    "customerId": "string",
    "unitAmount": 0,
    "discountAmount": 0,
    "taxAmount": 0,
    "total": 0
    }
    ]
    },
    "relationships": {
    "partner": {
    "data": {
    "id": "string",
    "type": "partner"
    }
    }
    }
    }