---
updatedAt: 2026-07-31T14:13:18.000Z
agentTools:
  projectIndex: https://reference.fidel.uk/llms.txt
---

# Create Transaction

This API endpoint only works in the test environment.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "fidel-api",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.fidel.uk/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Fidel-Key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/transactions/test": {
      "post": {
        "summary": "Create Transaction",
        "description": "This API endpoint only works in the test environment.",
        "operationId": "create-transaction-test",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "description": "application/json",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Fidel-Key",
            "in": "header",
            "description": "test API secret key.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount",
                  "cardId",
                  "locationId"
                ],
                "properties": {
                  "amount": {
                    "type": "number",
                    "description": "The amount of the transaction. Refund transactions a represented by negative amounts (ex: -100)",
                    "format": "float"
                  },
                  "cardId": {
                    "type": "string",
                    "description": "Card \"making\" the transaction."
                  },
                  "locationId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "approvalCode": {
                    "value": {
                      "items": [
                        {
                          "accountId": "d1bc1828-f904-48a3-8492-12272c81c117",
                          "amount": 24.15,
                          "auth": true,
                          "cleared": false,
                          "currency": "GBP",
                          "programId": "f1d18446-6447-4aad-a125-22ff525abc79",
                          "wallet": null,
                          "approvalCode": "926232",
                          "updated": "2022-07-21T13:13:48.572Z",
                          "created": "2022-07-21T13:13:48.572Z",
                          "id": "748c4941-4c39-461e-af31-269859f570b9",
                          "datetime": "2022-07-21T14:13:48",
                          "descriptor": {
                            "merchantName": "Merchant name",
                            "storeName": "Store name"
                          },
                          "card": {
                            "id": "f26f54ef-8c36-4e8e-8cbd-5bdf7158fe65",
                            "lastNumbers": "0301"
                          },
                          "location": {
                            "address": "53 Frith Street",
                            "city": "London",
                            "countryCode": "GBR",
                            "id": "6ceb1dfd-b36b-402b-9c88-0308b8b2156c",
                            "geolocation": null,
                            "postcode": "W1D4SN",
                            "state": null,
                            "timezone": "Europe/London",
                            "metadata": null
                          },
                          "brand": {
                            "id": "a33ebe89-df68-4ad4-819d-53b20caf2e4e",
                            "name": "Simple Coffee",
                            "logoURL": null,
                            "metadata": null
                          },
                          "identifiers": {
                            "mastercardAuthCode": null,
                            "mastercardRefNumber": null,
                            "mastercardTransactionSequenceNumber": null,
                            "MID": "TEST_MID_898afdeb-3f4e-4c73-8617-bbe82339a3c5",
                            "visaAuthCode": null
                          },
                          "cardPresent": false
                        }
                      ],
                      "resource": "/v1/transactions/test",
                      "status": 201,
                      "execution": 542.304803
                    }
                  },
                  "authCode": {
                    "value": {
                      "items": [
                        {
                          "accountId": "d1bc1828-f904-48a3-8492-12272c81c117",
                          "amount": 24.15,
                          "auth": true,
                          "cleared": false,
                          "currency": "GBP",
                          "programId": "f1d18446-6447-4aad-a125-22ff525abc79",
                          "wallet": null,
                          "authCode": "016200",
                          "updated": "2022-07-21T13:06:37.488Z",
                          "created": "2022-07-21T13:06:37.488Z",
                          "id": "195f6388-66d2-4216-9f86-ce73c1b82783",
                          "datetime": "2022-07-21T14:06:37",
                          "descriptor": {
                            "merchantName": "Merchant name",
                            "storeName": "Store name"
                          },
                          "card": {
                            "id": "f26f54ef-8c36-4e8e-8cbd-5bdf7158fe65",
                            "lastNumbers": "4002"
                          },
                          "location": {
                            "address": "53 Frith Street",
                            "city": "London",
                            "countryCode": "GBR",
                            "id": "6ceb1dfd-b36b-402b-9c88-0308b8b2156c",
                            "geolocation": null,
                            "postcode": "W1D4SN",
                            "state": null,
                            "timezone": "Europe/London",
                            "metadata": null
                          },
                          "brand": {
                            "id": "a33ebe89-df68-4ad4-819d-53b20caf2e4e",
                            "name": "Test Brand",
                            "logoURL": null,
                            "metadata": null
                          },
                          "identifiers": {
                            "mastercardAuthCode": null,
                            "mastercardRefNumber": null,
                            "mastercardTransactionSequenceNumber": null,
                            "MID": "TEST_MID_898afdeb-3f4e-4c73-8617-bbe82339a3c5",
                            "visaAuthCode": "016200"
                          },
                          "reimbursementEligible": false,
                          "cardPresent": false
                        }
                      ],
                      "resource": "/v1/transactions/test",
                      "status": 201,
                      "execution": 230.976337
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "accountId": {
                            "type": "string",
                            "example": "d1bc1828-f904-48a3-8492-12272c81c117"
                          },
                          "amount": {
                            "type": "number",
                            "example": 24.15,
                            "default": 0
                          },
                          "auth": {
                            "type": "boolean",
                            "example": true,
                            "default": true
                          },
                          "cleared": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          },
                          "currency": {
                            "type": "string",
                            "example": "GBP"
                          },
                          "programId": {
                            "type": "string",
                            "example": "f1d18446-6447-4aad-a125-22ff525abc79"
                          },
                          "wallet": {},
                          "approvalCode": {
                            "type": "string",
                            "example": "926232"
                          },
                          "updated": {
                            "type": "string",
                            "example": "2022-07-21T13:13:48.572Z"
                          },
                          "created": {
                            "type": "string",
                            "example": "2022-07-21T13:13:48.572Z"
                          },
                          "id": {
                            "type": "string",
                            "example": "748c4941-4c39-461e-af31-269859f570b9"
                          },
                          "datetime": {
                            "type": "string",
                            "example": "2022-07-21T14:13:48"
                          },
                          "descriptor": {
                            "type": "object",
                            "properties": {
                              "merchantName": {
                                "type": "string",
                                "example": "Merchant name"
                              },
                              "storeName": {
                                "type": "string",
                                "example": "Store name"
                              }
                            }
                          },
                          "card": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "f26f54ef-8c36-4e8e-8cbd-5bdf7158fe65"
                              },
                              "lastNumbers": {
                                "type": "string",
                                "example": "0301"
                              }
                            }
                          },
                          "location": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string",
                                "example": "53 Frith Street"
                              },
                              "city": {
                                "type": "string",
                                "example": "London"
                              },
                              "countryCode": {
                                "type": "string",
                                "example": "GBR"
                              },
                              "id": {
                                "type": "string",
                                "example": "6ceb1dfd-b36b-402b-9c88-0308b8b2156c"
                              },
                              "geolocation": {},
                              "postcode": {
                                "type": "string",
                                "example": "W1D4SN"
                              },
                              "state": {},
                              "timezone": {
                                "type": "string",
                                "example": "Europe/London"
                              },
                              "metadata": {}
                            }
                          },
                          "brand": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "example": "a33ebe89-df68-4ad4-819d-53b20caf2e4e"
                              },
                              "name": {
                                "type": "string",
                                "example": "Simple Coffee"
                              },
                              "logoURL": {},
                              "metadata": {}
                            }
                          },
                          "identifiers": {
                            "type": "object",
                            "properties": {
                              "mastercardAuthCode": {},
                              "mastercardRefNumber": {},
                              "mastercardTransactionSequenceNumber": {},
                              "MID": {
                                "type": "string",
                                "example": "TEST_MID_898afdeb-3f4e-4c73-8617-bbe82339a3c5"
                              },
                              "visaAuthCode": {}
                            }
                          },
                          "cardPresent": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          }
                        }
                      }
                    },
                    "resource": {
                      "type": "string",
                      "example": "/v1/transactions/test"
                    },
                    "status": {
                      "type": "integer",
                      "example": 201,
                      "default": 0
                    },
                    "execution": {
                      "type": "number",
                      "example": 542.304803,
                      "default": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"resource\": \"/v1/transactions/test\",\n\t\"status\": 400,\n\t\"error\": {\n\t\t\"code\": \"schema\",\n\t\t\"date\": \"2020-08-28T06:32:28.759Z\",\n\t\t\"message\": \"Invalid schema\",\n\t\t\"metadata\": [\n\t\t\t{\n\t\t\t\t\"keyword\": \"format\",\n\t\t\t\t\"dataPath\": \".cardId\",\n\t\t\t\t\"schemaPath\": \"#/properties/cardId/format\",\n\t\t\t\t\"params\": {\n\t\t\t\t\t\"format\": \"uuid\"\n\t\t\t\t},\n\t\t\t\t\"message\": \"should match format \\\"uuid\\\"\"\n\t\t\t}\n\t\t]\n\t},\n\t\"execution\": 11.287433\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "resource": {
                      "type": "string",
                      "example": "/v1/transactions/test"
                    },
                    "status": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "example": "schema"
                        },
                        "date": {
                          "type": "string",
                          "example": "2020-08-28T06:32:28.759Z"
                        },
                        "message": {
                          "type": "string",
                          "example": "Invalid schema"
                        },
                        "metadata": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "keyword": {
                                "type": "string",
                                "example": "format"
                              },
                              "dataPath": {
                                "type": "string",
                                "example": ".cardId"
                              },
                              "schemaPath": {
                                "type": "string",
                                "example": "#/properties/cardId/format"
                              },
                              "params": {
                                "type": "object",
                                "properties": {
                                  "format": {
                                    "type": "string",
                                    "example": "uuid"
                                  }
                                }
                              },
                              "message": {
                                "type": "string",
                                "example": "should match format \"uuid\""
                              }
                            }
                          }
                        }
                      }
                    },
                    "execution": {
                      "type": "number",
                      "example": 11.287433,
                      "default": 0
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X POST \\\n  https://api.fidel.uk/v1/transactions/test \\\n  -H 'content-type: application/json' \\\n  -H 'fidel-key: sk_test_50ea90b6-2a3b-4a56-814d-1bc592ba4d63' \\\n  -d '{\n    \"amount\": 24.15,\n    \"cardId\": \"f26f54ef-8c36-4e8e-8cbd-5bdf7158fe65\",\n    \"locationId\": \"6ceb1dfd-b36b-402b-9c88-0308b8b2156c\"\n  }'",
              "name": "cURL"
            }
          ],
          "samples-languages": [
            "curl"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```