Skip to main content
Version: Lab (preview)

Invoice

Invoices are used to create a payment request that can be sent to a payor.


The Invoice Object​

{
account_code: String
created_date: AWSDateTime
currency: String
due_by: AWSDate
fee_mode: FeeMode
invoice_amount: Int
invoice_date: AWSDate
invoice_description: String
invoice_id: String
invoice_name: String
merchant_invoice_number: String
merchant_uid: String
metadata: AWSJSON
offline_transactions: [OfflineTransaction]
payor: Payor
reference: String
settings: InvoiceSettings
status: InvoiceStatus
total_paid_amount: Int
}
Keytypedescription
account_codeStringA custom value that will be passed on to the transaction when a payment is made through Pay Theory's hosted checkout.
created_dateStringThe date the invoice was created.
currencyStringThe currency of the payment that will be used to pay the invoice.
due_byStringThe date that the payor is expected to pay the invoice by.
fee_modeFeeModeThe fee mode that will be used on that transaction when a payment is made through Pay Theory's hosted checkout. It can be one of the following: MERCHANT_FEE, SERVICE_FEE.
invoice_amountIntThe total amount of the invoice.
invoice_dateStringThe initial date for the Invoice.
invoice_descriptionStringA brief description of the invoice. This will show up on the hosted checkout page and any email communications about the Invoice.
invoice_idStringThe Pay Theory unique identifier for the invoice.
invoice_nameStringThe name of the invoice. This will show up on the hosted checkout page and any email communications about the Invoice.
merchant_invoice_numberStringA custom value that can be used to tie the Pay Theory Invoice to a merchant's internal invoice number.
merchant_uidStringThe Pay Theory unique identifier for the merchant that the invoice belongs to.
metadataAWSJSONA JSON object that can be used to store custom data about the invoice.
offline_transactions[OfflineTransaction]A list of offline transactions that have been applied to the invoice. This is used to track payments that are made outside Pay Theory toward an Invoice.
payorPayorThe payor object for the payor that the invoice belongs to. More information on the payor object can be found here.
referenceStringA custom value that will be passed on to the transaction when a payment is made through Pay Theory's hosted checkout.
settingsInvoiceSettingsThe settings object to configure settings for the Pay Theory hosted checkout page.
statusInvoiceStatusThe status of the invoice. It can be one of the following: NOT_PAID, PAID, PARTIALLY_PAID For the time being this will not be used as we do not yet support partial payments for Invoices.
total_paid_amountIntThe total amount that has been paid toward the invoice.

Invoice Settings Object​

{
accepted_payment_methods: AcceptedPaymentMethods
is_secure: Boolean
require_payor_address: Boolean
security_pin: String
}
Keytypedescription
accepted_payment_methodsAcceptedPaymentMethodsThe payment methods that will be accepted on the Pay Theory hosted checkout page.

An object containing keys of ach, card, and cash with a boolean value indicating if they are accepted.
is_secureBooleanWhen set to true, the payor will be required to enter a security pin to pay the invoice.
require_payor_addressBooleanWhen set to true, the payor will be required to enter their address to pay the invoice.
security_pinStringThe security pin that the payor will be required to enter to pay the invoice. This is only used if is_secure is set to true.

Query Invoices​

{
invoices(direction: MoveDirection, limit: Int, offset: String, offset_id: String, query: SqlQuery) {
items {
account_code
created_date
currency
due_by
fee_mode
invoice_amount
invoice_date
invoice_description
invoice_id
invoice_name
merchant_invoice_number
merchant_uid
metadata(query_list: [QueryPair])
offline_transactions {
amount
instance_id
invoice_id
note
transaction_date
type
}
payor(query_list: [QueryPair]) {
address_line1
address_line2
city
country
email
full_name
payor_id
phone
postal_code
region
}
reference
settings {
accepted_payment_methods {
ach
card
cash
}
is_secure
require_payor_address
security_pin
}
status
total_paid_amount
}
total_row_count
}
}
Keytypedescription
directionMoveDirectionThe direction of the pagination. Makes sure the results are returned in the correct order.
limitIntThe number of invoices to return.
offsetStringThe value of the offset item for which the list is being sorted.
offset_idStringThe invoice_id of the offset item.
querySqlQueryThe query to filter the invoices with based on Pay Theory defined data.

