Skip to content

Commit

Permalink
Merge pull request #87 from pay-theory/PTP-1232-Update-docs-for-2.23
Browse files Browse the repository at this point in the history
feat: updated docs for 2.23. Fixed some broken links and reorganized …
  • Loading branch information
aron23 authored Jul 12, 2024
2 parents bbd3e82 + f4dacc9 commit 5a654f5
Show file tree
Hide file tree
Showing 25 changed files with 4,578 additions and 3,242 deletions.
67 changes: 34 additions & 33 deletions docs/api/authorization.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
sidebar_position: 4
sidebar_position: 50
sidebar_label: 'Authorization'
title: "Authorization"
---

# Authorization
# 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.
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.*
***
Expand All @@ -18,6 +18,7 @@ An authorization is used to reserve funds on a card for a future transaction. I
amount: Int!
authorization_date: AWSDateTime!
authorization_id: String!
avs_status: String
currency: String!
expiration_date: AWSDateTime
failure_reasons: [String]
Expand All @@ -36,11 +37,12 @@ An authorization is used to reserve funds on a card for a future transaction. I
```

|Key |type | description |
|-------------------|-------------|---------------------------------------|
|-------------------|-------------|---------------------------------------|
|account_code |String |Custom defined value passed in as the account code for the authorization.|
|amount |Int! |The amount of the authorization in cents.|
|authorization_date |AWSDateTime! |The date and time the authorization was created.|
|authorization_id |String! |The Pay Theory unique identifier assigned to the authorization.|
|avs_status |String |The AVS status of the authorization.|
|currency |String! |The currency of the authorization. Currently only `USD` is supported.|
|expiration_date |AWSDateTime |The 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.|
Expand Down Expand Up @@ -98,16 +100,16 @@ An authorization is used to reserve funds on a card for a future transaction. I
**Parameters**

|Key |type | description |
|-------------------|-------------|---------------------------------------|
|-------------------|-------------|---------------------------------------|
|limit |Int |The number of authorizations to return.|
|direction |String |The direction of the pagination. Makes sure the results are returned in the correct order.|
|offset |String |The 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_id |String |The `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.|
|query |QueryObject |The query to filter the authorizations with based on Pay Theory defined data. Detailed information about the query object can be found [here](query).|


**Nested Queries**
Authorizations can also be filtered by passing a query_list to the metadata, payment method, or payor tied to the payment method.
**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](query).

Expand All @@ -116,17 +118,17 @@ This will only return Authorizations that have Metadata, Payment Methods, or Pay

