> For the complete documentation index, see [llms.txt](https://firstoken.gitbook.io/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://firstoken.gitbook.io/api-docs/api-reference/proxy/proxy-jose.md).

# Proxy JOSE

This endpoint allows processing tokenized transactions using the JOSE standard for information security

### Prerequisites

Before using this endpoint, a configuration process must be completed on our side using the RSA keys provided by the client:

* Processor's public key
* Merchant's private key

### Base URL

```url
https://api.firstoken.co/proxy/jose
```

{% hint style="warning" %}
**Note:** In case, you have to make some sandbox tests you must be called from the base URL <https://api.firstoken-staging.co/proxy/jose>
{% endhint %}

{% tabs %}
{% tab title="cUrl" %}

```
curl -X POST --location 'https://api.firstoken.co/proxy/jose' \
--header 'Content-Type: application/json' \
--header 'ft-access-key: <YOUR_API_KEY>' \
--data '{
    "uniqueCode": "010200001",
    "terminalId": "000AAAAA",
    "purchaseAmount": 1200000,
    "ivaTax": 0,
    "currencyCode": "170",
    "cardData": {
        "cardNumber": "{{token:detokenize | extract:card}}",
        "cardExpireMonth": "{{token:detokenize | extract:expiration | date: MM }}",
        "cardExpireYear": "{{token:detokenize | extract:expiration | date: YY }}",
        "cvv": null,
        "brandId": "01",
        "cardAccountTypeId": "00"
    },
    "installmentsNumber": 1,
    "ipAddress": "190.66.124.31",
    "references": [
        {
            "referenceKey": "codReferencia",
            "referenceDescription": "9922"
        },
        {
            "referenceKey": "documentoComprador",
            "referenceDescription": "1111111111111"
        }
    ],
    "iacTax": 0,
    "merchantNameAggregate": null,
    "mcc": null,
    "services": null,
    "cofTransaction": null,
    "recurringTransaction": "R",
    "credentialOnFile": null
}'
```

{% endtab %}

{% tab title="Headers of the request" %}

* **ft-access-key**: string\
  This is the authentication header for the request.\
  Required: true
* **Content-Type:** application/json
  {% endtab %}
  {% endtabs %}

### Important notes

* Token fields use special syntax depending on the token type:&#x20;
  * For Permanent Tokens (using detokenization):
    * Card number: `{{token:detokenize | extract:card}}`
    * Expiration date:
      * Month: `{{token:detokenize | extract:expiration | date: MM }}`
      * Year: `{{token:detokenize | extract:expiration | date: YY }}`
  * For Temporary Tokens (using transaction):
    * Card number: `{{token:transaction | extract:card}}`
    * Expiration date:
      * Month: `{{token:transaction | extract:expiration | date: MM }}`
      * Year: `{{token:transaction | extract:expiration | date: YY }}`

### Security

* Communication is done through HTTPS.
* Authentication is required via the `ft-access-key` header.
* Sensitive information is processed using the JOSE standard.

<details>

<summary>Success Response</summary>

```json
{
    "status": 200,
    "data": {
        "value": "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIiwia2lkIjoibkNSdjVxSUp3Q2wwbkVTLUF2cVpxb3otV21WQzR3SHc3a29Pa3NVQThBcyJ9...[JWT value truncated]...UJ0kp1kwoG2EJSDe10MJjA",
        "encryption": "JWT",
        "signed": true
    }
}
```

* **status**: number\
  HTTP status code (200 for success)
* **data.value**: string\
  Encrypted JWT of the payload received
* **data.encryption**: string\
  Type of encryption used (JWT)
* **data.signed**: boolean\
  Indicates if the response is signed

</details>

<details>

<summary>Error Response</summary>

```json
{
    "status_code": 403,
    "status": "fail",
    "description": "Access Denied",
    "data": ""
}
```

* **status\_code**: number\
  HTTP error status code
* **status**: string\
  Response status ("fail" for errors)
* **description**: string\
  Error description
* **data**: string\
  Additional error data (is an empty string)

</details>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://firstoken.gitbook.io/api-docs/api-reference/proxy/proxy-jose.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
