We highly recommend processing an Authorization or Sale using a card before storing it. Another option is to perform a Verification (a zero amount Authorization). This allows you to check that the card data provided is valid. For more information, refer to the API Reference. In this example, we send a request to store a card (create_token) as part of a Sale request, you can also tokenize ACH details.
For details on how to tokenize ACH details or process a check sale using a payment token, see our ACH article.
Important: For authentication, you must include the required headers in each request. For more information, please refer to Authenticating Your Requests.
| Environment | HTTP Method | URL |
|---|---|---|
| Sandbox | POST | https://api.pit.paygateway.com/transactions/creditsales |
| Production | POST | https://api.paygateway.com/transactions/creditsales |
Content-Type: application/json
Authorization: AuthToken {AuthTokenV2}
X-GP-Request-Id: {request_id}
X-GP-Version: 2021-04-08
X-GP-Api-Key: {API Key}
X-GP-Partner-App-Name: {Name of integrating application}
{
"reference_id": "adfdd88e-89c3-4239-a1d5-915f2e7e1ba0",
"card": {
"card_number": "4012888888881881",
"expiry_month": "12",
"expiry_year": "35",
"cardholder_name": "James Mason"
},
"payment": {
"amount": "50.00",
"currency_code": "840"
},
"transaction": {
"country_code": "840",
"processing_indicators": {
"create_token": true
}
}
}{
"transaction_id": "000000002271",
"status": "Approved",
"card": {
"masked_card_number": "401288XXXXXX1881",
"expiry_month": "12",
"expiry_year": "35",
"token": "znlsQzJW20",
"type": "Visa"
},
"payment": {
"type": "Credit"
}
}To charge a token, you will need to process a Sale or Authorize request using our REST API. Instead of submitting the customer’s card information in the request, you can simply pass a payment token.
Important: For authentication, you must include the required headers in each request. For more information, please refer to Authenticating Your Requests.
| Environment | HTTP Method | URL |
|---|---|---|
| Sandbox | POST | https://api.pit.paygateway.com/transactions/creditsales |
| Production | POST | https://api.paygateway.com/transactions/creditsales |
Content-Type: application/json
Authorization: AuthToken {AuthTokenV2}
X-GP-Request-Id: {request_id}
X-GP-Version: 2021-04-08
X-GP-Api-Key: {API Key}
X-GP-Partner-App-Name: {Name of integrating application}
{
"reference_id": "MER-41e40db1-02c8-4214-b2c8-1399aea79afa",
"card": {
"token": "znlsQzJW20"
},
"customer": {
"billing_address": {
"line1": "123 Test Ave",
"postal_code": "55555"
}
},
"payment": {
"amount": "1",
"currency_code": "840"
},
"transaction": {
"country_code": "840",
"processing_indicators": {
"create_token": true,
"address_verification_service": true,
"generate_receipt": true
}
}
}{
"creditsale_id": "000000084344",
"status": "approved",
"approval_code": "343390",
"avs_response": "full_match",
"avs_response_description": "Match - Street Address, Match - Postal Code",
"processor_response": "DEVELOPMENT APPROVAL",
"card": {
"masked_card_number": "476173XXXXXX0010",
"cardholder_name": "test name",
"expiry_month": "12",
"expiry_year": "35",
"type": "visa"
},
"payment": {
"amount": "9.57",
"currency_code": "840",
"type": "credit"
},
"transaction": {
"batch_amount": "26.81",
"batch_number": "000060",
"entry_type": "keyed",
"language": "en-US"
},
"links": [
{
"creditsale_id": [
{
"href": "https://api.pit.paygateway.com/transactions/creditsales/000000084344",
"relation": "self",
"method": "GET",
"description": "Use this endpoint to retrieve a sales transaction."
},
{
"href": "https://api.pit.paygateway.com/transactions/creditsales/000000084344",
"relation": "self",
"method": "PATCH",
"description": "Use this endpoint to update the amount or other values of a previous sales transaction."
},
{
"href": "https://api.pit.paygateway.com/transactions/creditsales/000000084344/voids",
"relation": "void",
"method": "PUT",
"description": "Use this endpoint to void a previous sales transaction."
},
{
"href": "https://api.pit.paygateway.com/transactions/creditsales/000000084344/returns",
"relation": "return",
"method": "POST",
"description": "Use this endpoint to create a returns transaction associated with a previous sales transaction."
}
]
},
{
"reference_id": [
{
"href": "https://api.pit.paygateway.com/transactions/creditsales/reference_id/MER-645bc12f-82d7-45fb-9d87-39c54281636a",
"relation": "self",
"method": "GET",
"description": "Use this endpoint to retreive a previous sales transaction using reference id."
},
{
"href": "https://api.pit.paygateway.com/transactions/creditsales/reference_id/MER-645bc12f-82d7-45fb-9d87-39c54281636a",
"relation": "self",
"method": "PATCH",
"description": "Use this endpoint to update the amount or other values of a previous sales transaction using reference id."
},
{
"href": "https://api.pit.paygateway.com/transactions/creditsales/reference_id/MER-645bc12f-82d7-45fb-9d87-39c54281636a/voids",
"relation": "void",
"method": "PUT",
"description": "Use this endpoint to void a previous sales transaction using reference id."
},
{
"href": "https://api.pit.paygateway.com/transactions/creditsales/reference_id/MER-645bc12f-82d7-45fb-9d87-39c54281636a/returns",
"relation": "return",
"method": "POST",
"description": "Use this endpoint to create a returns transaction associated with a previous sales using reference id."
}
]
}
],
"reference_id": "MER-645bc12f-82d7-45fb-9d87-39c54281636a"
}Update the card or ACH details associated with a token. For example, you can update the expiry date associated with a card number.
Important: For authentication, you must include the required headers in each request. For more information, please refer to Authenticating Your Requests.
| Environment | HTTP Method | URL |
|---|---|---|
| Sandbox | PATCH | https://api.pit.paygateway.com/tokenization/cardtokens/{tokenID} |
| Production | PATCH | https://api.paygateway.com/tokenization/cardtokens/{tokenID} |
Content-Type: application/json
Authorization: AuthToken {AuthTokenV2}
X-GP-Request-Id: {request_id}
X-GP-Version: 2021-04-08
X-GP-Api-Key: {API Key}
X-GP-Source-App-Version: {Version of integrating application}
X-GP-Source-App-Name: {Name of integrating application}
{
"card": {
"expiry_month": "03",
"expiry_year": "35"
}
}{
"transaction_id": "000000002271",
"status": "Approved",
"card": {
"masked_card_number": "401288XXXXXX1881",
"expiry_month": "03",
"expiry_year": "35",
"token": "znlsQzJW20",
"type": "Visa"
},
"payment": {
"type": "Credit"
}
}Retrieve the card details associated with a token. Card details are returned masked.
Please note, to retrieve ACH details associated with a token, use the checktokens endpoints:
Important: For authentication, you must include the required headers in each request. For more information, please refer to Authenticating Your Requests.
| Environment | HTTP Method | URL |
|---|---|---|
| Sandbox | GET | https://api.pit.paygateway.com/tokenization/cardtokens/{tokenID} |
| Production | GET | https://api.paygateway.com/tokenization/cardtokens/{tokenID} |
GET /tokenization/cardtokens/znlsQzJW20{
"transaction_id": "000000002273",
"status": "Approved",
"card": {
"masked_card_number": "401288XXXXXX1881",
"expiry_month": "03",
"expiry_year": "35",
"type": "Visa"
},
"payment": {
"type": "Credit"
}
}Delete a token and the card details associated with it from the vault.
Please note, to delete a token and the ACH details associated with it use the checktokens endpoints:
Important: For authentication, you must include the required headers in each request. For more information, please refer to Authenticating Your Requests.
| Environment | HTTP Method | URL |
|---|---|---|
| Sandbox | DELETE | https://api.pit.paygateway.com/tokenization/cardtokens/{tokenID} |
| Production | DELETE | https://api.paygateway.com/tokenization/cardtokens/{tokenID} |
DELETE /tokenization/cardtokens/znlsQzJW20{
"transaction_id": "000000002274",
"status": "Approved"
}We highly recommend processing an Authorization or Sale using a card before storing it. Another option is to perform a Verification (a zero amount Authorization). This allows you to check that the card data provided is valid. For more information, refer to the API Reference.
Important: For authentication, you must include the required headers in each request. For more information, please refer to Authenticating Your Requests.
| Environment | HTTP Method | URL |
|---|---|---|
| Sandbox | POST | https://api.pit.paygateway.com/tokenization/cardtokens |
| Production | POST | https://api.paygateway.com/tokenization/cardtokens |
Content-Type: application/json
Authorization: AuthToken {AuthTokenV2}
X-GP-Request-Id: {request_id}
X-GP-Version: 2021-04-08
X-GP-Api-Key: {API Key}
X-GP-Source-App-Version: {Version of integrating application}
X-GP-Source-App-Name: {Name of integrating application}
{
"card": {
"card_number": "4012888888881881",
"expiry_month": "03",
"expiry_year": "35"
}
}{
"transaction_id": "000000002271",
"status": "Approved",
"card": {
"masked_card_number": "401288XXXXXX1881",
"expiry_month": "03",
"expiry_year": "35",
"token": "znlsQzJW20",
"type": "Visa"
},
"payment": {
"type": "Credit"
}
}