payment-service-api
GraphQL API Reference
GraphQl endpoints for payment-service!
API Endpoints
Queries
customer
customer
Description
🔒 JWT Token
Returns the customer's record. If the user does not have a previously created customer, this endpoint creates it.
Response
Returns a CustomerDto!
Example
Query
Response
exchangeRates
exchangeRates
Description
🔓 Public
Returns exchange rates.
Response
Returns an ExchangeRateDto!
Example
Query
Response
listCards
listCards
Description
🔒 JWT Token
Returns a list of PaymentMethods(cards) attached to the customer.
Response
Returns a GetCardsDto!
Example
Query
Response
purchaseEvent
purchaseEvent
Description
🔒 JWT Token
Retrieve purchase event by id attached to the user
Response
Returns a PurchaseEventDto!
Arguments
Unique identifier for the purchase event object
Example
Query
Variables
Response
purchaseEventList
purchaseEventList
Description
🔒 JWT Token
Returns a list of purchase events attached to the user.
Response
Returns a PurchaseEventListDto!
Example
Query
Response
sayHello
sayHello
Response
Returns a String!
Example
Query
Response
Mutations
createCard
createCard
Description
🔒 JWT Token
Saves information about the card in the database and assigns it to the user. If the user did not have a default payment method, it sets it.
Response
Returns a CreateCardDataDto!
Arguments
Use stripe.createPaymentMethod to convert payment information collected by elements into a PaymentMethod. paymentMethodId is an id key from PaymentMethod object.
Example
Query
Variables
Response
createPurchaseEvent
createPurchaseEvent
Description
🔒 JWT Token
Create purchase event. The invoice item and invoice are created automatically
Response
Returns a PurchaseEventDto!
Arguments
Price of the token in wei.
Quantity of tokens of token type id purchased
Token id from the NFT contract
Address of the NFT contract
Address of the seller of the NFT
Name of the blockchain network on which the transaction occurs
Id generated by the client
The unique identifier of the enterprise that sells the token.
Example
Query
Variables
Response
detachCard
detachCard
Description
🔒 JWT Token
Detach a PaymentMethod object from a Customer
Response
Returns a String!
Arguments
Unique identifier for the card object.
Example
Query
Variables
Response
getOrCreateFeeRate
getOrCreateFeeRate
Description
🔓 Public
get actual payments fee rates
Response
Returns a FeeRateDto!
Arguments
Name of the blockchain network on which the transaction occurs
Unique identifier for enterprise
Example
Query
Variables
Response
Types
Boolean
Description
The Boolean
scalar type represents true
or false
.
CreateCardDataDto
Description
Data required to create the card.
Fields
Use stripe.createPaymentMethod to convert payment information collected by elements into a PaymentMethod. paymentMethodId is an id key from PaymentMethod object.
User identifier created by Stripe.
Unique identifier for the Customer.
Example
CustomerDto
Description
CustomerDto describes a user's Stripe payment data
Fields
Auto-incrementing identifier.
User identifier created by Stripe.
Card identifier created by Stripe. If it is not null it is the basic payment method. There is no need to add a new card during a new transaction.
email of the customer.
Time at which the object was created.
Time at which the object was last updated.
Example
DateTime
Description
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.
Example
ExchangeQuotesDTO
Description
Quote currencies
Fields
High precision price in USD
High precision price in EUR
High precision price in ETH
Example
ExchangeRateDto
Description
Exchange rate object
Fields
Date of last price update
Example
FeeRateDto
Description
Payments fee rates
Fields
Auto-incrementing identifier.
Unique identifier for enterprise
Fee rate charged during stripe payment. max value 100. Percentage value
Time at which the object was created.
Time at which the object was last updated.
Example
Float
Description
The Float
scalar type represents signed double-precision fractional values as specified by IEEE 754.
Example
GetCardsDto
Description
Returns a list of cards and their number.
Fields
Contains an array of cards
The number of objects.
Example
Int
Description
The Int
scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
Example
NetworkName
Values
ropsten
kovan
ownet
mainnet
binance
bnbtest
sepolia
local
test
polygon
goerli
mumbai
ethereum
shibuya
amoy
base
Example
NetworkNameDto
Fields
Example
OnchainTxEventStatus
Values
TRANSACTION_ON_CHAIN_PENDING
TRANSACTION_ON_CHAIN_IN_PROGRESS
TRANSACTION_ON_CHAIN_FAILED
TRANSACTION_ON_CHAIN_SUCCEED
Example
PaymentCardDataDto
Description
Basic information about a credit or debit card.
Fields
Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown.
Two-letter ISO code representing the country of the card.
Two-digit number representing the card’s expiration month.
Four-digit number representing the card’s expiration year.
The last four digits of the card.
Example
PaymentCardDataListDto
Description
Basic information about a credit or debit card.
Fields
Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown.
Two-letter ISO code representing the country of the card.
Two-digit number representing the card’s expiration month.
Four-digit number representing the card’s expiration year.
The last four digits of the card.
Use stripe.createPaymentMethod to convert payment information collected by elements into a PaymentMethod. paymentMethodId is an id key from PaymentMethod object.
Example
PurchaseEventDto
Description
Purchase event object. Represent a one-time purchase of any item.
Fields
Auto-incrementing identifier.
Id of the item to be added to an invoice
Id of the invoice
The integer amount in cents.
Three-letter ISO currency code, in lowercase.
Transaction status. May be: DRAFT, TRANSACTION_ON_CHAIN_PENDING, TRANSACTION_ON_CHAIN_IN_PROGRESS, TRANSACTION_ON_CHAIN_FAILED, TRANSACTION_ON_CHAIN_SUCCEED, PAYMENT_SUCCESSFUL, PAYMENT_FAILED
Address of the NFT contract
Token id from the NFT contract
Address of the seller of the NFT
Quantity of tokens of token type id purchased
Name of the blockchain network on which the transaction occurs
Transaction on chain status. Statuses: TRANSACTION_ON_CHAIN_PENDING, TRANSACTION_ON_CHAIN_IN_PROGRESS, TRANSACTION_ON_CHAIN_FAILED, TRANSACTION_ON_CHAIN_SUCCEED
NFT token value in cents.
Fee charged during stripe payment in cents
Fee rate charged during stripe payment. max value 100. Percentage value
Id generated by the client
A unique string that is given to every transaction that is verified and added to the blockchain.
Time at which the object was created.
Time at which the object was last updated.
Example
PurchaseEventListDto
Description
List of purchase events attached to the user.
Fields
The number of objects.
Contains an array of purchase events
Example
PurchaseEventStatus
Values
DRAFT
PAYMENT_SUCCESSFUL
PAYMENT_FAILED
Example
String
Description
The String
scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
Example
Last updated