Skip to main content
Version: Lab (preview)

Payor

Payors are used to track payor info that can be tied to other data objects in Pay Theory.


The Payor Object​

{
address_line1: String
address_line2: String
city: String
country: String
email: String
full_name: String
merchant_uid: String
metadata: AWSJSON
payor_id: String
phone: String
postal_code: String
region: String
}
Keytypedescription
address_line1StringThe first line of the address of the payor.
address_line2StringThe second line of the address of the payor.
cityStringThe city of the payor.
countryStringThe country of the payor.
emailStringThe email address of the payor.
full_nameStringThe full name of the payor.
merchant_uidStringThe Pay Theory unique identifier assigned to the merchant that the payor belongs to.
metadataAWSJSONThe metadata to attach to the payor. This is a JSON object that can contain any data that you want to attach to the payor.
payor_idStringThe unique payor id.
phoneStringThe phone number of the payor.
postal_codeStringThe postal code of the payor.
regionStringThe region of the payor.

Query Payors​

{
payors(direction: MoveDirection, limit: Int, offset: String, offset_id: String, query: SqlQuery) {
items {
address_line1
address_line2
city
country
email
full_name
merchant_uid
metadata(query_list: [QueryPair])
payor_id
phone
postal_code
region
}
total_row_count
}
}

Parameters

Keytypedescription
directionMoveDirectionThe direction of the pagination. Makes sure the results are returned in the correct order.
limitIntThe number of payors to return.
offsetStringThe value of the offset item for which the list is being sorted.
offset_idStringThe payor_id of the offset item.
querySqlQueryThe query to filter the payors with based on Pay Theory defined data. Detailed information about the query object can be found here.

Nested Queries Payors can also be filtered by passing a query_list to the metadata.

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

Returns

{
"data": {
"payors": {
"items": [
{
"payor_id": "pt_pay_XXXXX",
},
{
"payor_id": "pt_pay_XXXXX",
},
...
],
"total_row_count": 256
}
}
}
Keytypedescription
items[Payor]The list of payors that are returned from the query.
total_row_countIntThe total number of payors that match the query. Used to help with pagination.

Create Payor​

mutation {
createPayor(input: PayorInput!) {
payor_id
merchant_uid
full_name
address_line1
address_line2
country
region
city
postal_code
email
phone
}
}

Parameters

Keytypedescription
inputPayorInputThe input object that contains the payor information to create a new payor. Detailed information about the input object can be found here.

Returns This mutation returns the payor object that was created.


The Payor Input Object​

{
address_line1: String
address_line2: String
city: String
country: String
email: String
full_name: String
merchant_uid: String
metadata: AWSJSON
phone: String
postal_code: String
region: String
}
Keytypedescription
address_line1StringThe first line of the address of the payor.
address_line2StringThe second line of the address of the payor.
cityStringThe city of the payor.
countryStringThe country of the payor.
emailStringThe email address of the payor.
full_nameStringThe full name of the payor.
merchant_uidStringThe Pay Theory unique identifier assigned to the merchant that the payor belongs to.
metadataAWSJSONThe metadata to attach to the payor. This is a JSON object that can contain any data that you want to attach to the payor.
phoneStringThe phone number of the payor.
postal_codeStringThe postal code of the payor.
regionStringThe region of the payor.

Update Payor​

mutation {
createPayor(payor_data: PayorInput!, payor_id: String!)
}

Parameters

Keytypedescription
payor_dataPayorInputThe input object that contains the payor information to update the payor. Detailed information about the input object can be found here.
payor_idStringThe unique payor id of the payor to update.