LogoLogo
How can we help?
  • Getting Started
    • Introduction
    • Onboarding To Revelator
      • Setup Your Supply Chain
        • Page 1
      • Migrating your Catalog
      • Importing Your Catalog
      • Delivering your Catalog
      • Ingesting your Rights
      • Digital Sales Reporting
      • White Label
        • Creating your Sign up/Login page
        • Sending emails
        • Adding your brand
        • Adding a custom domain
        • Adding Custom Fonts
        • Setting up your default contracts
    • Account Settings
      • Workspace Settings
      • Team Management
      • Integrations
      • Payee Settings
      • Branding
      • NFT Storefront
      • Client Features
  • Platform
    • Catalog
      • Releases
        • Create a Release
        • Viewing a Release
          • Metadata
          • Tracks
          • Rights
          • Distribution
          • Analytics
      • Tracks
        • Rights
        • Create a Track
      • Videos
      • Channels
        • Connecting to an MCN
        • Assign Channel Ownership
        • Edit Video Metadata
      • Collectibles
      • Contributors
        • Managing Labels
        • Managing Artists
    • Rights
      • Manage Contracts
        • Create a Contract
        • Create a YouTube Channel Contract
    • Distribution
      • Distributing Releases
      • Inspecting Metadata
    • Finance
      • Importing DSP/Sales Reports
      • Viewing DSP/Sales Reports
      • Maching Catalog to Revenue
      • Adding adjustmens & FX rates
      • Approving Sales Reports
      • Reporting YouTube Channel Royalties
      • Revenue Analytics
    • Royalties
      • Payees
        • Creating New Payees
        • Managing Your Payees
        • Enabling Payee Portals
      • Royalty Tokens
        • Creating Royalty Tokens
        • Receiving Royalty Tokens
      • Royalty Runs
        • Creating Royalty Runs
        • Fixing Unallocated Revenue
      • Statements
        • Viewing a Statement
        • Approving Statements
  • Payments
    • Payments With Tipalti
      • Connecting Payees To Tipalti
      • Making Payments with Tipalti
      • Retry Failed Tipalti Payments
    • Payments With PayPal
      • Making Payments with PayPal
    • Transactions
    • Adding Payee Advances
    • Exporting Payee Balances for External Payout Providers
  • Analytics
    • Consumption
    • Engagement
    • Trends
    • Geo
  • Resources
    • Learn The Basics
    • Metadata Styleguide
    • Support
    • Developer API
Powered by GitBook
On this page
  • GraphQL API Reference
  • Queries
  • customer
  • exchangeRates
  • listCards
  • purchaseEvent
  • purchaseEventList
  • sayHello
  • Mutations
  • createCard
  • createPurchaseEvent
  • detachCard
  • getOrCreateFeeRate
  • Types
  • Boolean
  • CreateCardDataDto
  • CustomerDto
  • DateTime
  • ExchangeQuotesDTO
  • ExchangeRateDto
  • FeeRateDto
  • Float
  • GetCardsDto
  • Int
  • NetworkName
  • NetworkNameDto
  • OnchainTxEventStatus
  • PaymentCardDataDto
  • PaymentCardDataListDto
  • PurchaseEventDto
  • PurchaseEventListDto
  • PurchaseEventStatus
  • String

Was this helpful?

  1. Resources
  2. web3
  3. devel

payment-service-api

Last updated 2 days ago

Was this helpful?

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

Example

Query

query Customer {
  customer {
    id
    stripeCustomerId
    defaultPaymentMethodId
    email
    defaultPaymentMethod {
      brand
      country
      expirationMonth
      expirationYear
      lastFourDigits
    }
    createdAt
    updatedAt
  }
}

Response

