OnePayOnePay

API лавлагаа

Үндсэн URL: https://admin.onepay.tabsystems.tech/api/v1

Бүх endpoint-д Authorization толгой шаардлагатай. Дүн нь бараануудын нийлбэртэй тулгагдаж, төлөвийн шилжилтийг сервер талд хянана — буруу хүсэлт тойм хуудсанд бичсэн алдааны кодуудыг буцаана.

Invoices

Lifecycle: draft → pending (payment link generated) → captured (paid) → fulfilled (confirmed by the merchant). canceled and expired are final. Amounts are always validated against the item sums; every status change is recorded in the invoice status log.

get/invoicesList invoices (paginated, optional created-at date range)

Paginated by pageIndex/limit (max 100 per page); optionally filtered by a createdAt range via startDate/endDate (ISO strings).

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
pageIndexquerynumber
searchquerystring
limitquerynumber
startDatequerystring
endDatequerystring
Жишээ хүсэлт
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/invoices \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "invoices": [
    {
      "id": "string",
      "title": "string",
      "description": "string",
      "currency": "MNT",
      "language": "en",
      "status": "draft",
      "customerFallbackEmail": "string",
      "customerFallbackName": "string",
      "items": [
        {
          "id": null,
          "merchantId": null,
          "name": null,
          "description": null,
          "price": null,
          "currency": null,
          "taxRate": null,
          "isTaxIncluded": null,
          "hasQuantity": null,
          "quantity": null
        }
      ],
      "totalAmount": 0,
      "taxAmount": 0,
      "createdById": "string",
      "createdByFallbackEmail": "string",
      "createdBy": {
        "id": "string",
        "firstname": "string",
        "lastname": "string",
        "email": "string",
        "hashedPassword": "string",
        "mustChangePassword": false,
        "roleId": "string",
        "isActive": false,
        "role": {
          "id": null,
          "name": null,
          "description": null,
          "merchantId": null
        },
        "merchantId": "string",
        "invoices": [
          null
        ],
        "merchant": {
          "id": null,
          "name": null,
          "email": null,
          "phone": null,
          "description": null,
          "address": null,
          "website": null,
          "logoUrl": null
        }
      },
      "customerId": "string",
      "customer": {
        "id": "string",
        "name": "string",
        "email": "email",
        "phone": "string",
        "merchantId": "string",
        "deletedAt": null,
        "createdAt": null,
        "updatedAt": null
      },
      "paymentProviderInvoices": [
        {
          "provider": null,
          "merchantReference": null,
          "gatewayReference": null,
          "redirectUrl": null,
          "expiresAt": null,
          "providerExtra": null,
          "paymentStatus": null,
          "paidAmount": null,
          "paidAt": null,
          "convertedAmount": null
        }
      ],
      "merchantId": "string",
      "expiresAt": null,
      "paymentLink": {
        "expiresAt": null,
        "url": "string"
      },
      "createdAt": null,
      "updatedAt": null
    }
  ],
  "pagination": {
    "page": 0,
    "limit": 0,
    "total": 0,
    "totalPages": 0,
    "hasNext": false,
    "hasPrev": false
  }
}
post/invoicesCreate a draft invoice (registered customer or guest fallback)

