Skip to content

Rest API

Slava Ruckis edited this page Sep 10, 2019 · 1 revision

The Monetha API allows developers to integrate our digital identity, wallet and payment gateway features into their products. For accessing the API, a valid JWT token must be passed in all queries in the 'Authorization' header.

To get JWT token - please see Authorization section.

Mobile API

Mobile API (v1.0.0) covers digital identity, cryptocurrency wallet and peer-to-peer deal making with a built-in payment solution.

Status

Method Endpoint Description
GET /status Mobile API Status

Deals

Public deals

Method Endpoint Description
GET /deals Get open deals
GET /deals/{deal_id}/public Get open deal

Management

Method Endpoint Description
POST /deals Create deal
POST /deals/{deal_id}/images Upload deal image
GET /deals/{deal_id} Get deal
PUT /deals/{deal_id} Update deal

Interaction

Method Endpoint Description
POST /deals/{deal_id}/participate Participate to deal
POST /deals/{deal_id}/cancel Cancel deal
POST /deals/{deal_id}/trash Trash deal
POST /deals/{deal_id}/accept} Accept deal
POST /deals/{deal_id}/send-to-buyer Send deal to buyer
POST /deals/{deal_id}/payment-method Set deal payment method
POST /deals/{deal_id}/prepare_payment Prepare deal payment order
POST /deals/{deal_id}/confirm-payment Confirm Payment

Finalize

Method Endpoint Description
POST /deals/{deal_id}/create-signature Create deal signature
POST /deals/{deal_id}/sign Sign deal
POST /merchant/{merchant_id}/deals/finalized Create finalized deal
POST /deals/{deal_id}/rate Rate deal

Claim management

Method Endpoint Description
POST /deals/{deal_id}/claim Create deal claim
GET /deals/{deal_id}/claims Get deal claims

Users

Auth

Method Endpoint Description
POST /users/verify Verify user phone number
POST /users/signup Sign up
POST /users/signin Sign in
POST /users Create a user
POST /users/email/resend_verification/ Resend email verification
POST /users/email/verify/{user_id}/ Verify users email address
POST /users/auth Extend authorization
POST /users/logout Logout

Deals

Method Endpoint Description
GET /users/deals Get user's deals
GET /users/deals/count Get total deals count

Own profile

Method Endpoint Description
GET /users/profile Retrieve user's profile
PUT /users/profile Update user profile
PUT /users/profile/device Update users device
PUT /users/profile/image Update profile image
POST /users/profile/share Create shareable URL
POST /users/payments/enable Enable merchant payments
GET /users/has_merchant User has merchant

Public profile

Method Endpoint Description
GET /profiles/{user_hash} Get profile
GET /users/{user_id} Get user by UUID
GET /users/email/{email}/ Get user by email
GET /users/phone/{country_code}/{phone_number} Get user by phone
GET /users/{user_id}/reputation_history Get reputation history by UUID
GET /profiles/{user_hash}/reputation_history Get reputation history
GET /users/{user_id}/reviews Get reviews by UUID
GET /users/{user_id}/reviews/count Get reviews count by UUID
GET /profiles/{user_hash}/reviews Get reviews
GET /profiles/{user_hash}/reviews/count Get reviews count

Wallet

Method Endpoint Description
POST /users/wallet Create wallet
GET /users/wallet Retrieves user's wallet
GET /users/wallet/privatekey Retrieves wallet's private key
POST /users/wallet/backup Backup wallet
PUT /users/wallet Recover wallet
DELETE /users/wallet Delete wallet

Payments API

MTH Gateway API (v1.0.0) is for creating and managing eCommerce orders, processing payments, exchange crypto to fiat.

Status

Method Endpoint Description
GET /status Payments API Status

Merchants

Common

Method Endpoint Description
POST /merchants Adds new merchant
GET /merchants Get merchants
GET /merchants/count Get merchants count
GET /merchants/{id} Gets merchant by ID
PUT /merchants/{id} Updates merchant
POST /merchants/{id}/api_key/generate Generates and saves to DB merchant's mth api key
GET /merchants/{id}/api_key Gets merchant's mth api key
DELETE /merchants/{id}/api_key Deletes merchant's mth api key
POST /merchants/offer_auth Prepares merchant offer by requiring Authorization header
GET /merchants/{id}/secret Gets merchant's secret
POST /merchants/{merchant_id}/payments/enable Enables escrow payments
POST /merchants/{merchant_id}/fiat_payments/enable Enables fiat payments
GET /merchants/{merchant_id}/fiat_payments/keys Gets fiat payments api username for merchant
PUT /merchants/{merchant_id}/fiat_payments/keys Sets fiat payments api crediantials for merchant
DELETE /merchants/{merchant_id}/fiat_payments/keys Deletes fiat payments api crediantials for merchant
GET /merchants/{id}/vat Gets merchant's VAT used retail
PUT /merchants/{id}/vat Updates merchant's VAT
GET /merchants/{merchant_id}/tokens Gets merchant's supported tokens
PUT /merchants/{merchant_id}/tokens Updates merchant's supported tokens
GET /merchants/{id}/fiat_currencies Gets merchant's supported FIAT currencies in retail
PUT /merchants/{id}/fiat_currencies Updates merchant's supported FIAT currencies in retail

