Skip to main content
Version: Live

Authorization

An authorization is used to reserve funds on a card for a future transaction. It is not a charge, but it does reserve the funds on the card for a period of time. The authorization will expire after a period of time if it is not captured.

Authorizations are currently only available for certain processors. Please contact Pay Theory for more information.


The Authorization Object​

{
account_code: String
amount: Int!
authorization_date: AWSDateTime!
authorization_id: String!
avs_status: String
currency: String!
expiration_date: AWSDateTime
failure_reasons: [String]
fee_mode: FeeMode!
fees: Int!
invoice: Invoice
merchant_uid: String!
metadata: AWSJSON
payment_method: PaymentMethodToken!
reference: String
sale_id: String
status: AuthorizationStatus!
timezone: String
updated_row_at: AWSDateTime
}
Keytypedescription
account_codeStringCustom defined value passed in as the account code for the authorization.
amountInt!The amount of the authorization in cents.
authorization_dateAWSDateTime!The date and time the authorization was created.
authorization_idString!The Pay Theory unique identifier assigned to the authorization.
avs_statusStringThe AVS status of the authorization.
currencyString!The currency of the authorization. Currently only USD is supported.
expiration_dateAWSDateTimeThe date and time the authorization will expire.
failure_reasons[String]Array of failure reasons for the authorization. If the authorization is successful, this will be null.
fee_modeFeeMode!The fee mode for the authorization. It can be one of the following: SERVICE_FEE, MERCHANT_FEE
feesInt!The amount of fees for the authorization in cents.
invoiceInvoiceThe invoice object for the invoice that the authorization belongs to. More information on the invoice object can be found here.
merchant_uidString!The Pay Theory unique identifier assigned to the merchant that the authorization belongs to.
metadataAWSJSONAny additional data that was stored with the authorization.
payment_methodPaymentMethodToken!The payment method token object for the payment method that the authorization belongs to. More information on the payment method token object can be found here.
referenceStringCustom defined value passed in as the reference for the authorization.
sale_idStringThe Pay Theory unique identifier assigned to the sale that the authorization belongs to. Sales can be used to tie together multiple auths and captures.
statusAuthorizationStatus!The status of the authorization. It can be one of the following: CANCELLED, FAILED, SUCCEEDED
timezoneStringThe timezone of the authorization.
updated_row_atAWSDateTimeThe date and time the authorization was last updated.

Query Authorizations​

{
authorizations(
direction: MoveDirection
limit: Int
offset: String
offset_id: String
query: SqlQuery
) {
items {
account_code
amount
authorization_date
authorization_id
currency
device_id
expiration_date
failure_reasons
fee_mode
fees
invoice {
invoice_id
}
merchant_uid
metadata(query_list: [])
payment_method(query_list: []) {
payment_method_id
payor(query_list: []) {
payor_id
}
}
reference
sale_id
status
timezone
updated_row_at
}
total_row_count
}
}

Parameters

Keytypedescription
limitIntThe number of authorizations to return.
directionStringThe direction of the pagination. Makes sure the results are returned in the correct order.
offsetStringThe value of the offset item for which the list is being sorted. If the direction is FORWARD, the offset item is the last item in the previous list. If the direction is BACKWARD, the offset is the first item in the previous list.
offset_idStringThe authorization_id of the offset item. If the direction is FORWARD, the offset item is the last item in the list. If the direction is BACKWARD, the offset is the first item in the list.
querySqlQueryThe query to filter the authorizations with based on Pay Theory defined data. Detailed information about the query object can be found here.

Nested Queries Authorizations can also be filtered by passing a query_list to the metadata, payment method, or payor tied to the payment method.

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


Create Authorization​

mutation {
createAuthorization( account_code: String,
amount: Int,
fee: Int,
fee_mode: MERCHANT_FEE,
health_expense_type: CLINICAL,
invoice_id: String,
merchant_uid: String,
metadata: AWSJSON,
one_time_use_token: Boolean,
payment_method: {},
payment_method_id: String,
reference: String,
sale_id: String) {
authorization_id
...
}
}

Parameters

Keytypedescription
account_codeStringCustom defined value passed in as the account code for the authorization.
amountInt!The amount of the authorization in cents.
feeIntThe amount of the service fee in cents.
fee_modeFeeMode!The fee mode for the authorization. It can be one of the following: SERVICE_FEE, MERCHANT_FEE
health_expense_typeHealthExpenseTypeThe health expense type for the authorization. It can be one of the following: CLINICAL, COPAY, DENTAL, HEALTHCARE, RX, TRANSIT, VISION
invoice_idStringThe Pay Theory unique identifier assigned to the invoice that the authorization belongs to.
merchant_uidString!The Pay Theory unique identifier assigned to the merchant that the authorization belongs to.
metadataAWSJSONAny additional data that should be stored with the authorization.
one_time_use_tokenBooleanIf the payment method token should be used for a single transaction. Defaults to false. If set to true the is_active flag on the payment method will be set to false after the authorization.
payment_methodPaymentMethodInputThe payment method input object for the payment method that will be used for the authorization. More information on the payment method input object can be found here.
payment_method_idStringThe Pay Theory unique identifier assigned to the payment method that will be used for the authorization.
referenceStringCustom defined value passed in as the reference for the authorization.
sale_idStringThe Pay Theory unique identifier assigned to the sale that the authorization belongs to. Sales can be used to tie together multiple auths and captures.

Returns

The authorization object. Refer to the Authorization Object for more info.


Create Wallet Authorization​

