DOCS
API reference

Tokens

Payments API operations for Tokens.

Payments API

These operations are generated from the Payments API Swagger document. Use the sandbox host https://api.dhangodemo.com while testing and https://api.dhango.com in production.

GET /v1/tokens/{id}

Gets the masked details of a saved payment token.

Parameter In Required Description
id path yes The unique identifier of the token.
accountKey header Used to make API calls on behalf of another account.
culture header The culture to be used when setting the language for error messages.

Responses:

Status Description Schema
200 The token was found and the details are in the response body. All account numbers will be masked. GetTokenResponse
404 The token could not be found.

DELETE /v1/tokens/{id}

Deletes a saved payment method. This will not impact any transactions that are already in process with this token.

Parameter In Required Description
id path yes The unique identifier of the token.
accountKey header Used to make API calls on behalf of another account.
culture header The culture to be used when setting the language for error messages.

Responses:

Status Description Schema
200 The token was deleted successfully.
404 The token could not be found.

POST /v1/tokens

Saves a payment method as a token for later use.

Parameter In Required Description
accountKey header Used to make API calls on behalf of another account.
culture header The culture to be used when setting the language for error messages.

Request body: PostTokenRequest.

PostTokenRequest

Field Type Required Description
userId string The user Id from the application that represents the user that owns this payment method. This is required for network tokenization.
emailAddress string The email address of the owner of this payment method. This is required to enable network tokenization.
ach Ach
acss Acss
auDirectDebit AuDirectDebit
bacs Bacs
card Card
nzDirectDebit NzDirectDebit
sepa Sepa
metadata object A <string, string> dictionary of any application-specific metadata to have stored with the token record.
address Address
validateAccount boolean True if the account validation should be run immediately before tokenization. Otherwise, this is false. This is currently only supported on ACH payments methods.

Ach

Field Type Required Description
bankAccountHolder string yes The name of the bank account holder.
routingNumber string yes The 9 digit routing number.
bankAccountType BankAccountType
accountNumber string yes The full account number.

BankAccountType values: PersonalSavings, PersonalChecking, CorporateSavings, CorporateChecking.

Acss

Field Type Required Description
accountHolder string yes The name of the account holder.
bankAccountType BankAccountType
institutionNumber string yes The 3 digit institution number.
transitNumber string yes The 5 digit transit number.
accountNumber string yes The full account number.

AuDirectDebit

Field Type Required Description
bankAccountHolder string yes The name of the account holder.
bsb string yes The BSB
accountNumber string yes The full account number.

Bacs

Field Type Required Description
bankAccountHolder string yes The name of the account holder.
sortCode string yes The sort code.
accountNumber string yes The full account number.

Card

Field Type Required Description
cardHolder string yes The name of the card holder.
cardNumber string yes The card number.
cardBrand CardBrand
expirationMonth integer yes The expiration month.
expirationYear integer yes The two or four digit expiration year.
securityCode string The CVV/security code for the card.

CardBrand values: Visa, Mastercard, AmericanExpress, Discover, DinersClub.

NzDirectDebit

Field Type Required Description
bankAccountHolder string yes The name of the bank account holder.
bankCode string yes The bank code.
branchCode string yes The branch code.
suffix string yes The suffix.
accountNumber string yes The full account number.

Sepa

Field Type Required Description
accountHolder string yes The name of the account holder.
iban string yes The IBAN number for the account.

Address

Field Type Required Description
name string The name at the address
streetAddress string The street address including the street and unit number.
city string The city of the address.
stateOrProvince string The abbreviated state or province of the address.
postalCode string The postal code of the address.
country string The two character country code.
phoneNumber string The phone number.

Responses:

Status Description Schema
201 The token was created successfully. The Id for the new token is in the body of the response. GetTokenResponse
400 The token was not created successfully. Error messages can be found in the body of the response. ValidationProblemDetails