Namirasoft Payment API V1

Namira Software Corporation Payment API Version 1 (1.4.66)

Install


To use this cli, we need to first Install Nodejs, then run the following command.

npm i -g namirasoft-payment-api-v1

Copied!

Commands


Healthz

Get

Returns the application health status

ns-payment healthz get

Copied!

Value

List

Returns the value list of a given table and column

ns-payment value list {table} {column} {search} {field_id} {limit}

Copied!

Invoice

List

Returns the invoice list

ns-payment invoice list {filters} {page} {size} {sorts}

Copied!

Get

Returns an invoice by an id

ns-payment invoice get {id}

Copied!

_Create

Creates a new invoice

ns-payment invoice _create

Copied!

--product_id (String)

--subscription_id (String)

--title (String)

--currency (String)

--description (String)

--invoice_item (Array)

--invoice_cost (Array)

_Delete

Deletes an invoice by an id

ns-payment invoice _delete {id}

Copied!

Cancel

Cancels an invoice by an id

ns-payment invoice cancel {id}

Copied!

Offer

List

Returns the offer list

ns-payment offer list {filters} {page} {size} {sorts}

Copied!

Get

Returns an offer by an id

ns-payment offer get {id}

Copied!

OneTime

Checkout

Creates a onetime checkout

ns-payment onetime checkout {invoice_id}

Copied!

--gateway (Enum)

--amount (Integer)

--success_url (String)

--cancel_url (String)

Payment

List

Returns the payment list

ns-payment payment list {filters} {page} {size} {sorts}

Copied!

Get

Returns a payment by an id

ns-payment payment get {id}

Copied!

SalesItem

List

Returns the sales item list

ns-payment salesitem list {filters} {page} {size} {sorts}

Copied!

Get

Returns a sales item by an id

ns-payment salesitem get {id}

Copied!

SubscriptionCancellationReason

List

Returns the subscription cancellation reason list

ns-payment subscriptioncancellationreason list {filters} {page} {size} {sorts}

Copied!

Get

Returns a subscription cancellation reason by an id

ns-payment subscriptioncancellationreason get {id}

Copied!

SubscriptionItem

List

Returns the subscription item list

ns-payment subscriptionitem list {filters} {page} {size} {sorts}

Copied!

SubscriptionPaid

List

Returns the subscription paid list

ns-payment subscriptionpaid list {filters} {page} {size} {sorts}

Copied!

Get

Returns a subscription paid by an id

ns-payment subscriptionpaid get {id}

Copied!

_ListFor

Returns the subscription paid list for a user_id

ns-payment subscriptionpaid _listfor {user_id} {sales_item_id}

Copied!

Subscription

AcceptCancellationOffer

Accept a cancellation offer for a subscription

ns-payment subscription acceptcancellationoffer {id} {reason_id}

Copied!

--gateway (Enum)

--success_url (String)

--cancel_url (String)

Cancel

Cancels a subscription by an id

ns-payment subscription cancel {id}

Copied!

--cancellation_reason_id (String)

--cancellation_explaination (String)

CheckoutOffer

Checkouts an offer for subscription

ns-payment subscription checkoutoffer {offer_id}

Copied!

--gateway (Enum)

--success_url (String)

--cancel_url (String)

List

Returns the subscription list

ns-payment subscription list {filters} {page} {size} {sorts}

Copied!

GetCancellationOffer

Returns the cancellation offer of a subscription by an id for a reason

ns-payment subscription getcancellationoffer {id} {reason_id}

Copied!

Get

Returns a subscription by an id

ns-payment subscription get {id}

Copied!

Product

List

Returns the product list

ns-payment product list {filters} {page} {size} {sorts}

Copied!

Get

Returns a product by an id

ns-payment product get {id}

Copied!

Schemas


Invoice

