3.27. /api/v4/tokenize/create-ephemeral-ticket
Introduction
Ephemeral ticket creation is initiated through HTTPS POST request by using URLs and the headers specified below. The request is signed with OAuth 1.0a — for example OAuth RSA-SHA256, as in the examples on this page; other signature methods are supported as well, see Request Authentication Methods.
The ticket is used by the card fields of Hosted Fields: the Connecting Party server requests it and embeds it into the payment page. Tokenization must be enabled on the Endpoint, and the Endpoint must belong to the login the request is signed with.
API URLs
Note
Integration |
Production |
|---|---|
https://sandbox.payneteasy.eu/paynet/api/v4/tokenize/create-ephemeral-ticket/ENDPOINTID |
https://gate.payneteasy.eu/paynet/api/v4/tokenize/create-ephemeral-ticket/ENDPOINTID |
Request Headers
Header |
Description |
|---|---|
Authorization |
OAuth 1.0a signature of the request, see Authorization headers. oauth_consumer_key is the Connecting Party’s login. |
Content-Length |
0 — the request has no body. |
Request Parameters
Response Parameters
Note
Parameter name |
Description |
Format |
|---|---|---|
ephemeralTicket |
Single-use ticket passed to the Hosted Fields SDK on the payment page. Issued for the Endpoint from the URL, valid for 15 minutes and consumed by a single tokenization. |
Type: String |
error-id |
Only in a 401 response. Identifier of the error, to be quoted to support. |
Type: String |
message |
Only in a 401 response. The reason the request was rejected. |
Type: String |
A 401 means the request failed the signature check or authentication. Most common: the server clock is outside the oauth_timestamp window (10 minutes by default), oauth_nonce is reused, the Endpoint does not belong to the login from oauth_consumer_key, or a wrong signing key is configured on the Endpoint.
Request Example
POST /paynet/api/v4/tokenize/create-ephemeral-ticket/ENDPOINTID HTTP/1.1
Host: sandbox.payneteasy.eu
Authorization: OAuth oauth_consumer_key="MERCHANTLOGIN",
oauth_signature_method="RSA-SHA256",
oauth_timestamp="...", oauth_nonce="...", oauth_version="1.0",
oauth_signature="..."
Content-Length: 0
Success Response Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"ephemeralTicket": "eyJhbGciOi..."
}
Fail Response Example
HTTP/1.1 401 Unauthorized
error-id=6f1f0b0e-1c2a-4c1e-9a3e-2f7d5b8c9a10
&message=Wrong+token