# Transactions

## GET /v1/gift-cards/transactions/{uid}

> Returns a specific transaction

```json
{"openapi":"3.0.0","info":{"title":"Gormic Gift Cards API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"GetTransactionApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/GetTransaction_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"GetTransaction_Data":{"type":"object","properties":{"transaction":{"$ref":"#/components/schemas/GetTransaction_Data_Transaction"}},"required":["transaction"]},"GetTransaction_Data_Transaction":{"type":"object","properties":{"type":{"type":"string","enum":["payment","refund","topup","transfer"]},"status":{"type":"string","enum":["applied","pending","reversed"]},"time":{"type":"string"},"amount":{"type":"number"},"description":{"type":"string"},"reversed":{"type":"boolean"},"reference":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"uid":{"type":"string"},"accountUid":{"type":"string"},"transferToAccountUid":{"type":"string"}},"required":["type","status","time","amount","uid","accountUid"]},"GetTransactionApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/GetTransaction_Error"}},"required":["error"]},"GetTransaction_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/GetTransaction_ErrorCodes_enum"}]}},"required":["code"]},"GetTransaction_ErrorCodes_enum":{"type":"string","enum":["COMPACT_INACTIVE","MISSING_ID","NO_CREATE_ACTION","NotFound"]}}},"paths":{"/v1/gift-cards/transactions/{uid}":{"get":{"operationId":"Transactions_get","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTransactionApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTransactionApiError"}}}}},"summary":"Returns a specific transaction","tags":["Transactions"]}}}}
```

## POST /v1/gift-cards/transactions/{uid}/send-otp

> Sends a verification SMS to customer with OTP to authorize a specific transaction. OTP is used later with applyWithOTP.

```json
{"openapi":"3.0.0","info":{"title":"Gormic Gift Cards API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"SendTransactionOTPApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/SendTransactionOTP_Params"}},"required":["params"]},"SendTransactionOTP_Params":{"type":"object","properties":{"lang":{"type":"string"}},"required":["lang"]},"SendTransactionOTPApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/SendTransactionOTP_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"SendTransactionOTP_Data":{"type":"object","properties":{"token":{"type":"string"},"customer":{"$ref":"#/components/schemas/SendTransactionOTP_Data_Customer"}},"required":["token","customer"]},"SendTransactionOTP_Data_Customer":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"cityId":{"type":"string"},"birthDate":{"type":"string"},"gender":{"type":"string","enum":["F","M"]},"passcode":{"type":"string"},"sequence":{"type":"number"},"number":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"id":{"type":"string"},"roleAssignments":{"type":"array","items":{"$ref":"#/components/schemas/RoleAssignmentMapSummary"}}},"required":["firstName","lastName","phone","sequence","number","id","roleAssignments"]},"RoleAssignmentMapSummary":{"type":"object","properties":{"endDate":{"type":"string"},"id":{"type":"string"}},"required":["endDate","id"]},"SendTransactionOTPApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/SendTransactionOTP_Error"}},"required":["error"]},"SendTransactionOTP_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/SendTransactionOTP_ErrorCodes_enum"}]}},"required":["code"]},"SendTransactionOTP_ErrorCodes_enum":{"type":"string","enum":["ALREADY_APPLIED","INVALID_STATUS","PHONE_NOT_DEFINED"]}}},"paths":{"/v1/gift-cards/transactions/{uid}/send-otp":{"post":{"operationId":"Transactions_sendOtp","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTransactionOTPApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTransactionOTPApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTransactionOTPApiError"}}}}},"summary":"Sends a verification SMS to customer with OTP to authorize a specific transaction. OTP is used later with applyWithOTP.","tags":["Transactions"]}}}}
```

## PATCH /v1/gift-cards/transactions/apply-with-otp

> Applies a specific voucher transaction using a token and OTP.

```json
{"openapi":"3.0.0","info":{"title":"Gormic Gift Cards API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"ApplyTransactionWithOTPApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/ApplyTransactionWithOTP_Params"}},"required":["params"]},"ApplyTransactionWithOTP_Params":{"type":"object","properties":{"token":{"type":"string"},"otp":{"type":"string"}},"required":["token","otp"]},"ApplyTransactionWithOTPApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/ApplyTransactionWithOTP_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"ApplyTransactionWithOTP_Data":{"type":"object","properties":{"succeed":{"type":"boolean"}},"required":["succeed"]},"ApplyTransactionWithOTPApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ApplyTransactionWithOTP_Error"}},"required":["error"]},"ApplyTransactionWithOTP_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ApplyTransactionWithOTP_ErrorCodes_enum"}]}},"required":["code"]},"ApplyTransactionWithOTP_ErrorCodes_enum":{"type":"string","enum":["ATTEMPTS_EXCEEDED","INVALID_OTP","INVALID_TOKEN","TOKEN_EXPIRED"]}}},"paths":{"/v1/gift-cards/transactions/apply-with-otp":{"patch":{"operationId":"Transactions_applyWithOtp","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyTransactionWithOTPApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyTransactionWithOTPApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyTransactionWithOTPApiError"}}}}},"summary":"Applies a specific voucher transaction using a token and OTP.","tags":["Transactions"]}}}}
```