{
  "name": "Invoice",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "user_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "transaction_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "transaction_id_reversed": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "subscription_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "title": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "refund": {
      "type": "Boolean",
      "required": true
    },
    "canceled": {
      "type": "Boolean",
      "required": true
    },
    "total": {
      "type": "Integer",
      "required": true
    },
    "total_fee": {
      "type": "Integer",
      "required": true
    },
    "total_discount": {
      "type": "Integer",
      "required": true
    },
    "total_tax": {
      "type": "Integer",
      "required": true
    },
    "total_payable": {
      "type": "Integer",
      "required": true
    },
    "total_paid": {
      "type": "Integer",
      "required": true
    },
    "total_refunded": {
      "type": "Integer",
      "required": true
    },
    "total_balance": {
      "type": "Integer",
      "required": true
    },
    "currency": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "description": {
      "type": "String",
      "required": false
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

InvoiceFull

{
  "name": "InvoiceFull",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "user_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "transaction_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "transaction_id_reversed": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "subscription_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "title": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "refund": {
      "type": "Boolean",
      "required": true
    },
    "canceled": {
      "type": "Boolean",
      "required": true
    },
    "total": {
      "type": "Integer",
      "required": true
    },
    "total_fee": {
      "type": "Integer",
      "required": true
    },
    "total_discount": {
      "type": "Integer",
      "required": true
    },
    "total_tax": {
      "type": "Integer",
      "required": true
    },
    "total_payable": {
      "type": "Integer",
      "required": true
    },
    "total_paid": {
      "type": "Integer",
      "required": true
    },
    "total_refunded": {
      "type": "Integer",
      "required": true
    },
    "total_balance": {
      "type": "Integer",
      "required": true
    },
    "currency": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "description": {
      "type": "String",
      "required": false
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    },
    "invoice_item": {
      "type": "Array",
      "required": true,
      "items": [
        {
          "name": "InvoiceItem",
          "type": "Object",
          "required": true,
          "fields": {
            "id": {
              "type": "Integer",
              "required": true
            },
            "invoice_id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "sales_item_id": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "offer_id": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "offer_item_id": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "transaction_id": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "transaction_id_reversed": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "transaction_id_expiry": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "name": {
              "type": "String",
              "required": true,
              "max": 255
            },
            "quantity": {
              "type": "Integer",
              "required": true
            },
            "price": {
              "type": "Integer",
              "required": false
            },
            "total": {
              "type": "Integer",
              "required": true
            },
            "description": {
              "type": "String",
              "required": false
            },
            "created_at": {
              "type": "DateTime",
              "required": true
            },
            "updated_at": {
              "type": "DateTime",
              "required": true
            }
          }
        }
      ]
    },
    "invoice_cost": {
      "type": "Array",
      "required": true,
      "items": [
        {
          "name": "InvoiceCost",
          "type": "Object",
          "required": true,
          "fields": {
            "id": {
              "type": "Integer",
              "required": true
            },
            "invoice_id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "type": {
              "name": "InvoiceCostType",
              "type": "Enum",
              "required": false,
              "valids": [
                "Fee",
                "Discount",
                "Tax"
              ]
            },
            "amount": {
              "type": "Integer",
              "required": true
            },
            "description": {
              "type": "String",
              "required": false
            },
            "created_at": {
              "type": "DateTime",
              "required": true
            },
            "updated_at": {
              "type": "DateTime",
              "required": true
            }
          }
        }
      ]
    }
  }
}

InvoiceItem

