For the complete documentation index, see llms.txt. This page is also available as Markdown.

payment-service-api

GraphQL API Reference

GraphQl endpoints for payment-service!

API Endpoints

# devel:
https://payment-service.devel.original.works/graphql
# staging:
https://payment-service.stage.original.works/graphql
# prod:
https://payment-service.original.works/graphql

Queries

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

Queries

exchangeRates

Description

🔓 Public

Returns exchange rates.

Response

Returns an ExchangeRateDto!

Example

Query

Response

Queries

listCards

Description

🔒 JWT Token

Returns a list of PaymentMethods(cards) attached to the customer.

Response

Returns a GetCardsDto!

Example

Query

Response

Queries

purchaseEvent

Description

🔒 JWT Token

Retrieve purchase event by id attached to the user

Response

Returns a PurchaseEventDto!

Arguments

Name
Description

purchaseEventId - Float!

Unique identifier for the purchase event object

Example

Query

Variables

Response

Queries

purchaseEventList

Description

🔒 JWT Token

Returns a list of purchase events attached to the user.

Response

Returns a PurchaseEventListDto!

Example

Query

Response

Queries

sayHello

Response

Returns a String!

Example

Query

Response

Mutations

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

Name
Description

paymentMethodId - String!

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

Mutations

createPurchaseEvent

Description

🔒 JWT Token

Create purchase event. The invoice item and invoice are created automatically

Response

Returns a PurchaseEventDto!

Arguments

Name
Description

amount - String!

Price of the token in wei.

quantity - Float!

Quantity of tokens of token type id purchased

tokenId - String!

Token id from the NFT contract

collectionContract - String!

Address of the NFT contract

seller - String!

Address of the seller of the NFT

network - NetworkNameDto!

Name of the blockchain network on which the transaction occurs

messageId - String!

Id generated by the client

ownerUri - String!

The unique identifier of the enterprise that sells the token.

Example

Query

Variables

Response

Mutations

detachCard

Description

🔒 JWT Token

Detach a PaymentMethod object from a Customer

Response

Returns a String!

Arguments

Name
Description

cardId - String!

Unique identifier for the card object.

Example

Query

Variables

Response

Mutations

getOrCreateFeeRate

Description

🔓 Public

get actual payments fee rates

Response

Returns a FeeRateDto!

Arguments

Name
Description

network - NetworkNameDto!

Name of the blockchain network on which the transaction occurs

ownerUri - String!

Unique identifier for enterprise

Example

Query

Variables

Response

Types

Boolean

Description

The Boolean scalar type represents true or false.

Example

Types

CreateCardDataDto

Description

Data required to create the card.

Fields

Field Name
Description

paymentMethodId - String!

Use stripe.createPaymentMethod to convert payment information collected by elements into a PaymentMethod. paymentMethodId is an id key from PaymentMethod object.

stripeCustomerId - String!

User identifier created by Stripe.

customerId - Float!

Unique identifier for the Customer.

Example

Types

CustomerDto

Description

CustomerDto describes a user's Stripe payment data

Fields

Field Name
Description

id - Float!

Auto-incrementing identifier.

stripeCustomerId - String!

User identifier created by Stripe.

defaultPaymentMethodId - String

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 - String

email of the customer.

defaultPaymentMethod - PaymentCardDataDto

createdAt - DateTime!

Time at which the object was created.

updatedAt - DateTime!

Time at which the object was last updated.

Example

Types

DateTime

Description

A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.

Example

Types

ExchangeQuotesDTO

Description

Quote currencies

Fields

Field Name
Description

USD - Float!

High precision price in USD

EUR - Float!

High precision price in EUR

ETH - Float!

High precision price in ETH

Example

Types

ExchangeRateDto

Description

Exchange rate object

Fields

Example

Types

FeeRateDto

Description

Payments fee rates

Fields

Field Name
Description

id - Float!

Auto-incrementing identifier.

ownerUri - String!

Unique identifier for enterprise

