Namirasoft Payment API V1

Namira Software Corporation Payment API Version 1 (1.4.2)

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}

Copied!

Invoice

List

Returns the invoice list

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

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)

--transaction_id (Integer)

--subscription_id (String)

--title (String)

--refund (Boolean)

--currency (String)

--description (String)

--invoice_items (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}

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}

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}

Copied!

Get

Returns a sales item by an id

ns-payment salesitem get {id}

Copied!

SubscriptionPaid

List

Returns the subscription paid list

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

Copied!

Get

Returns a subscription paid by an id

ns-payment subscriptionpaid get {id}

Copied!

ListOf

Returns the subscription paid list

ns-payment subscriptionpaid listof {user_id} {sales_item_id}

Copied!

SubscriptionCategory

List

Returns the subscription category list

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

Copied!

Get

Returns a subscription category by id.

ns-payment subscriptioncategory get {id}

Copied!

Create

Creates a new subscription category

ns-payment subscriptioncategory create

Copied!

--entity_id (String)

--category_id (String)

Delete

Deletes a subscription category by an id.

ns-payment subscriptioncategory delete {id}

Copied!

SubscriptionField

List

Returns the subscription field list

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

Copied!

Get

Returns a subscription field by id.

ns-payment subscriptionfield get {id}

Copied!

Create

Creates a new subscription field

ns-payment subscriptionfield create

Copied!

--entity_id (String)

--field_id (String)

--value (String)

--description (String)

Update

Updates a subscription field by an id

ns-payment subscriptionfield update {id}

Copied!

--entity_id (String)

--field_id (String)

--value (String)

--description (String)

Delete

Deletes a subscription field by an id.

ns-payment subscriptionfield delete {id}

Copied!

SubscriptionTag

List

Returns the subscription tag list

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

Copied!

Get

Returns a subscription tag by id.

ns-payment subscriptiontag get {id}

Copied!

Create

Creates a new subscription tag

ns-payment subscriptiontag create

Copied!

--entity_id (String)

--name (String)

--value (String)

--description (String)

Update

Updates a subscription tag by an id

ns-payment subscriptiontag update {id}

Copied!

--entity_id (String)

--name (String)

--value (String)

--description (String)

Delete

Deletes a subscription tag by an id.

ns-payment subscriptiontag delete {id}

Copied!

Subscription

List

Returns the subscription list

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

Copied!

Get

Returns a subscription by an id

ns-payment subscription get {id}

Copied!

Cancel

Cancels a subscription by an id

ns-payment subscription cancel {id}

Copied!

Checkout

Checkouts to a subscription

ns-payment subscription checkout

Copied!

--gateway (Enum)

--sales_item_id (String)

--offer_id (String)

--success_url (String)

--cancel_url (String)

Schemas


Invoice

{
  "name": "Invoice",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "user_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "product_id": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "transaction_id": {
      "type": "Integer",
      "required": false
    },
    "subscription_id": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "title": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "refund": {
      "type": "Boolean",
      "required": true
    },
    "canceled": {
      "type": "Boolean",
      "required": true
    },
    "currency": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "total": {
      "type": "Integer",
      "required": true
    },
    "total_paid": {
      "type": "Integer",
      "required": true
    },
    "total_refunded": {
      "type": "Integer",
      "required": true
    },
    "total_balance": {
      "type": "Integer",
      "required": true
    },
    "description": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "createdAt": {
      "type": "DateTime",
      "required": true
    },
    "updatedAt": {
      "type": "DateTime",
      "required": true
    }
  }
}

InvoiceInput

{
  "name": "InvoiceInput",
  "type": "Object",
  "required": true,
  "fields": {
    "product_id": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "transaction_id": {
      "type": "Integer",
      "required": false
    },
    "subscription_id": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "title": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "refund": {
      "type": "Boolean",
      "required": true
    },
    "currency": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "description": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "invoice_items": {
      "type": "Array",
      "required": true,
      "items": [
        {
          "name": "InvoiceItemInput",
          "type": "Object",
          "required": true,
          "fields": {
            "sales_item_id": {
              "type": "String",
              "required": false,
              "allowEmpty": true
            },
            "offer_id": {
              "type": "String",
              "required": false,
              "allowEmpty": true
            },
            "name": {
              "type": "String",
              "required": true,
              "allowEmpty": false
            },
            "quantity": {
              "type": "Integer",
              "required": true
            },
            "description": {
              "type": "String",
              "required": false,
              "allowEmpty": true
            },
            "price": {
              "type": "Integer",
              "required": false
            }
          }
        }
      ]
    }
  }
}

InvoiceItemInput

{
  "name": "InvoiceItemInput",
  "type": "Object",
  "required": true,
  "fields": {
    "sales_item_id": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "offer_id": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "name": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "quantity": {
      "type": "Integer",
      "required": true
    },
    "description": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "price": {
      "type": "Integer",
      "required": false
    }
  }
}

Offer

{
  "name": "Offer",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "product_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "name": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "logo": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "subscription_duration_unit": {
      "name": "OfferSubscriptionDurationUnit",
      "type": "Enum",
      "required": true,
      "valids": [
        "Day",
        "Week",
        "Month",
        "Year"
      ]
    },
    "subscription_duration_value": {
      "type": "Integer",
      "required": true
    },
    "applies_at": {
      "type": "DateTime",
      "required": false
    },
    "expires_at": {
      "type": "DateTime",
      "required": false
    },
    "recommended": {
      "type": "Boolean",
      "required": true
    },
    "description": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "createdAt": {
      "type": "DateTime",
      "required": true
    },
    "updatedAt": {
      "type": "DateTime",
      "required": true
    }
  }
}

