DOCS
API reference

Terminal Sessions

Payments API operations for Terminal Sessions.

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.

POST /v1/terminalSessions

Initiates a terminal session for the payer to complete a payment.

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: PostTerminalSessionRequest.

PostTerminalSessionRequest

Field Type Required Description
terminalId integer The unique identifier for the terminal.
payer string yes The name of the payer. This is not necessarily the same name as the card or bank account holder name.
userId string The user Id from the application that represents the user that owns this payment method.
emailAddress string The email address of the user.
customerId string The customer identifier for the entity making the payment.
orderId string The unique order identifier for this transaction.
metadata object A <string, string> dictionary of any application-specific metadata to have stored with the payment record.
billingAddress Address
shippingAddress Address
amount number yes The total amount being paid. This is inclusive of the payer fee, if any.
payerFee number yes The amount the payer is being charged to initiate this transaction. This should only be a non-zero amount when you are charging the payer a fee (e.g. a convenience fee or surcharge).
platformFee number The amount the platform is charging the account for this transaction. If left null, the fee will be calculated automatically based on the fee settings on the account. This is only used as an override to that calculation. Only the platform can set this fee.
shippingAmount number The amount charged for shipping, if any.
taxAmount number The amount charged for tax, if any.
lineItems array of TransactionLineItem Line items needed for Level 2/3 qualification.
paidCustomers array of TransactionPaidCustomer The list of customers tied to this transaction.
paidInvoices array of TransactionPaidInvoice The list of paid invoices on this transaction.
currency Currency
comments string Additional comments entered in by the payer.

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.

TransactionLineItem

Field Type Required Description
productCode string The code for the product.
productDescription string The description for the product.
unitPrice number The price per unit.
quantity integer The number of units sold.
taxAmount number The total tax amount for this one line item.
discountAmount number The total discount amount for this one line item.
unitOfMeasure string The unit of measure.
commodityCode string The commodity code for this product as defined by https://www.unspsc.org/.

TransactionPaidCustomer

Field Type Required Description
id string yes The unique identifier for the customer.
name string yes The name of the customer.
amount number yes The amount paid for this customer.
metadata object A <string, string> dictionary of any application-specific metadata to have stored with the customer.

TransactionPaidInvoice

Field Type Required Description
id string yes The unique identifier for the invoice.
customerId string The name of the customer.
amount number yes The amount paid for this invoice.
metadata object A <string, string> dictionary of any application-specific metadata to have stored with the invoice.

Currency values: USD, CAD, EUR, AUD, GBP, NZD, DKK, NOK, SEK, CHF. Responses:

Status Description Schema
201 The response represents the newly created request to the terminal with an identifier to the new terminal session. Any error, if any, will be in the error message property.
400 The payment was not created successfully. Error messages can be found in the body of the response. ValidationProblemDetails
403 The account is not active (problem details with the localized message), or the credential lacks the permission (empty body). ValidationProblemDetails

POST /v1/terminalSessions/{id}/cancel

Cancels the terminal session.

Parameter In Required Description
id path yes The unique identifier for the session.
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
202 The session has been cancelled successfully.
400 The payment was not created successfully. Error messages can be found in the body of the response. ValidationProblemDetails

GET /v1/terminalSessions/{id}

Gets detailed information on a single terminal session.

Parameter In Required Description
id path yes The unique identifier of the terminal session.
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 terminal session was found and the details are in the response body. All account numbers will be masked. GetTerminalSessionResponse
404 The terminal session could not be found.