OnePayOnePay

API リファレンス

ベース URL: https://admin.onepay.tabsystems.tech/api/v1

すべてのエンドポイントに 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) and by externalReference (exact match).

パラメータ

名前場所型必須
pageIndexquerynumber
searchquerystring
limitquerynumber
startDatequerystring
endDatequerystring
externalReferencequerystring
リクエスト例
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": "date-time",
        "createdAt": "date-time",
        "updatedAt": "date-time"
      },
      "paymentProviderInvoices": [
        {
          "provider": null,
          "merchantReference": null,
          "gatewayReference": null,
          "redirectUrl": null,
          "expiresAt": null,
          "providerExtra": null,
          "paymentStatus": null,
          "paidAmount": null,
          "paidAt": null,
          "convertedAmount": null
        }
      ],
      "externalReference": "string",
      "metadata": "object",
      "merchantId": "string",
      "expiresAt": "date-time",
      "paymentLink": {
        "expiresAt": "date-time",
        "url": "string"
      },
      "createdAt": "date-time",
      "updatedAt": "date-time"
    }
  ],
  "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. Optional externalReference (your own id, max 255 chars) and metadata (a JSON object, max 8192 bytes as UTF-8 JSON — larger is rejected with 400) are stored as-is and returned on every read and in webhook payloads. The invoice remembers which API key created it, so that key's webhook receives its events.

リクエストボディ

名前型必須
titlestring必須
descriptionstring必須
currencyMNT | USD | JPY必須
languageen | mn | ja必須
itemsarray必須
totalAmountnumber必須
taxAmountnumber必須
customerIdstring
externalReferencestring
metadataobject
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": "date-time",
    "createdAt": "date-time",
    "updatedAt": "date-time"
  },
  "paymentProviderInvoices": [
    {
      "provider": "qpay",
      "merchantReference": "string",
      "gatewayReference": "string",
      "redirectUrl": "string",
      "expiresAt": "date-time",
      "providerExtra": null,
      "paymentStatus": "string",
      "paidAmount": 0,
      "paidAt": "date-time",
      "convertedAmount": 0
    }
  ],
  "externalReference": "string",
  "metadata": "object",
  "merchantId": "string",
  "expiresAt": "date-time",
  "paymentLink": {
    "expiresAt": "date-time",
    "url": "string"
  },
  "createdAt": "date-time",
  "updatedAt": "date-time"
}
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": "date-time",
    "createdAt": "date-time",
    "updatedAt": "date-time"
  },
  "paymentProviderInvoices": [
    {
      "provider": "qpay",
      "merchantReference": "string",
      "gatewayReference": "string",
      "redirectUrl": "string",
      "expiresAt": "date-time",
      "providerExtra": null,
      "paymentStatus": "string",
      "paidAmount": 0,
      "paidAt": "date-time",
      "convertedAmount": 0
    }
  ],
  "externalReference": "string",
  "metadata": "object",
  "merchantId": "string",
  "expiresAt": "date-time",
  "paymentLink": {
    "expiresAt": "date-time",
    "url": "string"
  },
  "createdAt": "date-time",
  "updatedAt": "date-time"
}
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": "date-time",
    "createdAt": "date-time",
    "updatedAt": "date-time"
  },
  "paymentProviderInvoices": [
    {
      "provider": "qpay",
      "merchantReference": "string",
      "gatewayReference": "string",
      "redirectUrl": "string",
      "expiresAt": "date-time",
      "providerExtra": null,
      "paymentStatus": "string",
      "paidAmount": 0,
      "paidAt": "date-time",
      "convertedAmount": 0
    }
  ],
  "externalReference": "string",
  "metadata": "object",
  "merchantId": "string",
  "expiresAt": "date-time",
  "paymentLink": {
    "expiresAt": "date-time",
    "url": "string"
  },
  "createdAt": "date-time",
  "updatedAt": "date-time"
}
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": "date-time",
    "createdAt": "date-time",
    "updatedAt": "date-time"
  },
  "paymentProviderInvoices": [
    {
      "provider": "qpay",
      "merchantReference": "string",
      "gatewayReference": "string",
      "redirectUrl": "string",
      "expiresAt": "date-time",
      "providerExtra": null,
      "paymentStatus": "string",
      "paidAmount": 0,
      "paidAt": "date-time",
      "convertedAmount": 0
    }
  ],
  "externalReference": "string",
  "metadata": "object",
  "merchantId": "string",
  "expiresAt": "date-time",
  "paymentLink": {
    "expiresAt": "date-time",
    "url": "string"
  },
  "createdAt": "date-time",
  "updatedAt": "date-time"
}
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": "date-time",
  "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": "date-time",
      "createdAt": "date-time",
      "updatedAt": "date-time"
    }
  ],
  "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": "date-time",
  "createdAt": "date-time",
  "updatedAt": "date-time"
}
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": "date-time",
  "createdAt": "date-time",
  "updatedAt": "date-time"
}
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": "date-time",
  "createdAt": "date-time",
  "updatedAt": "date-time"
}
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": "date-time",
  "createdAt": "date-time",
  "updatedAt": "date-time"
}

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": "date-time",
      "updatedAt": "date-time"
    }
  ],
  "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": "date-time",
  "updatedAt": "date-time"
}
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": "date-time",
  "updatedAt": "date-time"
}
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": "date-time",
  "updatedAt": "date-time"
}

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"
}