Creates a DRAFT invoice for a registered customer (customerId) or a guest (customerFallbackEmail / customerFallbackName). expiresAt must be an ISO 8601 datetime string. totalAmount and taxAmount must equal the sums computed from items — otherwise 422 invalidAmount. Catalog items are referenced by id and priced from the database; custom one-off items supply their own price, taxRate and isTaxIncluded.

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
titlestringзаавал
descriptionstringзаавал
currencyMNT | USD | JPYзаавал
languageen | mn | jaзаавал
itemsarrayзаавал
totalAmountnumberзаавал
taxAmountnumberзаавал
customerIdstring
expiresAtstringзаавал
customerFallbackEmailstring
customerFallbackNamestring
Жишээ хүсэлт
curl -X POST https://admin.onepay.tabsystems.tech/api/v1/invoices \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "id": "string",
  "title": "string",
  "description": "string",
  "currency": "MNT",
  "language": "en",
  "status": "draft",
  "customerFallbackEmail": "string",
  "customerFallbackName": "string",
  "items": [
    {
      "id": "string",
      "merchantId": "string",
      "name": "string",
      "description": "string",
      "price": 0,
      "currency": "MNT",
      "taxRate": 0,
      "isTaxIncluded": false,
      "hasQuantity": false,
      "quantity": 0
    }
  ],
  "totalAmount": 0,
  "taxAmount": 0,
  "createdById": "string",
  "createdByFallbackEmail": "string",
  "createdBy": {
    "id": "string",
    "firstname": "string",
    "lastname": "string",
    "email": "string",
    "hashedPassword": "string",
    "mustChangePassword": false,
    "roleId": "string",
    "isActive": false,
    "role": {
      "id": "string",
      "name": "string",
      "description": "string",
      "merchantId": "string"
    },
    "merchantId": "string",
    "invoices": [
      "string"
    ],
    "merchant": {
      "id": "string",
      "name": "string",
      "email": "string",
      "phone": "string",
      "description": "string",
      "address": "string",
      "website": "string",
      "logoUrl": "string"
    }
  },
  "customerId": "string",
  "customer": {
    "id": "string",
    "name": "string",
    "email": "email",
    "phone": "string",
    "merchantId": "string",
    "deletedAt": null,
    "createdAt": null,
    "updatedAt": null
  },
  "paymentProviderInvoices": [
    {
      "provider": "qpay",
      "merchantReference": "string",
      "gatewayReference": "string",
      "redirectUrl": "string",
      "expiresAt": null,
      "providerExtra": null,
      "paymentStatus": "string",
      "paidAmount": 0,
      "paidAt": null,
      "convertedAmount": 0
    }
  ],
  "merchantId": "string",
  "expiresAt": null,
  "paymentLink": {
    "expiresAt": null,
    "url": "string"
  },
  "createdAt": null,
  "updatedAt": null
}
get/invoices/{invoiceId}Get one invoice with customer and merchant details

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
invoiceIdpathstringзаавал
Жишээ хүсэлт
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/invoices/{invoiceId} \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "id": "string",
  "title": "string",
  "description": "string",
  "currency": "MNT",
  "language": "en",
  "status": "draft",
  "customerFallbackEmail": "string",
  "customerFallbackName": "string",
  "items": [
    {
      "id": "string",
      "merchantId": "string",
      "name": "string",
      "description": "string",
      "price": 0,
      "currency": "MNT",
      "taxRate": 0,
      "isTaxIncluded": false,
      "hasQuantity": false,
      "quantity": 0
    }
  ],
  "totalAmount": 0,
  "taxAmount": 0,
  "createdById": "string",
  "createdByFallbackEmail": "string",
  "createdBy": {
    "id": "string",
    "firstname": "string",
    "lastname": "string",
    "email": "string",
    "hashedPassword": "string",
    "mustChangePassword": false,
    "roleId": "string",
    "isActive": false,
    "role": {
      "id": "string",
      "name": "string",
      "description": "string",
      "merchantId": "string"
    },
    "merchantId": "string",
    "invoices": [
      "string"
    ],
    "merchant": {
      "id": "string",
      "name": "string",
      "email": "string",
      "phone": "string",
      "description": "string",
      "address": "string",
      "website": "string",
      "logoUrl": "string"
    }
  },
  "customerId": "string",
  "customer": {
    "id": "string",
    "name": "string",
    "email": "email",
    "phone": "string",
    "merchantId": "string",
    "deletedAt": null,
    "createdAt": null,
    "updatedAt": null
  },
  "paymentProviderInvoices": [
    {
      "provider": "qpay",
      "merchantReference": "string",
      "gatewayReference": "string",
      "redirectUrl": "string",
      "expiresAt": null,
      "providerExtra": null,
      "paymentStatus": "string",
      "paidAmount": 0,
      "paidAt": null,
      "convertedAmount": 0
    }
  ],
  "merchantId": "string",
  "expiresAt": null,
  "paymentLink": {
    "expiresAt": null,
    "url": "string"
  },
  "createdAt": null,
  "updatedAt": null
}
delete/invoices/{invoiceId}Delete an invoice (draft/canceled/expired only)