Nested Queries Invoices can also be filtered by passing a query_list to the metadata or payor.

This will only return Invoices that have Metadata or Payors that match these queries. Detailed information about the query list can be found here.

Returns

{
"data": {
"invoices": {
"items": [
{
"invoice_id": "pt_inv_xxxx"
},
{
"invoice_id": "pt_inv_xxxx"
}
],
"total_row_count": 256
}
}
}
Keytypedescription
itemsInvoice[]A list of invoices that match the query.
total_row_countIntThe total number of invoices that match the query.

Create an Invoice​

mutation {
create_invoice(input: CreateInvoiceInput!) {
account_code
created_date
currency
due_by
fee_mode
...
}
}
Keytypedescription
inputCreateInvoiceInputThe input object that contains all the information needed to create an invoice.

Create Invoice Input​

{
account_code: String
currency: String!
due_by: AWSDate
fee_mode: FeeMode
invoice_amount: Int!
invoice_date: AWSDate
invoice_description: String
invoice_name: String!
merchant_uid: String!
merchant_invoice_number: String
metadata: AWSJSON
payor_id: String
payor: PayorInput
reference: String
send_email: Boolean
settings: InvoiceSettingsInput
}
Keytypedescription
account_codeStringA custom value that will be passed on to the transaction when a payment is made through Pay Theory's hosted checkout.
currencyStringThe currency of the payment that will be used to pay the invoice.
due_byStringThe date that the payor is expected to pay the invoice by.
fee_modeFeeModeThe fee mode that will be used on that transaction when a payment is made through Pay Theory's hosted checkout. It can be one of the following: MERCHANT_FEE, SERVICE_FEE.
invoice_amountIntThe total amount of the invoice.
invoice_dateStringThe initial date for the Invoice.
invoice_descriptionStringA brief description of the invoice. This will show up on the hosted checkout page and any email communications about the Invoice.
invoice_nameStringThe name of the invoice. This will show up on the hosted checkout page and any email communications about the Invoice.
merchant_invoice_numberStringA custom value that can be used to tie the Pay Theory Invoice to a merchant's internal invoice number.
merchant_uidStringThe Pay Theory unique identifier for the merchant that the invoice belongs to.
metadataAWSJSONA JSON object that can be used to store custom data about the invoice.
payor_idStringThe Pay Theory unique identifier for the payor that the invoice belongs to.
payorPayorInputThe payor input object for the payor that the invoice belongs to. More information on the payor input object can be found here.
referenceStringA custom value that will be passed on to the transaction when a payment is made through Pay Theory's hosted checkout.
send_emailBooleanWhen set to true, an email will be sent to the payor with a link to the hosted checkout page.
settingsInvoiceSettingsInputThe settings input object to configure settings for the Pay Theory hosted checkout page.

Return The response will contain the invoice object that was created. More information on the invoice object.


Invoice Settings Input​

{
accepted_payment_methods: AcceptedPaymentMethodsInput
is_secure: Boolean
require_payor_address: Boolean
}
Keytypedescription
accepted_payment_methodsAcceptedPaymentMethodsInputThe payment methods that will be accepted on the Pay Theory hosted checkout page.

An object containing keys of ach, card, and cash with a boolean value indicating if they are accepted.
is_secureBooleanWhen set to true, the payor will be required to enter a security pin to pay the invoice.
require_payor_addressBooleanWhen set to true, the payor will be required to enter their address to pay the invoice.

Update an Invoice​

mutation {
updateInvoice(invoice_id: String!, invoice_update_input: UpdateInvoiceInput!) {
account_code
created_date
currency
due_by
fee_mode
...
}
}

Parameters

Keytypedescription
invoice_idStringThe Pay Theory unique identifier for the invoice to update.
invoice_update_inputUpdateInvoiceInputThe input object that contains all of the information needed to update an invoice.