Webhook

The webhook of the API key making the request — never another key's. Invoices created with that key POST their events (see webhooks) to it, signed with its whsec_ secret. Same setting as Profile → API Tokens in the admin UI.

get/webhookGet the webhook of the calling API key

URL, enabled flag and lastDelivery — the state of the most recent delivery (delivered | pending | retrying | failed | none), the same indicator the admin UI shows; null while the webhook is off. The signing secret is never returned.

リクエスト例
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/webhook \
  -H "Authorization: Bearer psk_your_token_here"
レスポンス例
{
  "url": "string",
  "enabled": false,
  "lastDelivery": {
    "state": "delivered",
    "deliveryId": "string",
    "eventType": "string",
    "occurredAt": "date-time",
    "retry": 0,
    "maxRetries": 0,
    "failureReason": "http",
    "lastStatus": 0,
    "lastError": "string"
  }
}
put/webhookSet the webhook URL and/or enable or disable it

The URL must be https and resolve to a public address (422 webhookUrlNotHttps / webhookUrlNotPublic). Omitted fields keep their current value; a first-time webhook starts enabled, and omitting url before one is set is 422 webhookNotConfigured. secret (whsec_…) is returned only when this call creates it — the first time the key gets a URL — and is null otherwise. Store it: it cannot be read again.

リクエストボディ

名前型必須
urlstring
enabledboolean
リクエスト例
curl -X PUT https://admin.onepay.tabsystems.tech/api/v1/webhook \
  -H "Authorization: Bearer psk_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
レスポンス例
{
  "webhook": {
    "url": "string",
    "enabled": false,
    "lastDelivery": {
      "state": "delivered",
      "deliveryId": "string",
      "eventType": "string",
      "occurredAt": "date-time",
      "retry": 0,
      "maxRetries": 0,
      "failureReason": "http",
      "lastStatus": 0,
      "lastError": "string"
    }
  },
  "secret": "string"
}
delete/webhookRemove the webhook

Clears the URL; deliveries still queued are given up. The signing secret is kept, so setting a URL again reuses it and returns none — only the key owner can replace it, in the admin UI.

リクエスト例
curl -X DELETE https://admin.onepay.tabsystems.tech/api/v1/webhook \
  -H "Authorization: Bearer psk_your_token_here"
レスポンス例
{
  "url": "string",
  "enabled": false,
  "lastDelivery": {
    "state": "delivered",
    "deliveryId": "string",
    "eventType": "string",
    "occurredAt": "date-time",
    "retry": 0,
    "maxRetries": 0,
    "failureReason": "http",
    "lastStatus": 0,
    "lastError": "string"
  }
}
post/webhook/secretRequest a secret rotation (the key owner confirms it in the admin)

Does not rotate. Records a pending request (it lapses after 30 minutes; a new request replaces a pending one) and emails the key owner a link to the admin UI, where they confirm or reject it while signed in. The new whsec_… secret is shown only there, once — never in this response — so a leaked API key alone cannot swap the signing secret. The current secret keeps working until confirmation. 422 webhookNotConfigured when no URL is set.

リクエスト例
curl -X POST https://admin.onepay.tabsystems.tech/api/v1/webhook/secret \
  -H "Authorization: Bearer psk_your_token_here"
レスポンス例
{
  "status": "string",
  "expiresAt": "date-time",
  "emailSent": false
}
post/webhook/testSend a webhook.test event now

One signed attempt, never retried, listed among the latest deliveries; the receiver has 10 seconds to answer 2xx. Works while the webhook is disabled. Rate-limited per key (429 webhookTestRateLimited).

リクエスト例
curl -X POST https://admin.onepay.tabsystems.tech/api/v1/webhook/test \
  -H "Authorization: Bearer psk_your_token_here"
レスポンス例
{
  "deliveryId": "string",
  "delivered": false,
  "status": 0,
  "error": "string",
  "durationMs": 0
}
get/webhook/deliveriesList the latest 5 deliveries

The latest 5 deliveries, newest first, without payloads — a connection check, not a full log, so there is no paging. Each row: event type, invoice id, state (pending | retrying | delivered | failed), attempts, last status and error, next attempt.

リクエスト例
curl -X GET https://admin.onepay.tabsystems.tech/api/v1/webhook/deliveries \
  -H "Authorization: Bearer psk_your_token_here"
レスポンス例
[
  {
    "id": "string",
    "eventType": "string",
    "invoiceId": "string",
    "state": "delivered",
    "attempts": 0,
    "lastStatus": 0,
    "lastError": "string",
    "nextAttemptAt": "date-time",
    "deliveredAt": "date-time",
    "createdAt": "date-time"
  }
]

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