---
title: "$viva->nativeCheckout->createTransaction()"
method: POST
path: "/NativeCheckout/createTransaction"
tags: ["NativeCheckout"]
---

# $viva->nativeCheckout->createTransaction()

`POST /NativeCheckout/createTransaction`

Exécute une transaction à partir d'un token de charge obtenu via `createChargeToken()`.

```php
$txn = $viva->nativeCheckout->createTransaction(
    chargeToken: $token['chargeToken'],
    amount: 1500,
    currencyCode: 978,             // EUR (ISO 4217 numérique)
    sourceCode: '1234',
    merchantTrns: 'ref_123',       // Référence interne
    customerTrns: 'Consultation',  // Affiché au client
    preauth: false,
    tipAmount: 0,
    installments: null,
);

echo $txn['transactionId']; // UUID
echo $txn['statusId'];      // 'F' = finalisée
echo $txn['amount'];        // 1500
echo $txn['orderCode'];     // Code de l'ordre
```

## Request body

- NativeCheckoutTransactionParams
  - `chargeToken` string, required — Token obtenu via `createChargeToken()`
  - `amount` integer, required — Montant en centimes
  - `currencyCode` integer — Code devise ISO 4217 numérique (`978` = EUR)
  - `sourceCode` string, nullable — Code source de paiement
  - `merchantTrns` string, nullable — Référence interne
  - `customerTrns` string, nullable — Description affichée au client
  - `preauth` boolean — Pré-autorisation uniquement ?
  - `tipAmount` integer — Pourboire en centimes
  - `installments` integer, nullable — Nombre de versements (`null` = désactivé)

## Response `200`

Transaction créée

- NativeCheckoutTransactionResult
  - `transactionId` string, uuid — UUID de la transaction
  - `statusId` string — Statut (`'F'` = finalisée)
  - `amount` integer — Montant en centimes
  - `orderCode` integer — Code de l'ordre

---

[API](https://skmtc.net/qrcommunication/apis/viva-wallet-merchant-sdk-re-fe-rence-php.md) · [All operations](https://skmtc.net/qrcommunication/apis/viva-wallet-merchant-sdk-re-fe-rence-php/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/qrcommunication/viva-wallet-merchant-sdk-re-fe-rence-php/versions/bcafd06ce584/schema)
