Skip to content

Latest commit

 

History

History
227 lines (175 loc) · 8.04 KB

tickets.md

File metadata and controls

227 lines (175 loc) · 8.04 KB

Tickets

The tickets endpoint is used as a single use cc only token generation endpoint. If there is a need to store card numbers with cvv for a one time use, then this is the endpoint to perform that task. Transactions run with the generated ticket_id can save card information for later with save_account.

$ticketsController = $client->getTicketsController();

Class Name

TicketsController

Methods

Create a Ticket Record

Create a Ticket record.

function createATicketRecord(V1TicketsRequest $body, ?array $expand = null): ResponseTicket

Parameters

Parameter Type Tags Description
body V1TicketsRequest Body, Required -
expand ?(string[]) (Expand38Enum) Query, Optional Most endpoints in the API have a way to retrieve extra data related to the current record being retrieved. For example, if the API request is for the accountvaults endpoint, and the end user also needs to know which contact the token belongs to, this data can be returned in the accountvaults endpoint request.
Constraints: Unique Items Required, Pattern: ^[\w]+$

Response Type

ResponseTicket

Example Usage

$body = V1TicketsRequestBuilder::init(
    '0722',
    '545454545454545'
)
    ->accountHolderName('John Smith')
    ->contactId('11e95f8ec39de8fbdb0a4f1a')
    ->build();

$result = $ticketsController->createATicketRecord($body);

Example Response (as JSON)

{
  "type": "Ticket",
  "data": {
    "account_holder_name": "John Smith",
    "exp_date": "0722",
    "cvv": null,
    "account_number": "545454545454545",
    "billing_address": {
      "postal_code": "48375"
    },
    "contact_id": "11e95f8ec39de8fbdb0a4f1a",
    "location_api_id": null,
    "id": "11e95f8ec39de8fbdb0a4f1a",
    "created_ts": 1422040992,
    "created_user_id": "11e95f8ec39de8fbdb0a4f1a"
  }
}

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized Response401tokenException
412 Precondition Failed Response412Exception

List All Tickets Related

List all tickets related

function listAllTicketsRelated(
    ?Page $page = null,
    ?Sort27 $sort = null,
    ?Filter11 $filter = null,
    ?array $expand = null
): ResponseTicketsCollection

Parameters

Parameter Type Tags Description
page ?Page Query, Optional Use this field to specify paginate your results, by using page size and number. You can use one of the following methods:

> /endpoint?page={ "number": 1, "size": 50 }
>
> /endpoint?page[number]=1&page[size]=50
sort ?Sort27 Query, Optional You can use any field_name from this endpoint results, and you can combine more than one field for more complex sorting. You can use one of the following methods:

> /endpoint?sort={ "field_name": "asc", "field_name2": "desc" }
>
> /endpoint?sort[field_name]=asc&sort[field_name2]=desc
filter ?Filter11 Query, Optional You can use any field_name from this endpoint results as a filter, and you can also use more than one field to create AND conditions. For date fields (ended with _ts), you can also search for ranges using the $gte (Greater than or equal to) and/or $lte (Lower than or equal to). You can use one of the following methods:

> /endpoint?filter={ "field_name": "Value" }
>
> /endpoint?filter[field_name]=Value
>
> /endpoint?filter={ "created_ts": "today" }
>
> /endpoint?filter[created_ts]=today
>
> /endpoint?filter={ "created_ts": { "$gte": "yesterday", "$lte": "today" } }
>
> /endpoint?filter[created_ts][$gte]=yesterday&filter[created_ts][$lte]=today
>
> /endpoint?filter[address][city]=memphis
>
> /endpoint?filter={ "address": { "city" : "memphis" } }
expand ?(string[]) (Expand38Enum) Query, Optional Most endpoints in the API have a way to retrieve extra data related to the current record being retrieved. For example, if the API request is for the accountvaults endpoint, and the end user also needs to know which contact the token belongs to, this data can be returned in the accountvaults endpoint request.
Constraints: Unique Items Required, Pattern: ^[\w]+$

Response Type

ResponseTicketsCollection

Example Usage

$page = PageBuilder::init()
    ->number(1)
    ->size(50)
    ->build();

$result = $ticketsController->listAllTicketsRelated($page);

Example Response (as JSON)

{
  "type": "TicketsCollection",
  "list": [
    {
      "account_holder_name": "John Smith",
      "exp_date": "0722",
      "cvv": null,
      "account_number": "545454545454545",
      "billing_address": {
        "postal_code": "48375"
      },
      "contact_id": "11e95f8ec39de8fbdb0a4f1a",
      "location_api_id": null,
      "id": "11e95f8ec39de8fbdb0a4f1a",
      "created_ts": 1422040992,
      "created_user_id": "11e95f8ec39de8fbdb0a4f1a"
    }
  ],
  "links": {
    "type": "Links",
    "first": "/v1/endpoint?page[size]=10&page[number]=1",
    "previous": "/v1/endpoint?page[size]=10&page[number]=5",
    "last": "/v1/endpoint?page[size]=10&page[number]=42"
  },
  "pagination": {
    "type": "Pagination",
    "total_count": 423,
    "page_count": 42,
    "page_number": 6,
    "page_size": 10
  },
  "sort": {
    "type": "Sorting",
    "fields": [
      {
        "field": "last_name",
        "order": "asc"
      }
    ]
  }
}

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized Response401tokenException

View Single Ticket Record

View single ticket record

function viewSingleTicketRecord(string $ticketId, ?array $expand = null): ResponseTicket

Parameters

Parameter Type Tags Description
ticketId string Template, Required A unique, system-generated identifier for the Ticket.
Constraints: Pattern: ^(([0-9a-fA-F\-]{24,36})|(([0-9a-fA-F]{8})-(([0-9a-fA-F]{4}\-){3})([0-9a-fA-F]{12})))$
expand ?(string[]) (Expand38Enum) Query, Optional Most endpoints in the API have a way to retrieve extra data related to the current record being retrieved. For example, if the API request is for the accountvaults endpoint, and the end user also needs to know which contact the token belongs to, this data can be returned in the accountvaults endpoint request.
Constraints: Unique Items Required, Pattern: ^[\w]+$

Response Type

ResponseTicket

Example Usage

$ticketId = '11e95f8ec39de8fbdb0a4f1a';

$result = $ticketsController->viewSingleTicketRecord($ticketId);

Example Response (as JSON)

{
  "type": "Ticket",
  "data": {
    "account_holder_name": "John Smith",
    "exp_date": "0722",
    "cvv": null,
    "account_number": "545454545454545",
    "billing_address": {
      "postal_code": "48375"
    },
    "contact_id": "11e95f8ec39de8fbdb0a4f1a",
    "location_api_id": null,
    "id": "11e95f8ec39de8fbdb0a4f1a",
    "created_ts": 1422040992,
    "created_user_id": "11e95f8ec39de8fbdb0a4f1a"
  }
}

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized Response401tokenException