{
  "data": {
    "customer": {
      "id": 987.65,
      "stripeCustomerId": "xyz789",
      "defaultPaymentMethodId": "abc123",
      "email": "abc123",
      "defaultPaymentMethod": PaymentCardDataDto,
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

exchangeRates

Description

🔓 Public

Returns exchange rates.

Response

Example

Query

query ExchangeRates {
  exchangeRates {
    ETH {
      USD
      EUR
      ETH
    }
    MATIC {
      USD
      EUR
      ETH
    }
    USDC {
      USD
      EUR
      ETH
    }
    USDT {
      USD
      EUR
      ETH
    }
    BNB {
      USD
      EUR
      ETH
    }
    WETH {
      USD
      EUR
      ETH
    }
    DAI {
      USD
      EUR
      ETH
    }
    AVAX {
      USD
      EUR
      ETH
    }
    BUSD {
      USD
      EUR
      ETH
    }
    WBTC {
      USD
      EUR
      ETH
    }
    ATOM {
      USD
      EUR
      ETH
    }
    ASTR {
      USD
      EUR
      ETH
    }
    updatedAt
  }
}

Response

{
  "data": {
    "exchangeRates": {
      "ETH": ExchangeQuotesDTO,
      "MATIC": ExchangeQuotesDTO,
      "USDC": ExchangeQuotesDTO,
      "USDT": ExchangeQuotesDTO,
      "BNB": ExchangeQuotesDTO,
      "WETH": ExchangeQuotesDTO,
      "DAI": ExchangeQuotesDTO,
      "AVAX": ExchangeQuotesDTO,
      "BUSD": ExchangeQuotesDTO,
      "WBTC": ExchangeQuotesDTO,
      "ATOM": ExchangeQuotesDTO,
      "ASTR": ExchangeQuotesDTO,
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

listCards

Description

🔒 JWT Token

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

Response

Example

Query

query ListCards {
  listCards {
    items {
      brand
      country
      expirationMonth
      expirationYear
      lastFourDigits
      paymentMethodId
    }
    total
  }
}

Response

{
  "data": {
    "listCards": {
      "items": [PaymentCardDataListDto],
      "total": 123.45
    }
  }
}

purchaseEvent

Description

🔒 JWT Token

Retrieve purchase event by id attached to the user

Response

Arguments

Name
Description

Unique identifier for the purchase event object

Example

Query

query PurchaseEvent($purchaseEventId: Float!) {
  purchaseEvent(purchaseEventId: $purchaseEventId) {
    id
    invoiceItemId
    invoiceId
    amount
    currency
    purchaseEventStatus
    collectionContract
    tokenId
    seller
    quantity
    networkName
    onchainTxEventStatus
    priceInUSDCents
    serviceFeeInUSDCents
    serviceFeePercentage
    messageId
    transactionHash
    createdAt
    updatedAt
  }
}

Variables

{"purchaseEventId": 987.65}

Response

{
  "data": {
    "purchaseEvent": {
      "id": 123.45,
      "invoiceItemId": "abc123",
      "invoiceId": "xyz789",
      "amount": "abc123",
      "currency": "xyz789",
      "purchaseEventStatus": "DRAFT",
      "collectionContract": "xyz789",
      "tokenId": "abc123",
      "seller": "abc123",
      "quantity": 123,
      "networkName": "ropsten",
      "onchainTxEventStatus": "TRANSACTION_ON_CHAIN_PENDING",
      "priceInUSDCents": 123,
      "serviceFeeInUSDCents": 123,
      "serviceFeePercentage": 123,
      "messageId": "abc123",
      "transactionHash": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

purchaseEventList

Description

🔒 JWT Token

Returns a list of purchase events attached to the user.

Response

Example

Query

query PurchaseEventList {
  purchaseEventList {
    total
    items {
      id
      invoiceItemId
      invoiceId
      amount
      currency
      purchaseEventStatus
      collectionContract
      tokenId
      seller
      quantity
      networkName
      onchainTxEventStatus
      priceInUSDCents
      serviceFeeInUSDCents
      serviceFeePercentage
      messageId
      transactionHash
      createdAt
      updatedAt
    }
  }
}

Response

{
  "data": {
    "purchaseEventList": {
      "total": 987.65,
      "items": [PurchaseEventDto]
    }
  }
}

sayHello

Response

Example

Query

query SayHello {
  sayHello
}

Response

{"data": {"sayHello": "abc123"}}

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

Arguments

Name
Description

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

Example

Query

mutation CreateCard($paymentMethodId: String!) {
  createCard(paymentMethodId: $paymentMethodId) {
    paymentMethodId
    stripeCustomerId
    customerId
    cardData {
      brand
      country
      expirationMonth
      expirationYear
      lastFourDigits
    }
  }
}

Variables

{"paymentMethodId": "abc123"}

Response

{
  "data": {
    "createCard": {
      "paymentMethodId": "xyz789",
      "stripeCustomerId": "xyz789",
      "customerId": 987.65,
      "cardData": PaymentCardDataDto
    }
  }
}

createPurchaseEvent

Description

🔒 JWT Token

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

Response

Arguments

Name
Description

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

mutation CreatePurchaseEvent(
  $amount: String!,
  $quantity: Float!,
  $tokenId: String!,
  $collectionContract: String!,
  $seller: String!,
  $network: NetworkNameDto!,
  $messageId: String!,
  $ownerUri: String!
) {
  createPurchaseEvent(
    amount: $amount,
    quantity: $quantity,
    tokenId: $tokenId,
    collectionContract: $collectionContract,
    seller: $seller,
    network: $network,
    messageId: $messageId,
    ownerUri: $ownerUri
  ) {
    id
    invoiceItemId
    invoiceId
    amount
    currency
    purchaseEventStatus
    collectionContract
    tokenId
    seller
    quantity
    networkName
    onchainTxEventStatus
    priceInUSDCents
    serviceFeeInUSDCents
    serviceFeePercentage
    messageId
    transactionHash
    createdAt
    updatedAt
  }
}

Variables

{
  "amount": "xyz789",
  "quantity": 123.45,
  "tokenId": "abc123",
  "collectionContract": "abc123",
  "seller": "xyz789",
  "network": NetworkNameDto,
  "messageId": "abc123",
  "ownerUri": "abc123"
}

Response

{
  "data": {
    "createPurchaseEvent": {
      "id": 987.65,
      "invoiceItemId": "xyz789",
      "invoiceId": "abc123",
      "amount": "abc123",
      "currency": "xyz789",
      "purchaseEventStatus": "DRAFT",
      "collectionContract": "abc123",
      "tokenId": "abc123",
      "seller": "abc123",
      "quantity": 987,
      "networkName": "ropsten",
      "onchainTxEventStatus": "TRANSACTION_ON_CHAIN_PENDING",
      "priceInUSDCents": 123,
      "serviceFeeInUSDCents": 123,
      "serviceFeePercentage": 123,
      "messageId": "xyz789",
      "transactionHash": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

detachCard

Description

🔒 JWT Token

Detach a PaymentMethod object from a Customer

Response

Arguments

Name
Description

Unique identifier for the card object.

Example

Query

mutation DetachCard($cardId: String!) {
  detachCard(cardId: $cardId)
}

Variables

{"cardId": "xyz789"}

Response

{"data": {"detachCard": "xyz789"}}

getOrCreateFeeRate

Description

🔓 Public

get actual payments fee rates

Response

Arguments

Name
Description

Name of the blockchain network on which the transaction occurs

Unique identifier for enterprise

Example

Query

mutation GetOrCreateFeeRate(
  $network: NetworkNameDto!,
  $ownerUri: String!
) {
  getOrCreateFeeRate(
    network: $network,
    ownerUri: $ownerUri
  ) {
    id
    ownerUri
    stripePurchaseFee
    createdAt
    updatedAt
  }
}

Variables

{
  "network": NetworkNameDto,
  "ownerUri": "abc123"
}

Response

{
  "data": {
    "getOrCreateFeeRate": {
      "id": 987.65,
      "ownerUri": "abc123",
      "stripePurchaseFee": 123.45,
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

Types

Boolean

Description

The Boolean scalar type represents true or false.

Example

true

CreateCardDataDto

Description

Data required to create the card.

Fields

Field Name
Description

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

{
  "paymentMethodId": "xyz789",
  "stripeCustomerId": "xyz789",
  "customerId": 987.65,
  "cardData": PaymentCardDataDto
}

CustomerDto

Description

CustomerDto describes a user's Stripe payment data

Fields

Field Name
Description

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

{
  "id": 987.65,
  "stripeCustomerId": "xyz789",
  "defaultPaymentMethodId": "abc123",
  "email": "xyz789",
  "defaultPaymentMethod": PaymentCardDataDto,
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z"
}

DateTime

Description

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

Example

"2007-12-03T10:15:30Z"

ExchangeQuotesDTO

Description

Quote currencies

Fields

Field Name
Description

High precision price in USD

High precision price in EUR

High precision price in ETH

Example

{"USD": 987.65, "EUR": 987.65, "ETH": 123.45}

ExchangeRateDto

Description

Exchange rate object

Fields

Field Name
Description

Date of last price update

Example

{
  "ETH": ExchangeQuotesDTO,
  "MATIC": ExchangeQuotesDTO,
  "USDC": ExchangeQuotesDTO,
  "USDT": ExchangeQuotesDTO,
  "BNB": ExchangeQuotesDTO,
  "WETH": ExchangeQuotesDTO,
  "DAI": ExchangeQuotesDTO,
  "AVAX": ExchangeQuotesDTO,
  "BUSD": ExchangeQuotesDTO,
  "WBTC": ExchangeQuotesDTO,
  "ATOM": ExchangeQuotesDTO,
  "ASTR": ExchangeQuotesDTO,
  "updatedAt": "2007-12-03T10:15:30Z"
}

FeeRateDto

Description

Payments fee rates

Fields

Field Name
Description

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

{
  "id": 987.65,
  "ownerUri": "abc123",
  "stripePurchaseFee": 987.65,
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z"
}

Float

Description

Example

123.45

GetCardsDto

Description

Returns a list of cards and their number.

Fields

Field Name
Description

Contains an array of cards

The number of objects.

Example

{"items": [PaymentCardDataListDto], "total": 123.45}

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

123

NetworkName

Values

Enum Value
Description

ropsten

kovan

ownet

mainnet

binance

bnbtest

sepolia

local

test

polygon

goerli

mumbai

ethereum

shibuya

amoy

base

baseSepolia

Example

"ropsten"

NetworkNameDto

Fields

Input Field
Description

Example

{"networkName": "ropsten"}

OnchainTxEventStatus

Values

Enum Value
Description

TRANSACTION_ON_CHAIN_PENDING

TRANSACTION_ON_CHAIN_IN_PROGRESS

TRANSACTION_ON_CHAIN_FAILED

TRANSACTION_ON_CHAIN_SUCCEED

Example

"TRANSACTION_ON_CHAIN_PENDING"

PaymentCardDataDto

Description

Basic information about a credit or debit card.

Fields

Field Name
Description

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

{
  "brand": "abc123",
  "country": "xyz789",
  "expirationMonth": 987.65,
  "expirationYear": 987.65,
  "lastFourDigits": "xyz789"
}

PaymentCardDataListDto

Description

Basic information about a credit or debit card.

Fields

Field Name
Description

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

{
  "brand": "abc123",
  "country": "abc123",
  "expirationMonth": 123.45,
  "expirationYear": 987.65,
  "lastFourDigits": "xyz789",
  "paymentMethodId": "abc123"
}

PurchaseEventDto

Description

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

Fields

Field Name
Description

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

{
  "id": 987.65,
  "invoiceItemId": "abc123",
  "invoiceId": "abc123",
  "amount": "xyz789",
  "currency": "abc123",
  "purchaseEventStatus": "DRAFT",
  "collectionContract": "xyz789",
  "tokenId": "abc123",
  "seller": "abc123",
  "quantity": 123,
  "networkName": "ropsten",
  "onchainTxEventStatus": "TRANSACTION_ON_CHAIN_PENDING",
  "priceInUSDCents": 987,
  "serviceFeeInUSDCents": 123,
  "serviceFeePercentage": 123,
  "messageId": "abc123",
  "transactionHash": "xyz789",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z"
}

PurchaseEventListDto

Description

List of purchase events attached to the user.

Fields

Field Name
Description

The number of objects.

Contains an array of purchase events

Example

{"total": 123.45, "items": [PurchaseEventDto]}

PurchaseEventStatus

Values

Enum Value
Description

DRAFT

PAYMENT_SUCCESSFUL

PAYMENT_FAILED

Example

"DRAFT"

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

"xyz789"

Returns an

Returns a

Returns a

purchaseEventId -

Returns a

Returns a

Returns a

paymentMethodId -

Returns a

amount -

quantity -

tokenId -

collectionContract -

seller -

network -

messageId -

ownerUri -

Returns a

cardId -

Returns a

network -

ownerUri -

paymentMethodId -

stripeCustomerId -

customerId -

cardData -

id -

stripeCustomerId -

defaultPaymentMethodId -

email -

defaultPaymentMethod -

createdAt -

updatedAt -

USD -

EUR -

ETH -

ETH -

MATIC -

USDC -

USDT -

BNB -

WETH -

DAI -

AVAX -

BUSD -

WBTC -

ATOM -

ASTR -

updatedAt -

id -

ownerUri -

stripePurchaseFee -

createdAt -

updatedAt -

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

items -

total -

networkName -

brand -

country -

expirationMonth -

expirationYear -

lastFourDigits -

brand -

country -

expirationMonth -

expirationYear -

lastFourDigits -

paymentMethodId -

id -

invoiceItemId -

invoiceId -

amount -

currency -

purchaseEventStatus -

collectionContract -

tokenId -

seller -

quantity -

networkName -

onchainTxEventStatus -

priceInUSDCents -

serviceFeeInUSDCents -

serviceFeePercentage -

messageId -

transactionHash -

createdAt -

updatedAt -

total -

items -

IEEE 754
Documentation by Anvil SpectaQL
CustomerDto!
Queries
ExchangeRateDto!
Queries
GetCardsDto!
Queries
PurchaseEventDto!
Queries
PurchaseEventListDto!
Queries
String!
CreateCardDataDto!
Mutations
PurchaseEventDto!
Mutations
String!
Mutations
FeeRateDto!
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
Types
Float!
String!
String!
Float!
String!
String!
String!
NetworkNameDto!
String!
String!
String!
NetworkNameDto!
String!
String!
String!
Float!
PaymentCardDataDto
Float!
String!
String
String
PaymentCardDataDto
DateTime!
DateTime!
Float!
Float!
Float!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
ExchangeQuotesDTO!
DateTime!
Float!
String!
Float!
DateTime!
DateTime!
[PaymentCardDataListDto!]!
Float!
NetworkName!
String!
String!
Float!
Float!
String!
String!
String!
Float!
Float!
String!
String!
Float!
String!
String!
String!
String!
PurchaseEventStatus!
String
String
String
Int!
NetworkName!
OnchainTxEventStatus!
Int!
Int!
Int!
String
String
DateTime!
DateTime!
Float!
[PurchaseEventDto!]!