Tokenize

Tokenizes a physically present card on a terminal. The device prompts the customer to insert their card, captures it securely, and returns a token representing the card for future use.

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer YOUR_ACCESS_TOKEN
Content-TypeYesapplication/json

Request Parameters

Path Parameters:

ParameterTypeRequiredDescription
location_idintegerYesLocation operating the terminal.

Request Body Fields:

FieldTypeRequiredDescription
ticketobjectYesThe ticket context. See ticket object below.
paymentobjectYesPayment context. See payment object below.
user_id_externalstringNoIdentifies the guest user. This ID represents the owner of the associated credit card token.
webhook_idstringYesUnique identifier for the webhook.
terminal_idstringYesUnique identifier for the POS terminal.

Object Fields

ticket object

FieldTypeRequiredDescription
idstringYesThe unique identifier of the ticket.
namestringNoThe name of the ticket.
openbooleanNoIndicates whether the ticket is still open.
opened_attimestampNoThe timestamp when the ticket was opened.
closed_attimestampNoThe timestamp when the ticket was closed.
ticket_numberintegerNoThe ticket number.

payment object

FieldTypeRequiredDescription
idstringYesUnique identifier for the payment.
amountintegerYesFor tokenization, the amount is automatically set to 0.

Request Example

{
  "ticket": { "void": false, "id": 21 },
  "payment": { "id": "19", "amount": 0 },
  "user_id_external": 2476,
  "webhook_id": "7614fc1bd4saf6",
  "terminal_id": 110
}

cURL Example

curl --request POST \
  --url https://sandbox-api.softpoint.io/interface/v1/locations/4004699/webhook/tokenize \
  --header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "ticket": { "void": false, "id": 21 },
    "payment": { "id": "19", "amount": 0 },
    "user_id_external": 2476,
    "webhook_id": "7614fc1bd4saf6",
    "terminal_id": 110
  }'

Success Response

{
  "response": "APPROVED",
  "data": {
    "id": 0,
    "id_external": "7526183624636356904606",
    "order_id_external": "19",
    "amount": 0,
    "transaction_id": "7526183624636356904606",
    "reference_id": "8c9c10f884824e2489227a3004015a13",
    "auth_code": "831000",
    "card_type": "MC",
    "last4": "0045",
    "entry_type": "Chip",
    "result_message": "APPROVED",
    "status": 1
  }
}

Response Fields

FieldTypeDescription
responsestringAPPROVED or DECLINE.
data.id_externalstringThe token / external transaction reference for the captured card.
data.transaction_idstringProcessor transaction identifier.
data.reference_idstringReference for reconciliation.
data.auth_codestringAuthorization code.
data.card_typestringCard brand (for example, MC, VISA, AMEX).
data.last4stringLast four digits of the card.
data.entry_typestringHow the card was read (for example, Chip).
data.emv_tagsstringJSON-encoded EMV tag data, when present.
data.statusintegerProcessor status flag.

Error Responses

Unauthorized / Invalid Token

{
  "error": {
    "code": 10759,
    "message": "Operation timed out. Please try again.",
    "details": { "Exception": "Token could not be parsed from the request." }
  }
}

Status Codes

CodeDescription
200Tokenization completed (check the response field for APPROVED/DECLINE)
401Token missing or invalid

Workflow Placement

Used to store a card on file during a terminal interaction, ahead of future charges.

Notes

  • Set payment.amount to 0 to tokenize without charging.

  • Always inspect the body's response field; an HTTP 200 can still carry DECLINE.

  • webhook_id should be unique per attempt for correlation.

Common Mistakes

  • Targeting a terminal that is offline or unknown.

  • Ignoring the response field and assuming 200 means approved.

Body Params
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
text/plain