Skip to main content

Create a new migrated payment

POST 

https://api.freemius.com/v1/products/{product_id}/subscriptions/{subscription_id}/payments.json

Auth:Bearer TokenSCOPE: PRODUCT

Product-scoped API tokens allow you to operate on the product itself. This token usually allows read-only access to the product configuration and write access to several operations on subscriptions, customers, payments, and more. For most SaaS or app integrations, this is the token you will need.

  1. Go to the Freemius Developer Dashboard.
  2. Open the Settings page of the relevant product.
  3. Click the API & Keys tab.
  4. Copy the API Bearer Authorization Token from the UI.

In case you want to synchronize migrated subscription from the legacy platform use this endpoint to have our system log a migrated payment. Depending on your use case you can also choose to extend the license. Please read our migration documentation to learn more.

Request

Path Parameters

    product_id integer<int64>required

    The ID of the product.

    Possible values: >= 1

    Example: 1234
    subscription_id integer<int64>required

    The ID of the Subscription.

    Possible values: >= 1

    Example: 1234

Bodyrequired

    grossnumber<float>

    The payment amount (not including taxes).

    Example: 2075.45
    payment_external_idstring

    The external ID of the gateway entity.

    Example: abcde12345
    sourcestring

    The source of the migration data. To get support migrating from other platform please see our documentation.

    Possible values: [freemius, edd, others, easydigitaldownloads, woo, wc, woocommerce, gumroad, cc, codecanyon, tf, themeforest, appsumo, sendowl, whmcs, ls, lemonsqueezy]

    Example: ls
    vatnumber
    Default value: 0

    The actual tax amount. It could be any kind of tax, not necessarily VAT. For example we support US Sales Tax.

    Example: 1.24
    gateway_feenumber<float>
    Default value: 0

    The fee that the gateway took for processing this payment.

    Example: 2.99
    processed_atstring<date-time>nullable

    The cart completion date.

    Example: 2025-01-01 00:00:00
    is_extend_licenseboolean

    Whether the license should be extended. The default value is false.

    next_paymentstring<date-time>nullable

    Datetime of the next payment, or null if cancelled.

    Example: 2025-01-01 00:00:00

Responses

The payment was successfully created.

Schema
user_idstring<int64>

The ID of the user the entity belongs to.

Possible values: >= 1

Example: 123456
install_idstring<int64>nullable

The ID of the installation or site the entity is associated with, a null value means it has not been associated with an installation yet.

Possible values: >= 1

Example: 123456
plan_idstring<int64>

The ID of the plan associated with the entity.

Possible values: >= 1

Example: 123456
pricing_idstring<int64>

The ID of the pricing associated with the entity.

Possible values: >= 1

Example: 123456
license_idstring<int64>

The ID of the license associated with the entity.

Possible values: >= 1

Example: 123456
ipstring<ipv4|ipv6>nullable

The IP address associated with the entity.

Example: 0.0.0.0
country_codestring

The ISO 3166-1 alpha 2 two-letter country code associated with the entity.

Example: us
zip_postal_codestringnullable

The postal/zip code of the location.

Example: 92710
vat_idstringnullable

The business VAT number (EU or UK territories) or other tax ID (for example Sales Tax ID for the US).

Example: GB12345678
coupon_idstring<int64>nullable

The ID of the coupon associated with the entity.

Possible values: >= 1

Example: 123456
user_card_idstring<int64>

The ID of the user card that was used for this payment.

Example: 12345
sourcenumber

The source of the migration data. To get support migrating from other platform please see our documentation.

  • 0 - Freemius
  • 1 - Other
  • 2 - Easy Digital Downloads (EDD)
  • 3 - WooCommerce (WC)
  • 4 - Rating Widget
  • 5 - Gumroad
  • 6 - CodeCanyon
  • 7 - ThemeForest
  • 8 - AppSumo
  • 9 - SendOwl
  • 10 - WHMCS
  • 11 - Lemon Squeezy

Possible values: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

plugin_idstring<int64>

The ID of the product the entity belongs to.

Possible values: >= 1

Example: 123456
external_idstring

The external ID of the gateway entity.

Example: abcde12345
gatewaystringnullable

The gateway used for the purchase. The gateway will be set to null when purchasing a product with a 100% discount.

environmentnumber

The environment the entity belongs to. 0 means it belongs to the production environment, 1 means it belongs to the sandbox environment.

Possible values: [1, 0]

Example: 0
idstring<int64>

The unique identifier of the entity.

Possible values: >= 1

Example: 123456
createdstring<date-time>

The date and time the entity was created, under UTC timezone.

Example: 2025-01-01 00:00:00
updatedstring<date-time>nullable

The date and time the entity was updated, under UTC timezone. If null then the entity was never updated since its creation.

Example: 2025-01-01 00:00:00
currencystring

3-char currency code.

Possible values: >= 3 characters and <= 3 characters, [usd, eur, gbp]

refund_reasonstringnullable
Example: Refunded due to a bug in the plugin.
subscription_idstring<int64>nullable

The ID of the subscription associated with the entity.

Possible values: >= 1

Example: 123456
payment_presentment_idstring<int64>

The ID of the presentment payment.

Possible values: >= 1

Example: 123456
grossnumber<float>

The payment amount (not including taxes).

Example: 2075.45
bound_payment_idstring<int64>

The ID of the payment that this payment is bound to, in case of a refund or chargeback/dispute.

Possible values: >= 1

Example: 123456
gateway_feenumber<float>
Default value: 0

The fee that the gateway took for processing this payment.

Example: 2.99
vatnumber
Default value: 0

The actual tax amount. It could be any kind of tax, not necessarily VAT. For example we support US Sales Tax.

Example: 1.24
is_renewalboolean
Default value: false

If the payment is a renewal.

typestring
Default value: payment

The type of the payment.

Possible values: [payment, refund, disputed, won_dispute, lost_dispute, chargeback]

We use essential cookies to enable our site to function. With your consent, we also use analytics and advertising cookies to understand how visitors interact with our site and to improve our services.
Learn More