```graphql
mutation {
createAuthorization( account_code: "",
amount: 10,
fee: 10,
fee_mode: MERCHANT_FEE,
health_expense_type: CLINICAL,
invoice_id: "",
merchant_uid: "",
metadata: "false",
payment_method: {},
payment_method_id: "",
reference: "",
createAuthorization( account_code: "",
amount: 10,
fee: 10,
fee_mode: MERCHANT_FEE,
health_expense_type: CLINICAL,
invoice_id: "",
merchant_uid: "",
metadata: "false",
payment_method: {},
payment_method_id: "",
reference: "",
sale_id: "") {
authorization_id
...
Expand All @@ -137,7 +139,7 @@ mutation {
**Parameters**

|Key |type | description |
|-------------------|-------------|---------------------------------------|
|-------------------|-------------|---------------------------------------|
|account_code |String |Custom defined value passed in as the account code for the authorization.|
|amount |Int! |The amount of the authorization in cents.|
|fee |Int |The amount of the service fee in cents.|
Expand All @@ -161,13 +163,13 @@ The authorization object. Refer to the [Authorization Object](#the-authorizatio

```graphql
mutation {
createCapture( allow_exceeded_amount: false,
allow_reauth: false,
createCapture( allow_exceeded_amount: false,
allow_reauth: false,
amount: 10,
fee: 10,
authorization_id: "",
merchant_uid: "",
receipt_description: "",
authorization_id: "",
merchant_uid: "",
receipt_description: "",
send_receipt: false) {
transaction_id
...
Expand All @@ -179,7 +181,7 @@ mutation {
**Parameters**

|Key |type | description |
|-------------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|-------------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|allow_exceeded_amount|Boolean | Whether to allow the capture to exceed the amount of the authorization. <br/><br/>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. <br/><br/>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_reauth |Boolean | Whether to allow the capture to be reauthorized in the case that it is expired. <br/><br/>If this is set to `true` Pay Theory will reauthorize the capture if it is expired. <br/><br/>If this is set to `false` or left blank, the capture will fail if it is expired. |
|amount |Int! | 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. |
Expand All @@ -197,22 +199,21 @@ The transaction object. Refer to the [Transaction Object](transaction.md) for m
***
## Void Authorization

This will void an authorization that has not been captured. If the authorization has been captured, this call will fail.
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.*

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

**Parameters**

|Key |type | description |
|-------------------|-------------|----------------------------------------------------------------------------------------------|
|authorization_id |String! | The Pay Theory unique identifier assigned to the authorization that you are looking to void. |
|void_amount |Int! | The amount of the void in cents. <br/><br/> *Partial voids are not supported by all processors and cannot be processed on an Amex authorization. Please contact Pay Theory for more information.* |
| Key |type | description |
|------------------|-------------|----------------------------------------------------------------------------------------------|
| authorization_id |String! | The Pay Theory unique identifier assigned to the authorization that you are looking to void. |
| ~~void_amount~~ |Int! | The amount of the void in cents. <br/><br/> *Deprecated* Only full voids are supported. |

**Returns**
**Returns**
This call returns a boolean indicating if the void was successful.
182 changes: 182 additions & 0 deletions docs/api/barcode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
---
sidebar_position: 50
sidebar_label: 'Barcode'
title: "Barcode"
---

# Barcode

Barcodes are used to define and capture cash payments in the Pay Theory system.

***

## The Barcode Object

```graphql
{
account_code: String
amount: Int!
barcode_id: String!
barcode_url: String
email_or_phone: String!
expiration_date: AWSDate
fees: Int
full_name: String!
invoice_id: String
merchant_uid: String!
metadata: AWSJSON
payor: Payor
reference: String
sale_id: String
}
```

| Key | type | description |
|-----------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| account_code | String | Custom defined value passed in as the account code for the barcode. |
| amount | Int | The amount of the payment. |
| barcode_id | String | The unique barcode identifier. |
| barcode_url | String | The URL to the barcode image. |
| email_or_phone | String | The email or phone number of the payor. |
| expiration_date | String | The date the barcode expires. |
| fees | Int | The fees associated with the payment. |
| full_name | String | The full name tied to the barcode. |
| invoice_id | String | The invoice id associated with the payment. |
| merchant_uid | String | The Pay Theory unique identifier assigned to the merchant. |
| metadata | AWSJSON | The metadata to attach to the barcode. This is a JSON object that can contain any data that you want to attach to the barcode. |
| payor | Payor | The payor object associated with the barcode. |
| reference | String | Custom defined value passed in as the reference for the barcode. |
| sale_id | String | The Pay Theory unique identifier assigned to the sale that the authorization belongs to. Sales can be used to tie together multiple transactions. |

***

## Query Barcode

This can be used to call back a single barcode.

```graphql
{
barcode(barcode_id: String!, merchant_uid: String!) {
account_code
amount
barcode_id
barcode_url
email_or_phone
expiration_date
fees
full_name
invoice_id
merchant_uid
metadata
payor {
address_line1
address_line2
city
country
email
full_name
merchant_uid
metadata
payor_id
phone
postal_code
region
}
payor_id
reference
sale_id
}
}

```

**Parameters**

| Key | type | description |
|-------------|--------|-----------------------------------------------------------------------------------------------|
| barcode_id | String | The unique barcode identifier. |
| merchant_uid| String | The Pay Theory unique identifier assigned to the merchant. |

**Returns**

Returns the barcode object that was queried.

***

## Create Barcode

```graphql
mutation MyMutation {
createBarcode(input: { account_code: String,
amount: Int!,
days_until_expiration: Int,
email_or_phone: String!,
expiration_date: AWSDate,
full_name: String!,
invoice_id: String,
merchant_uid: String!,
metadata: AWSJSON,
payor: PayorInput,
payor_id: String,
reference: String,
sale_id: String
}) {
account_code
amount
barcode_id
barcode_url
email_or_phone
expiration_date
fees
full_name
invoice_id
merchant_uid
metadata
payor_id
reference
sale_id
payor {
address_line1
address_line2
city
country
email
full_name
merchant_uid
metadata
payor_id
phone
postal_code
region
}
}
}
```

**Parameters**

| Key | type | description |
|---------------------|------------|-------------|
| input | BarcodeInput | This object contains all the information needed to create a barcode. |

**BarcodeInput**

| Key | type | description |
|---------------------|------------|-------------------------------------------------------------------------------------|
| account_code | String | Custom defined value passed in as the account code for the barcode. |
| amount | Int | The amount of the payment. |
| days_until_expiration| Int | The number of days until the barcode expires. **Cannot use with `expiration_date`** |
| email_or_phone | String | The email or phone number of the payor. |
| expiration_date | AWSDate | The date the barcode expires. **Cannot use with `days_until_expiration`** |
| full_name | String | The full name tied to the barcode. |
| invoice_id | String | The invoice id associated with the payment. |
| merchant_uid | String | The Pay Theory unique identifier assigned to the merchant. |
| metadata | AWSJSON | The metadata to attach to the barcode. |
| payor | PayorInput | The payor object associated with the barcode. |
| payor_id | String | The Pay Theory unique identifier assigned to the payor. |
| reference | String | Custom defined value passed in as the reference for the barcode. |
| sale_id | String | The Pay Theory unique identifier assigned to the sale that the authorization belongs to. Sales can be used to tie together multiple transactions. |

**Returns**

Returns the barcode object that was created.
Loading

0 comments on commit 5a654f5

Please sign in to comment.