Add reference code

Add reference code endpoint is available for adding reference codes only. you can't add/update fields via the API.
Creating and updating reference fields will be done via the UI.

"One-time reference code" field will be added and defined by Gett and is not available via the UI, but the codes can be added via the API

๐Ÿ“˜

Access token

The Access token should be requested with company.reference scope

NameValueDescription
URLhttps://business-api.gett.com/v1/reference-fields/<referenceFieldId>/codes?businessId=<companyUUID>URL for "Add reference code" request
referenceFieldIdUUIDReference field ID obtained from GETT Support
businessIdUUIDCompany UUID identificator obtained from Gett in registration process

Request

curl --request POST \
     --url https://business-api.gett.com/v1/reference-fields/9ac06f51-81a8-499d-a6b0-e44c18787747/codes?businessId=c06f51-81a8-499d-a6b0-e44c187 \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --data '
[
     {
          "value": "123"
     },
     {
          "value": "5645"
     },
     {
          "value": "66546"
     },
     {
          "value": "565646"
     }
]
'

Response

{
  "has_errors": true,
  "data": [
    {
      "id": "9ac06f51-81a8-499d-a6b0-e44c18787747",
      "value": "exampleCode2"
    }
  ],
  "errors": [
    {
      "index": 0,
      "code": "reference_code_invalid",
      "title": "Reference code validation failed",
      "field_errors": [
        {
          "field": "value",
          "code": "reference_code_invalid_format",
          "title": "Code valid characters are letters and 0-9"
        }
      ]
    }
  ]
}