Only draft, canceled or expired invoices with no payment link and no status history can be hard-deleted (audit trail) — otherwise 422. Cancel an acted-on invoice via PUT /invoices/{invoiceId}/status instead.

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
invoiceIdpathstringзаавал
Жишээ хүсэлт
curl -X DELETE https://admin.onepay.tabsystems.tech/api/v1/invoices/{invoiceId} \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "id": "string",
  "title": "string",
  "description": "string",
  "currency": "MNT",
  "language": "en",
  "status": "draft",
  "customerFallbackEmail": "string",
  "customerFallbackName": "string",
  "items": [
    {
      "id": "string",
      "merchantId": "string",
      "name": "string",
      "description": "string",
      "price": 0,
      "currency": "MNT",
      "taxRate": 0,
      "isTaxIncluded": false,
      "hasQuantity": false,
      "quantity": 0
    }
  ],
  "totalAmount": 0,
  "taxAmount": 0,
  "createdById": "string",
  "createdByFallbackEmail": "string",
  "createdBy": {
    "id": "string",
    "firstname": "string",
    "lastname": "string",
    "email": "string",
    "hashedPassword": "string",
    "mustChangePassword": false,
    "roleId": "string",
    "isActive": false,
    "role": {
      "id": "string",
      "name": "string",
      "description": "string",
      "merchantId": "string"
    },
    "merchantId": "string",
    "invoices": [
      "string"
    ],
    "merchant": {
      "id": "string",
      "name": "string",
      "email": "string",
      "phone": "string",
      "description": "string",
      "address": "string",
      "website": "string",
      "logoUrl": "string"
    }
  },
  "customerId": "string",
  "customer": {
    "id": "string",
    "name": "string",
    "email": "email",
    "phone": "string",
    "merchantId": "string",
    "deletedAt": null,
    "createdAt": null,
    "updatedAt": null
  },
  "paymentProviderInvoices": [
    {
      "provider": "qpay",
      "merchantReference": "string",
      "gatewayReference": "string",
      "redirectUrl": "string",
      "expiresAt": null,
      "providerExtra": null,
      "paymentStatus": "string",
      "paidAmount": 0,
      "paidAt": null,
      "convertedAmount": 0
    }
  ],
  "merchantId": "string",
  "expiresAt": null,
  "paymentLink": {
    "expiresAt": null,
    "url": "string"
  },
  "createdAt": null,
  "updatedAt": null
}
put/invoices/{invoiceId}/statusUpdate invoice status (transitions are service-enforced)