Payment

{
  "name": "Payment",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "user_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "product_id": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "transaction_id": {
      "type": "Integer",
      "required": false
    },
    "invoice_id": {
      "type": "Integer",
      "required": false
    },
    "subscription_id": {
      "type": "Integer",
      "required": false
    },
    "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"
      ]
    },
    "currency": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "amount": {
      "type": "Integer",
      "required": true
    },
    "description": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "createdAt": {
      "type": "DateTime",
      "required": true
    },
    "updatedAt": {
      "type": "DateTime",
      "required": true
    }
  }
}

SalesItem

{
  "name": "SalesItem",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "product_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "name": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "method": {
      "name": "SalesItemMethod",
      "type": "Enum",
      "required": true,
      "valids": [
        "OneTime",
        "Subscription",
        "Metered"
      ]
    },
    "onetime_consumable": {
      "type": "Boolean",
      "required": true
    },
    "onetime_expire_unit": {
      "name": "SalesItemOnetimeExpireUnit",
      "type": "Enum",
      "required": true,
      "valids": [
        "None",
        "Day",
        "Week",
        "Month",
        "Year"
      ]
    },
    "onetime_expire_value": {
      "type": "Integer",
      "required": true
    },
    "onetime_limit_unit": {
      "name": "SalesItemOnetimeLimitUnit",
      "type": "Enum",
      "required": true,
      "valids": [
        "None",
        "Day",
        "Week",
        "Month",
        "Year"
      ]
    },
    "onetime_limit_value": {
      "type": "Integer",
      "required": true
    },
    "onetime_limit_count": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "description": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "createdAt": {
      "type": "DateTime",
      "required": true
    },
    "updatedAt": {
      "type": "DateTime",
      "required": true
    }
  }
}

SubscriptionPaid

{
  "name": "SubscriptionPaid",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "Integer",
      "required": true
    },
    "user_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "product_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "invoice_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "sales_item_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "offer_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "applies_at": {
      "type": "DateTime",
      "required": true
    },
    "expires_at": {
      "type": "DateTime",
      "required": true
    },
    "createdAt": {
      "type": "DateTime",
      "required": true
    },
    "updatedAt": {
      "type": "DateTime",
      "required": true
    }
  }
}

SubscriptionCategory

{
  "name": "SubscriptionCategory",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "Integer",
      "required": true
    },
    "user_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "entity_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "category_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "createdAt": {
      "type": "DateTime",
      "required": true
    },
    "updatedAt": {
      "type": "DateTime",
      "required": true
    }
  }
}

EntityCategoryInput

{
  "name": "EntityCategoryInput",
  "type": "Object",
  "required": true,
  "fields": {
    "entity_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "category_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    }
  }
}

SubscriptionField

{
  "name": "SubscriptionField",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "Integer",
      "required": true
    },
    "user_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "entity_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "field_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "value": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "description": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "createdAt": {
      "type": "DateTime",
      "required": true
    },
    "updatedAt": {
      "type": "DateTime",
      "required": true
    }
  }
}

EntityFieldInput

{
  "name": "EntityFieldInput",
  "type": "Object",
  "required": true,
  "fields": {
    "entity_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "field_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "value": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "description": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    }
  }
}

SubscriptionTag

{
  "name": "SubscriptionTag",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "Integer",
      "required": true
    },
    "user_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "entity_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "name": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "value": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "description": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    },
    "createdAt": {
      "type": "DateTime",
      "required": true
    },
    "updatedAt": {
      "type": "DateTime",
      "required": true
    }
  }
}

EntityTagInput

{
  "name": "EntityTagInput",
  "type": "Object",
  "required": true,
  "fields": {
    "entity_id": {
      "type": "String",
      "required": true,
      "min": 20,
      "max": 20,
      "allowEmpty": false
    },
    "name": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "value": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "description": {
      "type": "String",
      "required": false,
      "allowEmpty": true
    }
  }
}

Subscription

{
  "name": "Subscription",
  "type": "Object",
  "required": true,
  "fields": {
    "id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "user_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "product_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "offer_id": {
      "type": "String",
      "required": true,
      "allowEmpty": false
    },
    "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,
      "allowEmpty": false
    },
    "createdAt": {
      "type": "DateTime",
      "required": true
    },
    "updatedAt": {
      "type": "DateTime",
      "required": true
    }
  }
}

Enums

OfferSubscriptionDurationUnit

Day

Week

Month

Year

GatewayType

Stripe

PaymentGateway

Stripe

PaymentStatus

Incomplete

Canceled

Succeeded

Failed

SalesItemMethod

OneTime

Subscription

Metered

SalesItemOnetimeExpireUnit

None

Day

Week

Month

Year

SalesItemOnetimeLimitUnit

None

Day

Week

Month

Year

SubscriptionGateway

Stripe

SubscriptionStatus

Active

Canceled

Incomplete

IncompleteExpired

PastDue

Paused

Trialing

Unpaid

Namira Software Corporation

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