stripePurchaseFee - Float!

Fee rate charged during stripe payment. max value 100. Percentage value

createdAt - DateTime!

Time at which the object was created.

updatedAt - DateTime!

Time at which the object was last updated.

Example

Types

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example

Types

GetCardsDto

Description

Returns a list of cards and their number.

Fields

Field Name
Description

Contains an array of cards

total - Float!

The number of objects.

Example

Types

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

Types

NetworkName

Values

Enum Value
Description

ropsten

kovan

ownet

mainnet

binance

bnbtest

sepolia

local

test

polygon

goerli

mumbai

ethereum

shibuya

amoy

base

baseSepolia

Example

Types

NetworkNameDto

Fields

Input Field
Description

networkName - NetworkName!

Example

Types

OnchainTxEventStatus

Values

Enum Value
Description

TRANSACTION_ON_CHAIN_PENDING

TRANSACTION_ON_CHAIN_IN_PROGRESS

TRANSACTION_ON_CHAIN_FAILED

TRANSACTION_ON_CHAIN_SUCCEED

Example

Types

PaymentCardDataDto

Description

Basic information about a credit or debit card.

Fields

Field Name
Description

brand - String!

Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown.

country - String!

Two-letter ISO code representing the country of the card.

expirationMonth - Float!

Two-digit number representing the card’s expiration month.

expirationYear - Float!

Four-digit number representing the card’s expiration year.

lastFourDigits - String!

The last four digits of the card.

Example

Types

PaymentCardDataListDto

Description

Basic information about a credit or debit card.

Fields

Field Name
Description

brand - String!

Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown.

country - String!

Two-letter ISO code representing the country of the card.

expirationMonth - Float!

Two-digit number representing the card’s expiration month.

expirationYear - Float!

Four-digit number representing the card’s expiration year.

lastFourDigits - String!

The last four digits of the card.

paymentMethodId - String!

Use stripe.createPaymentMethod to convert payment information collected by elements into a PaymentMethod. paymentMethodId is an id key from PaymentMethod object.

Example

Types

PurchaseEventDto

Description

Purchase event object. Represent a one-time purchase of any item.

Fields

Field Name
Description

id - Float!

Auto-incrementing identifier.

invoiceItemId - String!

Id of the item to be added to an invoice

invoiceId - String!

Id of the invoice

amount - String!

The integer amount in cents.

currency - String!

Three-letter ISO currency code, in lowercase.

purchaseEventStatus - PurchaseEventStatus!

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

collectionContract - String

Address of the NFT contract

tokenId - String

Token id from the NFT contract

seller - String

Address of the seller of the NFT

quantity - Int!

Quantity of tokens of token type id purchased

networkName - NetworkName!

Name of the blockchain network on which the transaction occurs

onchainTxEventStatus - OnchainTxEventStatus!

Transaction on chain status. Statuses: TRANSACTION_ON_CHAIN_PENDING, TRANSACTION_ON_CHAIN_IN_PROGRESS, TRANSACTION_ON_CHAIN_FAILED, TRANSACTION_ON_CHAIN_SUCCEED

priceInUSDCents - Int!

NFT token value in cents.

serviceFeeInUSDCents - Int!

Fee charged during stripe payment in cents

serviceFeePercentage - Int!

Fee rate charged during stripe payment. max value 100. Percentage value

messageId - String

Id generated by the client

transactionHash - String

A unique string that is given to every transaction that is verified and added to the blockchain.

createdAt - DateTime!

Time at which the object was created.

updatedAt - DateTime!

Time at which the object was last updated.

Example

Types

PurchaseEventListDto

Description

List of purchase events attached to the user.

Fields

Field Name
Description

total - Float!

The number of objects.

Contains an array of purchase events

Example

Types

PurchaseEventStatus

Values

Enum Value
Description

DRAFT

PAYMENT_SUCCESSFUL

PAYMENT_FAILED

Example

Types

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

Documentation by Anvil SpectaQL

Last updated

Was this helpful?