Lifecycle: draft → pending → captured → fulfilled. Allowed transitions: captured → fulfilled only; fulfilled → canceled only; canceled and expired are final (422 invoiceNotEditable). Setting fulfilled requires the invoice to be captured first (422 onlyCapturedCanFulfill). Setting captured or fulfilled sends the corresponding notification emails.

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
invoiceIdpathstringзаавал

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
statusdraft | pending | captured | fulfilled | canceled | expired
Жишээ хүсэлт
curl -X PUT https://admin.onepay.tabsystems.tech/api/v1/invoices/{invoiceId}/status \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "id": "string",
  "title": "string",
  "description": "string",
  "currency": "MNT",
  "language": "en",
  "status": "draft",
  "customerFallbackEmail": "string",
  "customerFallbackName": "string",
  "items": [
    {
      "id": "string",
      "merchantId": "string",
      "name": "string",
      "description": "string",
      "price": 0,
      "currency": "MNT",
      "taxRate": 0,
      "isTaxIncluded": false,
      "hasQuantity": false,
      "quantity": 0
    }
  ],
  "totalAmount": 0,
  "taxAmount": 0,
  "createdById": "string",
  "createdByFallbackEmail": "string",
  "createdBy": {
    "id": "string",
    "firstname": "string",
    "lastname": "string",
    "email": "string",
    "hashedPassword": "string",
    "mustChangePassword": false,
    "roleId": "string",
    "isActive": false,
    "role": {
      "id": "string",
      "name": "string",
      "description": "string",
      "merchantId": "string"
    },
    "merchantId": "string",
    "invoices": [
      "string"
    ],
    "merchant": {
      "id": "string",
      "name": "string",
      "email": "string",
      "phone": "string",
      "description": "string",
      "address": "string",
      "website": "string",
      "logoUrl": "string"
    }
  },
  "customerId": "string",
  "customer": {
    "id": "string",
    "name": "string",
    "email": "email",
    "phone": "string",
    "merchantId": "string",
    "deletedAt": null,
    "createdAt": null,
    "updatedAt": null
  },
  "paymentProviderInvoices": [
    {
      "provider": "qpay",
      "merchantReference": "string",
      "gatewayReference": "string",
      "redirectUrl": "string",
      "expiresAt": null,
      "providerExtra": null,
      "paymentStatus": "string",
      "paidAmount": 0,
      "paidAt": null,
      "convertedAmount": 0
    }
  ],
  "merchantId": "string",
  "expiresAt": null,
  "paymentLink": {
    "expiresAt": null,
    "url": "string"
  },
  "createdAt": null,
  "updatedAt": null
}
post/invoices/{invoiceId}/payment-linkGenerate (or return the cached) payment link without sending email

Moves a draft invoice to pending. Requires at least one enabled payment provider (422 noPaymentProvider). Idempotent — returns the cached link unless forceRefresh or expiresInMinutes is passed. Returns { url, expiresAt }.

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
invoiceIdpathstringзаавал

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
forceRefreshboolean
expiresInMinutesinteger
Жишээ хүсэлт
curl -X POST https://admin.onepay.tabsystems.tech/api/v1/invoices/{invoiceId}/payment-link \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "expiresAt": null,
  "url": "string"
}
post/invoices/{invoiceId}/sendSend (or resend with isForce) the payment link by email

Generates the payment link if needed and emails it to the invoice recipient. Pass isForce to resend an already-sent invoice; expiresIn (minutes) overrides the link validity.

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
invoiceIdpathstringзаавал

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
isForceboolean
expiresInnumber
Жишээ хүсэлт
curl -X POST https://admin.onepay.tabsystems.tech/api/v1/invoices/{invoiceId}/send \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "success": false,
  "message": "string"
}

Customers

Customers belong to the merchant that owns the API token. Deleting a customer is a soft delete — invoices keep referencing it.

get/customersList customers (paginated, optional search text)

search matches customer name and email, case-insensitively.

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
pageIndexquerynumber
searchquerystring
limitquerynumber
Жишээ хүсэлт
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/customers \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "customers": [
    {
      "id": "string",
      "name": "string",
      "email": "email",
      "phone": "string",
      "merchantId": "string",
      "deletedAt": null,
      "createdAt": null,
      "updatedAt": null
    }
  ],
  "pagination": {
    "pageIndex": 0,
    "page": 0,
    "limit": 0,
    "total": 0,
    "totalPages": 0,
    "hasNext": false,
    "hasPrev": false
  }
}
post/customersCreate a customer

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
namestringзаавал
emailstringзаавал
phonestring
Жишээ хүсэлт
curl -X POST https://admin.onepay.tabsystems.tech/api/v1/customers \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "id": "string",
  "name": "string",
  "email": "email",
  "phone": "string",
  "merchantId": "string",
  "deletedAt": null,
  "createdAt": null,
  "updatedAt": null
}
get/customers/{customerId}Get one customer

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
customerIdpathstringзаавал
Жишээ хүсэлт
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/customers/{customerId} \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "id": "string",
  "name": "string",
  "email": "email",
  "phone": "string",
  "merchantId": "string",
  "deletedAt": null,
  "createdAt": null,
  "updatedAt": null
}
put/customers/{customerId}Update a customer

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
customerIdpathstringзаавал

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
namestring
emailstring
phonestring
Жишээ хүсэлт
curl -X PUT https://admin.onepay.tabsystems.tech/api/v1/customers/{customerId} \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "id": "string",
  "name": "string",
  "email": "email",
  "phone": "string",
  "merchantId": "string",
  "deletedAt": null,
  "createdAt": null,
  "updatedAt": null
}
delete/customers/{customerId}Soft-delete a customer

