# 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](https://dashboard.freemius.com/).
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](https://freemius.com/help/documentation/migration/) to learn more.

## Request[​](#request "Direct link to request")

### Path Parameters

* **product\_id**
  <!-- -->
  integer\<int64>[](#param-property-subscriptions-create-new-migrated-payment-param-path-product-id "Direct link to product_id")required

  The ID of the product.

  **Possible values:** `>= 1`

  **Example:<!-- -->&#x20;**`1234`

  **subscription\_id**
  <!-- -->
  integer\<int64>[](#param-property-subscriptions-create-new-migrated-payment-param-path-subscription-id "Direct link to subscription_id")required

  The ID of the Subscription.

  **Possible values:** `>= 1`

  **Example:<!-- -->&#x20;**`1234`

application/json

### Body**required**

* **gross**number\<float>[](#schema-property-subscriptions-create-new-migrated-payment-request-body-gross-number-float "Direct link to gross")

  The payment amount (not including taxes).

  **Example:<!-- -->&#x20;**`2075.45`

  **payment\_external\_id**string[](#schema-property-subscriptions-create-new-migrated-payment-request-body-payment-external-id-string "Direct link to payment_external_id")

  The external ID of the gateway entity.

  **Example:<!-- -->&#x20;**`abcde12345`

  **source**string[](#schema-property-subscriptions-create-new-migrated-payment-request-body-source-string "Direct link to source")

  The source of the migration data. To get support migrating from other platform please see our [documentation](https://freemius.com/help/documentation/migration/).

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

  **Example:<!-- -->&#x20;**`ls`

  **vat**number[](#schema-property-subscriptions-create-new-migrated-payment-request-body-vat-number "Direct link to vat")

  **Default value:<!-- -->&#x20;**`0`

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

  **Example:<!-- -->&#x20;**`1.24`

  **gateway\_fee**number\<float>[](#schema-property-subscriptions-create-new-migrated-payment-request-body-gateway-fee-number-float "Direct link to gateway_fee")

  **Default value:<!-- -->&#x20;**`0`

  The fee that the gateway took for processing this payment.

  **Example:<!-- -->&#x20;**`2.99`

  **processed\_at**string\<date-time>[](#schema-property-subscriptions-create-new-migrated-payment-request-body-processed-at-string-date-time "Direct link to processed_at")nullable

  The cart completion date.

  **Example:<!-- -->&#x20;**`2025-01-01 00:00:00`

  **is\_extend\_license**boolean[](#schema-property-subscriptions-create-new-migrated-payment-request-body-is-extend-license-boolean "Direct link to is_extend_license")

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

  **next\_payment**string\<date-time>[](#schema-property-subscriptions-create-new-migrated-payment-request-body-next-payment-string-date-time "Direct link to next_payment")nullable

  Datetime of the next payment, or `null` if cancelled.

  **Example:<!-- -->&#x20;**`2025-01-01 00:00:00`

## Responses[​](#responses "Direct link to Responses")

* 200
* 400
* 401
* 402
* 404

The payment was successfully created.

application/json

**Schema**

**user\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-user-id-string-int64 "Direct link to user_id")

The ID of the user the entity belongs to.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**install\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-install-id-string-int64 "Direct link to install_id")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:<!-- -->&#x20;**`123456`

**plan\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-plan-id-string-int64 "Direct link to plan_id")

The ID of the plan associated with the entity.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**pricing\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-pricing-id-string-int64 "Direct link to pricing_id")

The ID of the pricing associated with the entity.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**license\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-license-id-string-int64 "Direct link to license_id")

The ID of the license associated with the entity.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**ip**string\<ipv4|ipv6>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-ip-string-ipv4-ipv6 "Direct link to ip")nullable

The IP address associated with the entity.

**Example:<!-- -->&#x20;**`0.0.0.0`

**country\_code**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-country-code-string "Direct link to country_code")

The [ISO 3166-1 alpha 2](http://www.wikiwand.com/en/ISO_3166-1_alpha-2) two-letter country code associated with the entity.

**Example:<!-- -->&#x20;**`us`

**zip\_postal\_code**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-zip-postal-code-string "Direct link to zip_postal_code")nullable

The postal/zip code of the location.

**Example:<!-- -->&#x20;**`92710`

**vat\_id**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-vat-id-string "Direct link to vat_id")nullable

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

**Example:<!-- -->&#x20;**`GB12345678`

**coupon\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-coupon-id-string-int64 "Direct link to coupon_id")nullable

The ID of the coupon associated with the entity.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**user\_card\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-user-card-id-string-int64 "Direct link to user_card_id")

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

**Example:<!-- -->&#x20;**`12345`

**source**number[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-source-number "Direct link to source")

The source of the migration data. To get support migrating from other platform please see our [documentation](https://freemius.com/help/documentation/migration/).

* `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\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-plugin-id-string-int64 "Direct link to plugin_id")

The ID of the product the entity belongs to.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**external\_id**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-external-id-string "Direct link to external_id")

The external ID of the gateway entity.

**Example:<!-- -->&#x20;**`abcde12345`

**gateway**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-gateway-string "Direct link to gateway")nullable

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

**environment**number[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-environment-number "Direct link to environment")

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:<!-- -->&#x20;**`0`

**id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-id-string-int64 "Direct link to id")

The unique identifier of the entity.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**created**string\<date-time>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-created-string-date-time "Direct link to created")

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

**Example:<!-- -->&#x20;**`2025-01-01 00:00:00`

**updated**string\<date-time>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-updated-string-date-time "Direct link to updated")nullable

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

**Example:<!-- -->&#x20;**`2025-01-01 00:00:00`

**currency**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-currency-string "Direct link to currency")

3-char currency code.

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

**refund\_reason**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-refund-reason-string "Direct link to refund_reason")nullable

**Example:<!-- -->&#x20;**`Refunded due to a bug in the plugin.`

**subscription\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-subscription-id-string-int64 "Direct link to subscription_id")nullable

The ID of the subscription associated with the entity.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**payment\_presentment\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-payment-presentment-id-string-int64 "Direct link to payment_presentment_id")

The ID of the presentment payment.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**gross**number\<float>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-gross-number-float "Direct link to gross")

The payment amount (not including taxes).

**Example:<!-- -->&#x20;**`2075.45`

**bound\_payment\_id**string\<int64>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-bound-payment-id-string-int64 "Direct link to bound_payment_id")

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

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**gateway\_fee**number\<float>[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-gateway-fee-number-float "Direct link to gateway_fee")

**Default value:<!-- -->&#x20;**`0`

The fee that the gateway took for processing this payment.

**Example:<!-- -->&#x20;**`2.99`

**vat**number[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-vat-number "Direct link to vat")

**Default value:<!-- -->&#x20;**`0`

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

**Example:<!-- -->&#x20;**`1.24`

**is\_renewal**boolean[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-is-renewal-boolean "Direct link to is_renewal")

**Default value:<!-- -->&#x20;**`false`

If the payment is a renewal.

**type**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-type-string "Direct link to type")

**Default value:<!-- -->&#x20;**`payment`

The type of the payment.

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

Bad request. The request could not be understood by the server due to malformed syntax or arguments.

application/json

**Schema**

**path**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`

Unauthorized access error. The request requires [authentication](https://freemius.com/help/api/#bearer-token-authentication) but was not provided or the provided authentication does not satisfy the required permissions.

application/json

**Schema**

**path**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`

The request is missing the specified argument.

application/json

**Schema**

**path**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`

The requested resource was not found.

application/json

**Schema**

**path**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-subscriptions-create-new-migrated-payment-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`