UpdateInvoiceInput

{
account_code: String
currency: String
due_by: AWSDate
fee_mode: FeeMode
invoice_amount: Int
invoice_date: AWSDate
invoice_description: String
invoice_name: String
merchant_invoice_number: String
reference: String
send_email: Boolean
settings: InvoiceSettingsInput
}
Keytypedescription
account_codeStringA custom value that will be passed on to the transaction when a payment is made through Pay Theory's hosted checkout.
currencyStringThe currency of the payment that will be used to pay the invoice.
due_byStringThe date that the payor is expected to pay the invoice by.
fee_modeFeeModeThe fee mode that will be used on that transaction when a payment is made through Pay Theory's hosted checkout. It can be one of the following: MERCHANT_FEE, SERVICE_FEE.
invoice_amountIntThe total amount of the invoice.
invoice_dateStringThe initial date for the invoice.
invoice_descriptionStringA brief description of the invoice. This will show up on the hosted checkout page and any email communications about the Invoice.
invoice_nameStringThe name of the invoice. This will show up on the hosted checkout page and any email communications about the Invoice.
merchant_invoice_numberStringA custom value that can be used to tie the Pay Theory Invoice to a merchant's internal invoice number.
referenceStringA custom value that will be passed on to the transaction when a payment is made through Pay Theory's hosted checkout.
send_emailBooleanWhen set to true, an email will be sent to the payor with details about the updated invoice.
settingsInvoiceSettingsInputThe settings input object to configure settings for the Pay Theory hosted checkout page.

Returns The response will contain the invoice object that was updated. More information on the invoice object.


Delete an Invoice​

mutation {
deleteInvoice(invoice_id: String!)
}

Parameters

Keytypedescription
invoice_idStringThe Pay Theory unique identifier for the invoice to delete.

Returns The response will include a boolean value that will be true if the invoice was deleted successfully.


Create an Invoice Email​

This call is used to resend Invoice emails for a specific invoice.

mutation {
createInvoiceEmail(invoice_id: String!)
}

Parameters

Keytypedescription
invoice_idStringThe Pay Theory unique identifier for the invoice to send an email for.

Returns The response will include a boolean value that will be true if the email was sent successfully.


The Offline Transaction Object​

{
amount: Int
instance_id: String
invoice_id: String
note: String
transaction_date: AWSDate
type: OfflineTransactionType
}
Keytypedescription
amountIntThe amount of the offline transaction.
instance_idStringThe Pay Theory unique identifier for the offline transaction.
invoice_idStringThe Pay Theory unique identifier for the invoice that the offline transaction is being applied to.
noteStringA note that can be added to the offline transaction. This is a custom value that can be used to store information about the offline transaction.
transaction_dateStringThe date that the offline transaction was made.
typeOfflineTransactionTypeThe type of offline transaction. It can be one of the following: ACH, CARD, CASH, OTHER.

Create an Offline Transaction​

This call is used to create an offline transaction for an invoice. Offline transactions are used to track payments that are made outside Pay Theory toward an Invoice.

mutation {
createOfflineTransaction(input: CreateOfflineTransactionInput!) {
amount
instance_id
invoice_id
note
transaction_date
type
}
}

Parameters

Keytypedescription
inputCreateOfflineTransactionInputThe input object that contains all of the information needed to create an offline transaction.

CreateOfflineTransactionInput

{
amount: Int!
invoice_id: String!
note: String
transaction_date: AWSDate
type: OfflineTransactionType!
}
Keytypedescription
amountIntThe amount of the offline transaction.
invoice_idStringThe Pay Theory unique identifier for the invoice that the offline transaction is being applied to.
noteStringA note that can be added to the offline transaction. This is a custom value that can be used to store information about the offline transaction.
transaction_dateStringThe date that the offline transaction was made.
typeOfflineTransactionTypeThe type of offline transaction. It can be one of the following: ACH, CARD, CASH, OTHER.

Returns The response will contain the offline transaction object that was created. More information on the offline transaction object.