The customer is deactivated, not removed — existing invoices keep referencing it and history stays intact.

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
customerIdpathstringзаавал
Жишээ хүсэлт
curl -X DELETE https://admin.onepay.tabsystems.tech/api/v1/customers/{customerId} \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "id": "string",
  "name": "string",
  "email": "email",
  "phone": "string",
  "merchantId": "string",
  "deletedAt": null,
  "createdAt": null,
  "updatedAt": null
}

Items

Catalog items are priced from the database when invoicing. One-off custom items are supplied inline on the invoice instead and are not stored here.

get/itemsList catalog items (paginated, optional active filter)

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
pageIndexquerynumber
searchquerystring
limitquerynumber
wherequeryobject
Жишээ хүсэлт
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/items \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "items": [
    {
      "id": "string",
      "merchantId": "string",
      "name": "string",
      "description": "string",
      "price": 0,
      "currency": "MNT",
      "taxRate": 0,
      "isTaxIncluded": false,
      "hasQuantity": false,
      "quantity": 0,
      "isActive": false,
      "createdAt": null,
      "updatedAt": null
    }
  ],
  "total": 0
}
post/itemsCreate a catalog item

Catalog items carry their own price, taxRate and isTaxIncluded — invoices referencing the item always read the current values from the database, never from the request.

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
namestringзаавал
descriptionstringзаавал
pricenumberзаавал
currencyMNT | USD | JPY
taxRatenumberзаавал
isTaxIncludedbooleanзаавал
hasQuantityboolean
quantitystring
isActiveboolean
Жишээ хүсэлт
curl -X POST https://admin.onepay.tabsystems.tech/api/v1/items \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "id": "string",
  "merchantId": "string",
  "name": "string",
  "description": "string",
  "price": 0,
  "currency": "MNT",
  "taxRate": 0,
  "isTaxIncluded": false,
  "hasQuantity": false,
  "quantity": 0,
  "isActive": false,
  "createdAt": null,
  "updatedAt": null
}
put/items/{itemId}Update a catalog item

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
itemIdpathstringзаавал

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
namestring
descriptionstring
pricenumber
currencyMNT | USD | JPY
taxRatenumber
isTaxIncludedboolean
hasQuantityboolean
quantitystring
isActiveboolean
Жишээ хүсэлт
curl -X PUT https://admin.onepay.tabsystems.tech/api/v1/items/{itemId} \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "id": "string",
  "merchantId": "string",
  "name": "string",
  "description": "string",
  "price": 0,
  "currency": "MNT",
  "taxRate": 0,
  "isTaxIncluded": false,
  "hasQuantity": false,
  "quantity": 0,
  "isActive": false,
  "createdAt": null,
  "updatedAt": null
}
delete/items/{itemId}Delete a catalog item

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
itemIdpathstringзаавал
Жишээ хүсэлт
curl -X DELETE https://admin.onepay.tabsystems.tech/api/v1/items/{itemId} \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "id": "string",
  "merchantId": "string",
  "name": "string",
  "description": "string",
  "price": 0,
  "currency": "MNT",
  "taxRate": 0,
  "isTaxIncluded": false,
  "hasQuantity": false,
  "quantity": 0,
  "isActive": false,
  "createdAt": null,
  "updatedAt": null
}

Users

Users of the merchant dashboard. A token inherits its creator’s role: manager tokens can only act on their own account, admin tokens on any user of the merchant.

get/rolesList the merchant's roles (for the roleId field of user endpoints)