This call is used to create an authorization for a wallet payment via Apple Pay or Google Pay. It works in conjunction with our SDKs to allow you to create an authorization via our API.

mutation {
createWalletAuthorization(
app_id: String,
merchant_uid: String!,
sale_id: String,
wallet_type: WalletType,
digital_wallet_payload: String!,
amount: Int,
fee: Int,
billing_address: BillingAddressInput,
payor_id: String,
payor: PayorInput,
invoice_id: String,
account_code: String,
reference: String,
metadata: AWSJSON,
health_expense_type: HealthExpenseType,
additional_purchase_data: AdditionalPurchaseDataInput) {
authorization_id
...
}
}

Parameters

Keytypedescription
app_idStringThe Pay Theory unique identifier for the application.
merchant_uidString!The Pay Theory unique identifier assigned to the merchant that the authorization belongs to.
sale_idStringThe Pay Theory unique identifier assigned to the sale that the authorization belongs to. Sales can be used to tie together multiple auths and captures.
wallet_typeWalletTypeThe type of digital wallet being used. Can be one of: APPLE_PAY, GOOGLE_PAY, CLICK_TO_PAY, SAMSUNG_PAY, VISA_STAGED
digital_wallet_payloadString!The encrypted payload from the PayTheory SDK containing payment information.
amountIntThe amount of the authorization in cents.
feeIntThe amount of the service fee in cents. Required if fee_mode is SERVICE_FEE.
billing_addressBillingAddressInputThe billing address information for the authorization.
payor_idStringThe Pay Theory unique identifier for the payor making the payment.
payorPayorInputThe payor information if a new payor needs to be created.
invoice_idStringThe Pay Theory unique identifier assigned to the invoice that the authorization belongs to.
account_codeStringCustom defined value passed in as the account code for the authorization.
referenceStringCustom defined value passed in as the reference for the authorization.
metadataAWSJSONAny additional data that should be stored with the authorization.
health_expense_typeHealthExpenseTypeThe health expense type for the authorization. Can be one of: CLINICAL, COPAY, DENTAL, HEALTHCARE, RX, TRANSIT, VISION
additional_purchase_dataAdditionalPurchaseDataInputAdditional purchase data for Level 3 processing requirements.

Returns

The authorization object. Refer to the Authorization Object for more info.


Capture Authorization​

mutation {
createCapture( allow_exceeded_amount: false,
allow_reauth: false,
amount: 10,
fee: 10,
authorization_id: "",
merchant_uid: "",
receipt_description: "",
send_receipt: false,
split: [SplitInput]) {
transaction_id
...
}
}

Parameters

Keytypedescription
allow_exceeded_amountBooleanWhether to allow the capture to exceed the amount of the authorization.

If this is set to true Pay Theory will release the hold on the current auth and create a new auth for the amount of the capture.

If this is set to false or left blank, the capture will fail if the amount is greater than the amount of the authorization.
allow_reauthBooleanWhether to allow the capture to be reauthorized in the case that it is expired.

If this is set to true Pay Theory will reauthorize the capture if it is expired.

If this is set to false or left blank, the capture will fail if it is expired.
amountInt!The amount of the capture in cents. If auth has a fee_mode of SERVICE_FEE this amount would be the amount without the fee included.
authorization_idString!The Pay Theory unique identifier assigned to the authorization that you are looking to capture.
feeIntThe amount of the service fee in cents. Required if you are capturing an auth that has a fee_mode of SERVICE_FEE.
merchant_uidString!The Pay Theory unique identifier assigned to the merchant that the authorization belongs to.
receipt_descriptionStringA custom description that will be displayed on the receipt.
send_receiptBooleanCan be set to true to send a receipt to the payor.
split[SplitInput]An array of split objects to distribute the transaction amount to different accounts. The sum of all split amounts must equal the transaction amount.

Returns

The transaction object. Refer to the Transaction Object for more info.


Void Authorization​

This will void an authorization that has not been captured. If the authorization has been captured, this call will fail.

Partial voids are not supported by all processors and cannot be processed on an Amex authorization. Please contact Pay Theory for more information.

mutation {
createVoidForAuthorization(authorization_id: String!, void_amount: Int @deprecated(reason: "Only full voids are supported.")): Boolean
}

Parameters

Keytypedescription
authorization_idString!The Pay Theory unique identifier assigned to the authorization that you are looking to void.
void_amountInt!The amount of the void in cents.

Deprecated Only full voids are supported.

Returns This call returns a boolean indicating if the void was successful.


WalletType Enum​

The WalletType enum represents the different digital wallet providers supported for wallet authorizations.

enum WalletType {
APPLE_PAY
CLICK_TO_PAY
GOOGLE_PAY
SAMSUNG_PAY
VISA_STAGED
}
Valuedescription
APPLE_PAYApple Pay wallet transactions
CLICK_TO_PAYClick to Pay (formerly Secure Remote Commerce) transactions
GOOGLE_PAYGoogle Pay wallet transactions
SAMSUNG_PAYSamsung Pay wallet transactions
VISA_STAGEDVisa staged wallet transactions

BillingAddressInput Object​

The billing address input object used for wallet authorizations.

input BillingAddressInput {
address_line1: String
address_line2: String
city: String
country: String
full_name: String
postal_code: String
region: String
}
Keytypedescription
address_line1StringThe first line of the billing address
address_line2StringThe second line of the billing address (optional)
cityStringThe city of the billing address
countryStringThe country code of the billing address (e.g., "US")
full_nameStringThe full name associated with the billing address
postal_codeStringThe postal or zip code of the billing address
regionStringThe state, province, or region of the billing address