---
title: Order a one time or a recurrence prepaid card
slug: reference/order-a-one-time-or-a-recurrence-prepaid-card
createdAt: 2024-09-30T17:03:00.667Z
---

{
  "id": "zMHumrobGKBRz3t0fsqlo",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/customer-portal/prepaid-wallet",
    "servers": [
      {
        "url": "https://app.amberflo.io/customer-portal/prepaid-wallet"
      }
    ],
    "name": "Order a one time or a recurrence prepaid card",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "sessionToken",
          "type": "string",
          "description": "<p>A required session token used to authenticate API calls made on behalf of a customer. This token is obtained from the <code>Create a session</code> endpoint and must be included with every request to authorize access.</p>"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "pricing-amberflo-customer-prepaid-request",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "string",
              "description": "Id of the new prepaid order.",
              "example": ""
            },
            {
              "name": "prepaidOfferVersion",
              "kind": "optional",
              "type": "integer",
              "description": "Can be -1 or the account level prepaid offer 'lastUpdateTimeInMillis' attribute value. The 'lastUpdateTimeInMillis' came to guarantee that the prepaid purchased by the customer has the exact same worth and expiration value as communicated to the customer prior to the actual transaction. If this field is set to -1 than there is no such guarantee, so if the account's prepaid offer was changed between the point the prepaid terms were communicated to the customer and the point of the actual purchase, then the server will use the new prepaid offer to calculate the worth of the prepaid and the expiration date (which might be different than what was communicated to the customer).",
              "example": 0
            },
            {
              "name": "prepaidPrice",
              "kind": "optional",
              "type": "number",
              "description": "the amount of prepaid money to order - this value should be in credit units if the account is using credit units.",
              "example": ""
            },
            {
              "name": "productId",
              "kind": "optional",
              "type": "string",
              "description": "Product ID as defined in account pricing. Change from default only if you have multiple products.",
              "example": "",
              "default": "1"
            },
            {
              "name": "recurrenceFrequency",
              "kind": "optional",
              "type": "object",
              "description": "Leave this field as null if you order a one prepaid.",
              "example": "",
              "default": null,
              "schema": [
                {
                  "name": "interval",
                  "kind": "optional",
                  "type": "string<DAY | MONTH | YEAR>",
                  "example": ""
                },
                {
                  "name": "intervalsCount",
                  "kind": "optional",
                  "type": "integer",
                  "example": 0
                }
              ]
            },
            {
              "name": "startTimeInSeconds",
              "kind": "optional",
              "type": "integer",
              "example": 0
            },
            {
              "name": "externalPayment",
              "kind": "optional",
              "type": "boolean",
              "description": "If true then the ordered prepaid card will be marked as external payment. Amberflo won't try to initiate a payment for the card. But instead wait for a signal from the account the card payment is settled.",
              "example": ""
            },
            {
              "name": "customPriority",
              "kind": "optional",
              "type": "integer",
              "description": "an optional field to indicate the priority of the prepaid. When using the prepaid cards, cards with higher priority will be used before cards with lower priority.",
              "example": 0
            }
          ],
          "modelRef": "#/components/schemas/pricing-amberflo-customer-prepaid-request",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "api_key",
          "name": "x-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "pricing-amberflo-customer-prepaid-response",
            "schema": [
              {
                "name": "customerId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "endTimeInSeconds",
                "kind": "optional",
                "type": "integer",
                "example": 0
              },
              {
                "name": "externalPayment",
                "kind": "optional",
                "type": "boolean",
                "example": ""
              },
              {
                "name": "firstCardEndTimeSeconds",
                "kind": "optional",
                "type": "integer",
                "example": 0
              },
              {
                "name": "firstInvoiceUri",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "internalStatus",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "originalCurrency",
                "kind": "optional",
                "type": "object",
                "example": "",
                "schema": [
                  {
                    "name": "currencyCode",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  }
                ]
              },
              {
                "name": "originalWorth",
                "kind": "optional",
                "type": "number",
                "example": ""
              },
              {
                "name": "paymentId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "paymentStatus",
                "kind": "optional",
                "type": "string<PRE_PAYMENT | REQUIRES_ACTION | PENDING | FAILED | SETTLED | NOT_NEEDED | UNKNOWN>",
                "example": ""
              },
              {
                "name": "prepaidConditions",
                "kind": "optional",
                "type": "object",
                "example": "",
                "schema": [
                  {
                    "name": "prepaidConditionsList",
                    "kind": "optional",
                    "type": "array",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "itemExample": "",
                    "itemDefault": ""
                  }
                ]
              },
              {
                "name": "prepaidOfferVersion",
                "kind": "optional",
                "type": "integer",
                "example": 0
              },
              {
                "name": "prepaidPaymentTimeInSeconds",
                "kind": "optional",
                "type": "integer",
                "example": 0
              },
              {
                "name": "prepaidPrice",
                "kind": "optional",
                "type": "number",
                "example": ""
              },
              {
                "name": "productId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "recurrenceFrequency",
                "kind": "optional",
                "type": "object",
                "example": "",
                "schema": [
                  {
                    "name": "interval",
                    "kind": "optional",
                    "type": "string<DAY | MONTH | YEAR>",
                    "example": ""
                  },
                  {
                    "name": "intervalsCount",
                    "kind": "optional",
                    "type": "integer",
                    "example": 0
                  }
                ]
              },
              {
                "name": "startTimeInSeconds",
                "kind": "optional",
                "type": "integer",
                "example": 0
              },
              {
                "name": "createdTimeInSeconds",
                "kind": "optional",
                "type": "integer",
                "description": "Time in epoch seconds when the prepaid order was created. This property is recorded by the API.",
                "example": 0
              },
              {
                "name": "modifiedTimeInSeconds",
                "kind": "optional",
                "type": "integer",
                "description": "Time in epoch seconds when the prepaid order was last updated for payment status. This property is tracked and managed by the API.",
                "example": 0
              },
              {
                "name": "customPriority",
                "kind": "optional",
                "type": "integer",
                "description": "an optional field to indicate the priority of the prepaid. When using the prepaid cards, cards with higher priority will be used before cards with lower priority.",
                "example": 0
              },
              {
                "name": "commitmentId",
                "kind": "optional",
                "type": "string",
                "description": "The id of the commitment if this card was purchased as part of a commitment.",
                "example": ""
              },
              {
                "name": "relationId",
                "kind": "optional",
                "type": "string",
                "description": "Base64 encoding of the object. This can be used as an alternative ID to customerId, productId, and id in query strings.",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/pricing-amberflo-customer-prepaid-response",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "-z-0X0dWOKl4apMjMzLeF",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url 'https://app.amberflo.io/customer-portal/prepaid-wallet?sessionToken=string' \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"productId\": \"1\"\n     }'"
        },
        {
          "id": "KoF2jS3V3f2gFhS7Q4i0U",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"productId\": \"1\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/customer-portal/prepaid-wallet?sessionToken=string\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "7CYObnK52hnKD62HNvELq",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/customer-portal/prepaid-wallet?sessionToken=string\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"productId\": \"1\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "DwJkOEEG8_E0LtJtd5ZmJ",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/customer-portal/prepaid-wallet?sessionToken=string\"\n\npayload = json.dumps({\n   \"productId\": \"1\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "-z-0X0dWOKl4apMjMzLeF"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful response\n{\n  \"customerId\": \"\",\n  \"endTimeInSeconds\": 0,\n  \"externalPayment\": false,\n  \"firstCardEndTimeSeconds\": 0,\n  \"firstInvoiceUri\": \"\",\n  \"id\": \"\",\n  \"internalStatus\": \"\",\n  \"originalCurrency\": {\n    \"currencyCode\": \"\"\n  },\n  \"originalWorth\": 0,\n  \"paymentId\": \"\",\n  \"paymentStatus\": \"\",\n  \"prepaidConditions\": {\n    \"prepaidConditionsList\": [\n      {}\n    ]\n  },\n  \"prepaidOfferVersion\": 0,\n  \"prepaidPaymentTimeInSeconds\": 0,\n  \"prepaidPrice\": 0,\n  \"productId\": \"\",\n  \"recurrenceFrequency\": {\n    \"interval\": \"\",\n    \"intervalsCount\": 0\n  },\n  \"startTimeInSeconds\": 0,\n  \"createdTimeInSeconds\": 0,\n  \"modifiedTimeInSeconds\": 0,\n  \"customPriority\": 0,\n  \"commitmentId\": \"\",\n  \"relationId\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": "",
      "id": "pv8HTVV5wN1pyfEWqzL80"
    }
  ]
}