Returns { id, name, description } per role. Use the id as roleId when creating or updating users.

Жишээ хүсэлт
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/roles \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
[
  {
    "id": "string",
    "name": "string",
    "description": "string",
    "merchantId": "string"
  }
]
get/usersList users (paginated)

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
pageIndexquerynumber
searchquerystring
limitquerynumber
Жишээ хүсэлт
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/users \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "users": [
    {
      "id": "string",
      "firstname": "string",
      "lastname": "string",
      "email": "string",
      "mustChangePassword": false,
      "roleId": "string",
      "isActive": false,
      "role": {
        "id": "string",
        "name": "string",
        "description": "string",
        "merchantId": "string"
      },
      "merchantId": "string"
    }
  ],
  "pagination": {
    "pageIndex": 0,
    "page": 0,
    "limit": 0,
    "total": 0,
    "totalPages": 0,
    "hasNext": false,
    "hasPrev": false
  }
}
post/usersCreate a user (sends a welcome email)

The user is always created under the merchant that owns the API token — a merchant can never add users to another merchant. roleId must be an id returned by GET /roles (roles are merchant-scoped too). The new user receives a welcome email with initial credentials.

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
firstnamestringзаавал
lastnamestring
emailstringзаавал
roleIdstringзаавал
Жишээ хүсэлт
curl -X POST https://admin.onepay.tabsystems.tech/api/v1/users \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "id": "string",
  "firstname": "string",
  "lastname": "string",
  "email": "string",
  "mustChangePassword": false,
  "roleId": "string",
  "isActive": false,
  "role": {
    "id": "string",
    "name": "string",
    "description": "string",
    "merchantId": "string"
  },
  "merchantId": "string"
}
put/users/{userId}Update a user

Manager-role tokens may update only their own account; admin tokens may update any user of the merchant (403 otherwise). A user's merchant cannot be changed. Fields outside the caller's permitted set are ignored rather than applied.

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
userIdpathstringзаавал

Хүсэлтийн бие

НэрТөрөлЗаавал эсэх
firstnamestring
lastnamestring
emailstring
roleIdstring
isActiveboolean
passwordstring
Жишээ хүсэлт
curl -X PUT https://admin.onepay.tabsystems.tech/api/v1/users/{userId} \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Жишээ хариу
{
  "id": "string",
  "firstname": "string",
  "lastname": "string",
  "email": "string",
  "mustChangePassword": false,
  "roleId": "string",
  "isActive": false,
  "role": {
    "id": "string",
    "name": "string",
    "description": "string",
    "merchantId": "string"
  },
  "merchantId": "string"
}
delete/users/{userId}Delete a user

Manager-role tokens may delete only their own account; admin tokens any user of the merchant. Deleting the last remaining admin is rejected.

Параметрүүд

НэрБайрлалТөрөлЗаавал эсэх
userIdpathstringзаавал
Жишээ хүсэлт
curl -X DELETE https://admin.onepay.tabsystems.tech/api/v1/users/{userId} \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "id": "string",
  "firstname": "string",
  "lastname": "string",
  "email": "string",
  "mustChangePassword": false,
  "roleId": "string",
  "isActive": false,
  "role": {
    "id": "string",
    "name": "string",
    "description": "string",
    "merchantId": "string"
  },
  "merchantId": "string"
}

Merchant

Your own merchant profile. Every other payload is already merchant-scoped, so the merchant object is not repeated on individual records — read it here when you need it.

get/merchantGet the merchant profile that owns the API token

Name, contact details and logo of your own merchant. User and invoice payloads deliberately omit this object — fetch it here once instead of receiving it on every record.

Жишээ хүсэлт
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/merchant \
  -H "Authorization: Bearer psk_your_token_here"
Жишээ хариу
{
  "id": "string",
  "name": "string",
  "email": "string",
  "phone": "string",
  "description": "string",
  "address": "string",
  "website": "string",
  "logoUrl": "string"
}
© 2025–2026 Tab Systems Mongolia LLC