> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/wallet-enablement/es/referencia-de-api/api-del-tsp-v1/operaciones-salientes-hacia-el-tsp/api-de-transacciones-ecom.md).

# API de transacciones ECOM

[TSP-API-OUT-v1-ECOM-Transaction-oas3.yaml](https://openapi.gitbook.com/o/fwy1mtbRONGA2YDKDBr0/spec/TSP-API-OUT-v1-ECOM-Transaction-oas3.yaml)

## POST /merchant-gateways/{merchantGatewayId}/merchants/{merchantId}/tokens/{tokenId}/transactions

> POST /merchant-gateways/{merchantGatewayId}/merchants/{merchantId}/tokens/{tokenId}/transactions

````json
{"openapi":"3.1.0","info":{"title":"TSP API for eCOM transactions","version":"1.0"},"tags":[{"name":"Create Transaction"}],"servers":[{"url":"https://TSP_PROD_DOMAIN/tsp/ecom/v1.0","description":"Production server"},{"url":"https://TSP_STAGING_DOMAIN/tsp/ecom/v1.0","description":"Staging server"}],"paths":{"/merchant-gateways/{merchantGatewayId}/merchants/{merchantId}/tokens/{tokenId}/transactions":{"post":{"summary":"POST /merchant-gateways/{merchantGatewayId}/merchants/{merchantId}/tokens/{tokenId}/transactions","operationId":"createTransaction","parameters":[{"$ref":"#/components/parameters/merchantGatewayId"},{"$ref":"#/components/parameters/merchantId"},{"$ref":"#/components/parameters/tokenId"}],"tags":["Create Transaction"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/createTransactionReq"}}}},"responses":{"200":{"description":"Transaction Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/createTransactionRes"}}}},"400":{"description":"Error while performing the operation","content":{"application/json":{"schema":{"type":"object","description":"Error Information Response","required":["responseCode"],"properties":{"responseCode":{"type":"number","description":"Error Response code to the request\n|Error code | Description| Retryable|\n|-------|-------|-------|\n|111|Missing mandatory parameter|N|\n|112|Bad parameter format|N|\n|113|Unknown issuer|N|\n|115|Unknown product|N|\n|119|Unknown Token|N|\n|163|Product not supported for mobile payment|N|\n|164|FPAN Digitization Count Exceeded|N|\n|166|Invalid FPAN|N|\n|167|Card already enrolled|N|\n|321|Operation on token already on-going|N|\n|322|Time to live of the operation expired|N|\n|431|Invalid perso data|N|\n|432|Current token state does not allow this operation|N|\n|911|Operation failed|N|\n|921|Unexpected server error|Y|\n"},"errorMessage":{"type":"string","description":"Textual error message"}}}}}},"500":{"$ref":"#/components/responses/500"},"503":{"$ref":"#/components/responses/503"}}}}},"components":{"parameters":{"merchantGatewayId":{"name":"merchantGatewayId","in":"path","required":true,"schema":{"type":"string","description":"Merchant Gateway Identifier.","minLength":10,"maxLength":10}},"merchantId":{"name":"merchantId","in":"path","required":true,"schema":{"type":"string","description":"Merchant Identifier (aka Token Requestor ID) generated by the scheme TSP for that merchant.","minLength":11,"maxLength":11}},"tokenId":{"name":"tokenId","in":"path","required":true,"schema":{"type":"string","maxLength":48,"minLength":1,"description":"Unique Token Identifier"}}},"schemas":{"createTransactionReq":{"type":"object","required":["transactionId","transactionDateTime","amount","currencyCode"],"properties":{"transactionId":{"type":"string","pattern":"^[A-Za-z0-9]{1,12}$"},"transactionDateTime":{"type":"string","pattern":"^[0-9]{14}$","description":"UTC Transaction date in 'YYYYMMDDhhmmss' format."},"amount":{"type":"string","pattern":"^[0-9]{12}$","description":"smallest unit of currency right justified with leading zeros"},"currencyCode":{"type":"string","description":"Currency code as per ISO 4217","pattern":"^[0-9]{3}$"}}},"createTransactionRes":{"type":"object","properties":{"encryptedData":{"type":"string","description":"The payment credentials data encrypted with JWE format (https://datatracker.ietf.org/doc/html/rfc7516) using following encryption parameters:<br/>\n* JWE base64url encoded string\n* \"alg\" (Algorithm) header parameter: ECDH-ES\n* \"enc\" (Encryption Algorithm) header parameter: A256GCM\n* \"kid\" (Key ID) header parameter: Key identifier corresponding to EC public key of the recipient\n* EC curve: P-256\nThe JSON object that is encrypted is defined as follows:\n\n|JSON field parameter name|description|MOC|Length|\n|-------|-------|-------|-------|\n|dpan|The token PAN value|M|Up to 19|\n|exp|The token expiry date in the format MMYY|M|4|\n|cryptogram|The payment cryptogram to use with the token for a payment|M|Up to 256|\n\n**Example**: ```{\"dpan:\"9580981500100002\", \"exp\":\"1222\", \"cryptogram\": \"45f8grzty7f4f5gs5s2c\"}```"}}}},"responses":{"500":{"description":"Internal Server Error - Not retryable"},"503":{"description":"Unavailable - Retryable"}}}}
````


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/wallet-enablement/es/referencia-de-api/api-del-tsp-v1/operaciones-salientes-hacia-el-tsp/api-de-transacciones-ecom.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