{
  "name": "InvoiceItem",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "Integer",
      "required": true
    },
    "invoice_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "offer_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "offer_item_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "transaction_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "transaction_id_reversed": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "transaction_id_expiry": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "name": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "quantity": {
      "type": "Integer",
      "required": true
    },
    "price": {
      "type": "Integer",
      "required": false
    },
    "total": {
      "type": "Integer",
      "required": true
    },
    "description": {
      "type": "String",
      "required": false
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

InvoiceCost

{
  "name": "InvoiceCost",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "Integer",
      "required": true
    },
    "invoice_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "type": {
      "name": "InvoiceCostType",
      "type": "Enum",
      "required": false,
      "valids": [
        "Fee",
        "Discount",
        "Tax"
      ]
    },
    "amount": {
      "type": "Integer",
      "required": true
    },
    "description": {
      "type": "String",
      "required": false
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

InvoiceInput

{
  "name": "InvoiceInput",
  "type": "Object",
  "required": true,
  "fields": {
    "product_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "subscription_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "title": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "currency": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "description": {
      "type": "String",
      "required": false
    },
    "invoice_item": {
      "type": "Array",
      "required": true,
      "items": [
        {
          "name": "InvoiceItemInput",
          "type": "Object",
          "required": true,
          "fields": {
            "sales_item_id": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "offer_id": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "offer_item_id": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "name": {
              "type": "String",
              "required": true,
              "max": 255
            },
            "quantity": {
              "type": "Integer",
              "required": true
            },
            "description": {
              "type": "String",
              "required": false
            },
            "price": {
              "type": "Integer",
              "required": false
            }
          }
        }
      ]
    },
    "invoice_cost": {
      "type": "Array",
      "required": true,
      "items": [
        {
          "name": "InvoiceCostInput",
          "type": "Object",
          "required": true,
          "fields": {
            "type": {
              "name": "InvoiceCostType",
              "type": "Enum",
              "required": false,
              "valids": [
                "Fee",
                "Discount",
                "Tax"
              ]
            },
            "amount": {
              "type": "Integer",
              "required": true
            },
            "description": {
              "type": "String",
              "required": false
            }
          }
        }
      ]
    }
  }
}

InvoiceItemInput

{
  "name": "InvoiceItemInput",
  "type": "Object",
  "required": true,
  "fields": {
    "sales_item_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "offer_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "offer_item_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "name": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "quantity": {
      "type": "Integer",
      "required": true
    },
    "description": {
      "type": "String",
      "required": false
    },
    "price": {
      "type": "Integer",
      "required": false
    }
  }
}

InvoiceCostInput

{
  "name": "InvoiceCostInput",
  "type": "Object",
  "required": true,
  "fields": {
    "type": {
      "name": "InvoiceCostType",
      "type": "Enum",
      "required": false,
      "valids": [
        "Fee",
        "Discount",
        "Tax"
      ]
    },
    "amount": {
      "type": "Integer",
      "required": true
    },
    "description": {
      "type": "String",
      "required": false
    }
  }
}

Offer

