Use this page to pick the right request for a card charge. Every request goes to PUT /transactions?entityUuid=<merchant entity uuid>. Amounts are in cents.
Every request also needs the billing fields and expirationDate, even when it uses a cardToken.
Quick reference
| Request | Use it when | Card data sent |
|---|---|---|
| A | The customer is present and paying now, with a new card | pan and cvv |
| B | Charging a saved card for the same arrangement as its first charge | cardToken |
| C | Charging a saved card for a different arrangement you already set up | cardToken and externalCredentialReference |
| D | First charge for a new arrangement on a saved card | cardToken, originalNetworkTransactionId, and externalCredentialReference |
| E1 | New Visa or American Express card from another processor | pan, cvv, and originalNetworkTransactionId |
| E2 | New Mastercard from another processor | Same as E1, plus optional originalTransactionLinkId |
| E3 | New Discover, Diners Club, or JCB card from another processor | Same as E1, plus originalAuthorizedAmount |
Terms
- Scheme transaction id (also called the network transaction ID): the ID that the card network (Visa, Mastercard, and so on) assigned to an approved charge. It is not the same as a
cardToken. - Arrangement: one subscription, membership, or agreement with the customer.
cardToken: the token VMS returns when you save a card. Use it instead of the card number.externalCredentialReference: a name you choose for an arrangement, such assub-1042.- 400 error: a bad request. The response tells you which field is missing or wrong.
The flow
-
Is the customer present and paying right now, such as at checkout?
- Yes: send Request A. Done.
- No: go to question 2.
-
Have you already charged this card through VMS, so you have its
cardToken?- Yes: go to question 3.
- No: this is a card you are bringing from another processor. Go to question 2b.
2b. What brand is the card?
- Visa or American Express: send Request E1. Done.
- Mastercard: send Request E2. Done.
- Discover, Diners Club, or JCB: send Request E3. Done.
-
Is this charge for the same arrangement as the first charge you ran on VMS with this card?
An arrangement is one subscription, membership, or agreement with the customer. The first charge the customer made in person started the card's main arrangement. If the card has only one arrangement, answer Yes.- Yes: send Request B. Done.
- No (a different arrangement on the same card): go to question 4.
-
Have you already charged this arrangement before, using a name for it?
The name is anexternalCredentialReferenceyou choose, such assub-1042. Reusing the same name tells VMS which arrangement you mean.- Yes: send Request C, with the same name. Done.
- No (first charge for this arrangement): send Request D. Pick the name, and send the scheme transaction id from the card's first charge. Done.
Example: A customer has a gym membership and a magazine subscription on one card. The gym membership's first charge was made in person, so its later charges use Request B. The magazine is a different arrangement. Its first charge uses Request D with externalCredentialReference: "magazine". Every charge after that uses Request C with the same name.
Extra fields for Discover, Diners Club, and JCB cards
- Request D: also add
"originalAuthorizedAmount": <cents>.0is allowed. Without it, the request returns a 400 error. - Request B returns "needs the scheme id stored for this card": this card has no stored scheme transaction id. Add
"originalNetworkTransactionId": "<scheme transaction id>"to Request B and send it again. On a Discover, Diners Club, or JCB card, also addoriginalAuthorizedAmount.
The requests
All card numbers and CVVs below are test values. Replace them with real card details in production.
Request A: customer is present, new card
{
"method": "CRD",
"type": "Debit",
"amount": 1234,
"crdAction": "auth_capture",
"paymentDetails": {
"name": "Visa Test",
"accountType": "Card",
"pan": "4012000098765439",
"expirationDate": "1228",
"cvv": "999",
"billingAddress": "1 Main St",
"billingPostalCode": "85284",
"billingCity": "Phoenix",
"billingState": "AZ"
}
}Save the cardToken from the response. To charge this card later, use Request B.
Request B: charge a saved card, same arrangement as the first charge
{
"method": "CRD",
"type": "Debit",
"amount": 2345,
"crdAction": "auth_capture",
"merchantInitiated": true,
"paymentDetails": {
"name": "Visa Test",
"accountType": "Card",
"cardToken": "<cardToken>",
"expirationDate": "1228",
"billingAddress": "1 Main St",
"billingPostalCode": "85284",
"billingCity": "Phoenix",
"billingState": "AZ"
}
}Request C: charge a different arrangement you already set up
{
"method": "CRD",
"type": "Debit",
"amount": 4567,
"crdAction": "auth_capture",
"merchantInitiated": true,
"externalCredentialReference": "sub-1042",
"paymentDetails": {
"name": "Visa Test",
"accountType": "Card",
"cardToken": "<cardToken>",
"expirationDate": "1228",
"billingAddress": "1 Main St",
"billingPostalCode": "85284",
"billingCity": "Phoenix",
"billingState": "AZ"
}
}Request D: first charge of a different arrangement on the same card
{
"method": "CRD",
"type": "Debit",
"amount": 3456,
"crdAction": "auth_capture",
"merchantInitiated": true,
"originalNetworkTransactionId": "<scheme transaction id from the card's first charge>",
"externalCredentialReference": "sub-1042",
"paymentDetails": {
"name": "Visa Test",
"accountType": "Card",
"cardToken": "<cardToken>",
"expirationDate": "1228",
"billingAddress": "1 Main St",
"billingPostalCode": "85284",
"billingCity": "Phoenix",
"billingState": "AZ"
}
}Use a real scheme transaction id. A made-up one is declined. After this works, use Request C for later charges of this arrangement. On a Discover, Diners Club, or JCB card, also add originalAuthorizedAmount.
Request E1: new Visa or American Express card from another processor
{
"method": "CRD",
"type": "Debit",
"amount": 4567,
"crdAction": "auth_capture",
"merchantInitiated": true,
"originalNetworkTransactionId": "<scheme transaction id from the other processor>",
"paymentDetails": {
"name": "Visa Test",
"accountType": "Card",
"pan": "4012000098765439",
"expirationDate": "1228",
"cvv": "999",
"billingAddress": "1 Main St",
"billingPostalCode": "85284",
"billingCity": "Phoenix",
"billingState": "AZ"
}
}An American Express card sends the same fields, with its own pan and 4-digit cvv. Save the cardToken from the response. Use Request B for every later charge of this card.
Request E2: new Mastercard from another processor
{
"method": "CRD",
"type": "Debit",
"amount": 4567,
"crdAction": "auth_capture",
"merchantInitiated": true,
"originalNetworkTransactionId": "<scheme transaction id from the other processor>",
"paymentDetails": {
"name": "Mastercard Test",
"accountType": "Card",
"pan": "5146315000000055",
"expirationDate": "1228",
"cvv": "998",
"billingAddress": "1 Main St",
"billingPostalCode": "85284",
"billingCity": "Phoenix",
"billingState": "AZ"
}
}originalTransactionLinkId is optional. If you have it, add "originalTransactionLinkId": "<link id>" to the request. If you don't, leave it out and VMS saves the link id that TSYS returns. Save the cardToken from the response. Use Request B for every later charge of this card.
Request E3: new Discover, Diners Club, or JCB card from another processor
{
"method": "CRD",
"type": "Debit",
"amount": 4567,
"crdAction": "auth_capture",
"merchantInitiated": true,
"originalNetworkTransactionId": "<scheme transaction id from the other processor>",
"originalAuthorizedAmount": 2500,
"paymentDetails": {
"name": "Discover Test",
"accountType": "Card",
"pan": "6011000993026909",
"expirationDate": "1228",
"cvv": "996",
"billingAddress": "1 Main St",
"billingPostalCode": "85284",
"billingCity": "Phoenix",
"billingState": "AZ"
}
}originalAuthorizedAmount is required here. It is the amount of the original approval, in cents. Use 0 if the original approval was a $0 verification. Without it, you get a 400 error. Save the cardToken from the response. Use Request B for every later charge of this card.