Retail

Method Endpoint Description
POST /merchants/me/cashiers Creates cashier for merchant
GET /merchants/me/cashiers Gets merchant's cashiers
GET /cashiers/me Get cashier
POST /cashiers/signin Signs in cashier
POST /cashiers/auth Authenticate and prolong
GET /cashiers/{id}/orders Gets cashier's orders using limit and offset
POST /merchants/me/cashiers/{cashier_id}/reset Resets cashier password
DELETE /merchants/me/cashiers/{cashier_id} Deletes cashier by ID

Orders

Method Endpoint Description
GET /orders Gets orders using limit and offset
PUT /orders Updates an existing order
POST /orders Creates (adds) a new order
GET /merchants/{id}/orders Gets merchant's orders using limit and offset
GET /merchants/{id}/orders/{order_id} Gets merchant's order
GET /orders/{hash} Returns the order for given hash
PATCH /orders/{hash} Updates an existing order's discount and currency
PUT /orders/{hash}/currency Updates an existing order's fiat or crypto currency
GET /orders/{hash}/qr Get payment order QR code
GET /orders/{hash}/status Get order status (number) of an order
PUT /orders/{hash}/token Updates an existing order's crypto currency
POST /orders/{id}/cancel Cancels the order
POST /orders/{id}/hooks/ping Triggers a ping event using order webhook
POST /orders/{id}/hooks/trigger Triggers relevant order event using order webhook
GET /orders/{id}/tx_data Get direct payment transaction JWT for order
POST /orders/{id}/tx_data/submit Submit direct payment transaction JWT for order along with tx signature

Clients

Method Endpoint Description
POST /clients Create a client with provided information
GET /clients/{id} Gets client by ID
GET /clients/{id}/orders Gets client's orders using limit and offset
GET /clients/{id}/orders/{order_id} Gets client's order
POST /clients/{id}/wallets Create a client's wallet with provided information
GET /clients/{wallet_address}/tx_data Gets raw tx data (JWT) for covering whitelisting cost
POST /clients/{wallet_address}/tx_data/submit Submits full tx data (JWT) for covering whitelisting cost

Deals

Method Endpoint Description
GET /deals Gets deals
PUT /deals Updates deal
POST /deals Adds deal
GET /deals/{id} Gets deal by ID
DELETE /deals/{id} Deletes deal
GET /deals/execute Creates order from JWT data in query param
POST /deals/execute Creates order from JWT data

Exchange

Method Endpoint Description
GET /rates/ticker Get all currencies rates
PUT /exchange/{merchant_id}/keys Set Kraken API keys
GET /exchange/{merchant_id}/orders Get all exchange orders
GET /exchange/{merchant_id}/settings Get exchange settings to fiat
PUT /exchange/{merchant_id}/settings Create or update exchange settings to fiat
DELETE /exchange/{merchant_id}/settings Delete exchange settings to fiat

Withdrawal

Method Endpoint Description
GET /exchange/{merchant_id}/withdrawals Get all withdrawal orders
GET /exchange/{merchant_id}/withdrawal/settings Get withdrawal settings for fiat
PUT /exchange/{merchant_id}/withdrawal/settings Create or update withdrawal settings for fiat
DELETE /exchange/{merchant_id}/withdrawal/settings Delete withdrawal settings for fiat

Payments

Method Endpoint Description
POST /orders/{id}/charge Creates new charge for an order
GET /payments/fiat/charges/{charge_id} Gets a charge for fiat payment
POST /payments/fiat/charges/{charge_id}/auth Authorizes a charge for fiat payment using payment fields token
POST /payments/fiat/charges/{charge_id}/capture Captures an authorized charge for fiat payment
POST /payments/fiat/charges/{charge_id}/return Returns fiat payment by reverting an authorized but non-captured charge
GET /payments/fiat/returns/{return_id} Gets a charge return for fiat payment
POST /bluesnap/webhook/{merchant_id} Receives BlueSnap notifications for specific merchant

TokenExchange

Method Endpoint Description
GET /tokens Get all supported tokens
GET /token_exchange/{merchant_id}/settings Get token exchange settings
PUT /token_exchange/{merchant_id}/settings Create or update token exchange settings
DELETE /token_exchange/{merchant_id}/settings Delete token exchange settings
GET /token_exchange/{merchant_id}/deposit_address Get Binance Deposit Address
PUT /token_exchange/{merchant_id}/keys Set Binance API keys
GET /token_exchange/{merchant_id}/orders Get all token exchange orders

Clone this wiki locally