{
  "name": "Offer",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "name": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "logo": {
      "type": "String",
      "required": false,
      "max": 255
    },
    "order": {
      "type": "Integer",
      "required": true
    },
    "recurring": {
      "type": "Integer",
      "required": true
    },
    "recurring_duration_value": {
      "type": "Integer",
      "required": false
    },
    "recurring_duration_unit": {
      "name": "OfferRecurringDurationUnit",
      "type": "Enum",
      "required": false,
      "valids": [
        "Day",
        "Week",
        "Month",
        "Year"
      ]
    },
    "applies_at": {
      "type": "DateTime",
      "required": false
    },
    "expires_at": {
      "type": "DateTime",
      "required": false
    },
    "recommended": {
      "type": "Boolean",
      "required": true
    },
    "features": {
      "type": "String",
      "required": true
    },
    "description": {
      "type": "String",
      "required": true
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

OfferItem

{
  "name": "OfferItem",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "offer_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "name": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "logo": {
      "type": "String",
      "required": false,
      "max": 255
    },
    "order": {
      "type": "Integer",
      "required": true
    },
    "dominant": {
      "type": "Boolean",
      "required": true
    },
    "consumable": {
      "type": "Boolean",
      "required": true
    },
    "consumable_asset_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "expire_value": {
      "type": "Integer",
      "required": false
    },
    "expire_unit": {
      "name": "OfferItemExpireUnit",
      "type": "Enum",
      "required": false,
      "valids": [
        "None",
        "Day",
        "Week",
        "Month",
        "Year"
      ]
    },
    "type": {
      "name": "OfferItemType",
      "type": "Enum",
      "required": true,
      "valids": [
        "OneOff",
        "Recurring"
      ]
    },
    "one_off_model": {
      "name": "OfferItemOneOffModel",
      "type": "Enum",
      "required": false,
      "valids": [
        "Flat",
        "Package",
        "Choosable"
      ]
    },
    "one_off_flat_amount": {
      "type": "Integer",
      "required": false
    },
    "one_off_package_amount": {
      "type": "Integer",
      "required": false
    },
    "one_off_package_ceiling_value": {
      "type": "Integer",
      "required": false
    },
    "one_off_package_ceiling_unit": {
      "type": "String",
      "required": false,
      "max": 255
    },
    "one_off_choosable_on_gateway": {
      "type": "Boolean",
      "required": false
    },
    "one_off_choosable_suggested_amount": {
      "type": "Integer",
      "required": false
    },
    "one_off_choosable_limit_min": {
      "type": "Integer",
      "required": false
    },
    "one_off_choosable_limit_max": {
      "type": "Integer",
      "required": false
    },
    "recurring_model": {
      "name": "OfferItemRecurringModel",
      "type": "Enum",
      "required": false,
      "valids": [
        "Flat",
        "Package",
        "Tiered",
        "Usage"
      ]
    },
    "recurring_duration_value": {
      "type": "Integer",
      "required": false
    },
    "recurring_duration_unit": {
      "name": "OfferItemRecurringDurationUnit",
      "type": "Enum",
      "required": false,
      "valids": [
        "Day",
        "Week",
        "Month",
        "Year"
      ]
    },
    "recurring_flat_amount": {
      "type": "Integer",
      "required": false
    },
    "recurring_package_amount": {
      "type": "Integer",
      "required": false
    },
    "recurring_package_ceiling_value": {
      "type": "Integer",
      "required": false
    },
    "recurring_package_ceiling_unit": {
      "type": "String",
      "required": false,
      "max": 255
    },
    "recurring_tiered_type": {
      "name": "OfferItemRecurringTieredType",
      "type": "Enum",
      "required": false,
      "valids": [
        "Volume",
        "Graduated"
      ]
    },
    "recurring_tiered_amounts": {
      "type": "Any",
      "required": false
    },
    "recurring_usage_type": {
      "name": "OfferItemRecurringUsageType",
      "type": "Enum",
      "required": false,
      "valids": [
        "Unit",
        "Package",
        "Tiered"
      ]
    },
    "recurring_usage_name": {
      "type": "String",
      "required": false,
      "max": 255
    },
    "recurring_usage_duration": {
      "type": "String",
      "required": false,
      "max": 255
    },
    "recurring_usage_unit_amount": {
      "type": "Integer",
      "required": false
    },
    "recurring_usage_package_amount": {
      "type": "Integer",
      "required": false
    },
    "recurring_usage_package_ceiling_value": {
      "type": "Integer",
      "required": false
    },
    "recurring_usage_package_ceiling_unit": {
      "type": "String",
      "required": false,
      "max": 255
    },
    "recurring_usage_tiered_type": {
      "name": "OfferItemRecurringUsageTieredType",
      "type": "Enum",
      "required": false,
      "valids": [
        "Volume",
        "Graduated"
      ]
    },
    "recurring_usage_tiered_amounts": {
      "type": "Any",
      "required": false
    },
    "currency": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "was_price": {
      "type": "String",
      "required": false,
      "max": 255
    },
    "description": {
      "type": "String",
      "required": true
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

Subscription

{
  "name": "Subscription",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "user_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "offer_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "gateway": {
      "name": "SubscriptionGateway",
      "type": "Enum",
      "required": true,
      "valids": [
        "Stripe"
      ]
    },
    "status": {
      "name": "SubscriptionStatus",
      "type": "Enum",
      "required": true,
      "valids": [
        "Active",
        "Canceled",
        "Incomplete",
        "IncompleteExpired",
        "PastDue",
        "Paused",
        "Trialing",
        "Unpaid"
      ]
    },
    "description": {
      "type": "String",
      "required": true
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

OfferFull

{
  "name": "OfferFull",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "name": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "logo": {
      "type": "String",
      "required": false,
      "max": 255
    },
    "order": {
      "type": "Integer",
      "required": true
    },
    "recurring": {
      "type": "Integer",
      "required": true
    },
    "recurring_duration_value": {
      "type": "Integer",
      "required": false
    },
    "recurring_duration_unit": {
      "name": "OfferRecurringDurationUnit",
      "type": "Enum",
      "required": false,
      "valids": [
        "Day",
        "Week",
        "Month",
        "Year"
      ]
    },
    "applies_at": {
      "type": "DateTime",
      "required": false
    },
    "expires_at": {
      "type": "DateTime",
      "required": false
    },
    "recommended": {
      "type": "Boolean",
      "required": true
    },
    "features": {
      "type": "String",
      "required": true
    },
    "description": {
      "type": "String",
      "required": true
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    },
    "offer_item": {
      "type": "Array",
      "required": true,
      "items": [
        {
          "name": "OfferItem",
          "type": "Object",
          "required": true,
          "fields": {
            "id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "product_id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "sales_item_id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "offer_id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "name": {
              "type": "String",
              "required": true,
              "max": 255
            },
            "logo": {
              "type": "String",
              "required": false,
              "max": 255
            },
            "order": {
              "type": "Integer",
              "required": true
            },
            "dominant": {
              "type": "Boolean",
              "required": true
            },
            "consumable": {
              "type": "Boolean",
              "required": true
            },
            "consumable_asset_id": {
              "type": "String",
              "required": false,
              "min": 20,
              "max": 20
            },
            "expire_value": {
              "type": "Integer",
              "required": false
            },
            "expire_unit": {
              "name": "OfferItemExpireUnit",
              "type": "Enum",
              "required": false,
              "valids": [
                "None",
                "Day",
                "Week",
                "Month",
                "Year"
              ]
            },
            "type": {
              "name": "OfferItemType",
              "type": "Enum",
              "required": true,
              "valids": [
                "OneOff",
                "Recurring"
              ]
            },
            "one_off_model": {
              "name": "OfferItemOneOffModel",
              "type": "Enum",
              "required": false,
              "valids": [
                "Flat",
                "Package",
                "Choosable"
              ]
            },
            "one_off_flat_amount": {
              "type": "Integer",
              "required": false
            },
            "one_off_package_amount": {
              "type": "Integer",
              "required": false
            },
            "one_off_package_ceiling_value": {
              "type": "Integer",
              "required": false
            },
            "one_off_package_ceiling_unit": {
              "type": "String",
              "required": false,
              "max": 255
            },
            "one_off_choosable_on_gateway": {
              "type": "Boolean",
              "required": false
            },
            "one_off_choosable_suggested_amount": {
              "type": "Integer",
              "required": false
            },
            "one_off_choosable_limit_min": {
              "type": "Integer",
              "required": false
            },
            "one_off_choosable_limit_max": {
              "type": "Integer",
              "required": false
            },
            "recurring_model": {
              "name": "OfferItemRecurringModel",
              "type": "Enum",
              "required": false,
              "valids": [
                "Flat",
                "Package",
                "Tiered",
                "Usage"
              ]
            },
            "recurring_duration_value": {
              "type": "Integer",
              "required": false
            },
            "recurring_duration_unit": {
              "name": "OfferItemRecurringDurationUnit",
              "type": "Enum",
              "required": false,
              "valids": [
                "Day",
                "Week",
                "Month",
                "Year"
              ]
            },
            "recurring_flat_amount": {
              "type": "Integer",
              "required": false
            },
            "recurring_package_amount": {
              "type": "Integer",
              "required": false
            },
            "recurring_package_ceiling_value": {
              "type": "Integer",
              "required": false
            },
            "recurring_package_ceiling_unit": {
              "type": "String",
              "required": false,
              "max": 255
            },
            "recurring_tiered_type": {
              "name": "OfferItemRecurringTieredType",
              "type": "Enum",
              "required": false,
              "valids": [
                "Volume",
                "Graduated"
              ]
            },
            "recurring_tiered_amounts": {
              "type": "Any",
              "required": false
            },
            "recurring_usage_type": {
              "name": "OfferItemRecurringUsageType",
              "type": "Enum",
              "required": false,
              "valids": [
                "Unit",
                "Package",
                "Tiered"
              ]
            },
            "recurring_usage_name": {
              "type": "String",
              "required": false,
              "max": 255
            },
            "recurring_usage_duration": {
              "type": "String",
              "required": false,
              "max": 255
            },
            "recurring_usage_unit_amount": {
              "type": "Integer",
              "required": false
            },
            "recurring_usage_package_amount": {
              "type": "Integer",
              "required": false
            },
            "recurring_usage_package_ceiling_value": {
              "type": "Integer",
              "required": false
            },
            "recurring_usage_package_ceiling_unit": {
              "type": "String",
              "required": false,
              "max": 255
            },
            "recurring_usage_tiered_type": {
              "name": "OfferItemRecurringUsageTieredType",
              "type": "Enum",
              "required": false,
              "valids": [
                "Volume",
                "Graduated"
              ]
            },
            "recurring_usage_tiered_amounts": {
              "type": "Any",
              "required": false
            },
            "currency": {
              "type": "String",
              "required": true,
              "max": 255
            },
            "was_price": {
              "type": "String",
              "required": false,
              "max": 255
            },
            "description": {
              "type": "String",
              "required": true
            },
            "created_at": {
              "type": "DateTime",
              "required": true
            },
            "updated_at": {
              "type": "DateTime",
              "required": true
            }
          }
        }
      ]
    },
    "subscription": {
      "name": "Subscription",
      "type": "Object",
      "required": true,
      "fields": {
        "id": {
          "type": "String",
          "required": true,
          "min": 20,
          "max": 20
        },
        "user_id": {
          "type": "String",
          "required": true,
          "min": 20,
          "max": 20
        },
        "product_id": {
          "type": "String",
          "required": true,
          "min": 20,
          "max": 20
        },
        "sales_item_id": {
          "type": "String",
          "required": true,
          "min": 20,
          "max": 20
        },
        "offer_id": {
          "type": "String",
          "required": true,
          "min": 20,
          "max": 20
        },
        "gateway": {
          "name": "SubscriptionGateway",
          "type": "Enum",
          "required": true,
          "valids": [
            "Stripe"
          ]
        },
        "status": {
          "name": "SubscriptionStatus",
          "type": "Enum",
          "required": true,
          "valids": [
            "Active",
            "Canceled",
            "Incomplete",
            "IncompleteExpired",
            "PastDue",
            "Paused",
            "Trialing",
            "Unpaid"
          ]
        },
        "description": {
          "type": "String",
          "required": true
        },
        "created_at": {
          "type": "DateTime",
          "required": true
        },
        "updated_at": {
          "type": "DateTime",
          "required": true
        }
      }
    }
  }
}

Payment

{
  "name": "Payment",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "user_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "transaction_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "transaction_id_reversed": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "invoice_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "subscription_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "gateway": {
      "name": "PaymentGateway",
      "type": "Enum",
      "required": true,
      "valids": [
        "Stripe"
      ]
    },
    "refund": {
      "type": "Boolean",
      "required": true
    },
    "status": {
      "name": "PaymentStatus",
      "type": "Enum",
      "required": true,
      "valids": [
        "Incomplete",
        "Canceled",
        "Succeeded",
        "Failed"
      ]
    },
    "amount": {
      "type": "Integer",
      "required": true
    },
    "currency": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "description": {
      "type": "String",
      "required": false
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

SalesItem

{
  "name": "SalesItem",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_group_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "name": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "slug": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "logo": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "order": {
      "type": "Integer",
      "required": true
    },
    "consumable": {
      "type": "Boolean",
      "required": true
    },
    "consumable_asset_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "expire_value": {
      "type": "Integer",
      "required": true
    },
    "expire_unit": {
      "name": "SalesItemExpireUnit",
      "type": "Enum",
      "required": true,
      "valids": [
        "None",
        "Day",
        "Week",
        "Month",
        "Year"
      ]
    },
    "description": {
      "type": "String",
      "required": true
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

SubscriptionCancellationReason

{
  "name": "SubscriptionCancellationReason",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "offer_id": {
      "type": "String",
      "required": false,
      "min": 20,
      "max": 20
    },
    "type": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "name": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "order": {
      "type": "Integer",
      "required": true
    },
    "needs_explaination": {
      "type": "Boolean",
      "required": true
    },
    "description": {
      "type": "String",
      "required": true
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

SubscriptionItem

{
  "name": "SubscriptionItem",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "Integer",
      "required": true
    },
    "subscription_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "offer_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "offer_item_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "quantity": {
      "type": "Integer",
      "required": true
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

SubscriptionPaid

{
  "name": "SubscriptionPaid",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "Integer",
      "required": true
    },
    "user_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "invoice_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "offer_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "applies_at": {
      "type": "DateTime",
      "required": true
    },
    "expires_at": {
      "type": "DateTime",
      "required": true
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

SubscriptionFull

{
  "name": "SubscriptionFull",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "user_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "product_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "offer_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20
    },
    "gateway": {
      "name": "SubscriptionGateway",
      "type": "Enum",
      "required": true,
      "valids": [
        "Stripe"
      ]
    },
    "status": {
      "name": "SubscriptionStatus",
      "type": "Enum",
      "required": true,
      "valids": [
        "Active",
        "Canceled",
        "Incomplete",
        "IncompleteExpired",
        "PastDue",
        "Paused",
        "Trialing",
        "Unpaid"
      ]
    },
    "description": {
      "type": "String",
      "required": true
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    },
    "subscription_item": {
      "type": "Array",
      "required": true,
      "items": [
        {
          "name": "SubscriptionItem",
          "type": "Object",
          "required": true,
          "fields": {
            "id": {
              "type": "Integer",
              "required": true
            },
            "subscription_id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "sales_item_id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "offer_id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "offer_item_id": {
              "type": "String",
              "required": true,
              "min": 20,
              "max": 20
            },
            "quantity": {
              "type": "Integer",
              "required": true
            },
            "created_at": {
              "type": "DateTime",
              "required": true
            },
            "updated_at": {
              "type": "DateTime",
              "required": true
            }
          }
        }
      ]
    }
  }
}

Product

{
  "name": "Product",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "name": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "slug": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "logo": {
      "type": "String",
      "required": true,
      "max": 255
    },
    "description": {
      "type": "String",
      "required": false
    },
    "created_at": {
      "type": "DateTime",
      "required": true
    },
    "updated_at": {
      "type": "DateTime",
      "required": true
    }
  }
}

Enums

InvoiceCostType

Fee

Discount

Tax

OfferRecurringDurationUnit

Day

Week

Month

Year

OfferItemExpireUnit

None

Day

Week

Month

Year

OfferItemType

OneOff

Recurring

OfferItemOneOffModel

Flat

Package

Choosable

OfferItemRecurringModel

Flat

Package

Tiered

Usage

OfferItemRecurringDurationUnit

Day

Week

Month

Year

OfferItemRecurringTieredType

Volume

Graduated

OfferItemRecurringUsageType

Unit

Package

Tiered

OfferItemRecurringUsageTieredType

Volume

Graduated

SubscriptionGateway

Stripe

SubscriptionStatus

Active

Canceled

Incomplete

IncompleteExpired

PastDue

Paused

Trialing

Unpaid

GatewayType

Stripe

PaymentGateway

Stripe

PaymentStatus

Incomplete

Canceled

Succeeded

Failed

SalesItemExpireUnit

None

Day

Week

Month

Year

Namira Software Corporation

©Copyright 2010 to 2025 Namira Software Corporation. All rights reserved.