In this topic:

Order custom fields

Order custom fields allow you to deliver additional information about the order. Once you have created an order custom field in the original user interface 1.0, you can retrieve available custom field values and related references with the Gotransverse Billing API.

To use the Custom Fields functionality, you have to populate existing custom fields with the custom field values. When desired, you can also edit and delete values that you have added.

Retrieving the configured custom fields and related references

To retrieve existing custom fields, use the following endpoints:

GET https://example.gotransverse.com/billing/2/order-custom-fields
GET https://example.gotransverse.com/billing/2/order-custom-fields/{id}

To retrieve existing list values for a billing account custom field with the specified ID, use the following endpoint:

GET https://example.gotransverse.com/billing/2/order-custom-fields/{custom_field_id}/references

Working with order custom field values

The Gotransverse Billing API provides a way to retrieve the available custom field values and add new ones to the existing custom fields. Also, when needed, you can edit and delete desired custom field values.

Retrieving order custom field values

Use the following endpoints to retrieve product custom field values:

GET https://example.gotransverse.com/billing/2/orders/{order_id}/custom-field-values
GET https://example.gotransverse.com/billing/2/orders/{order_id}/custom-field-values/{id}

Creating a new order custom field value

Use the following endpoints to retrieve billing account custom field values:

POST https://example.gotransverse.com/billing/2/orders/{id}/custom-field-values

Request

{
  "custom_field_value_type": "order",
  "value": "custom field value on order #1",
  "custom_field": {
      "id": "2332",
	  "name": "sample custom field on order #1",
	  "custom_field_type": "order"
   }
}

Response

{
    "custom_field_value_type": "order",
    "id": "171478",
    "value": "custom field value on order #1",
    "custom_field": {
        "custom_field_type": "order",
        "id": "2332",
        "name": "sample custom field on order #1"
    }
}

Editing and deleting order custom field values

Use the following endpoint to edit the existing custom field value. In the request body, specify the desired custom field value and its type:

PUT https://example.gotransverse.com/billing/2/orders/{order_id}/custom-field-values/{id}

Request

{
  "custom_field_value_type": "order",
  "value": " updated custom field value on order #1"
}

Response

{
    "custom_field_value_type": "order",
    "id": "171478",
    "value": " updated custom field value on order #1",
    "custom_field": {
        "custom_field_type": "order",
        "id": "2332",
        "name": "sample custom field on order #1"
    }
}

Use the following endpoint to delete the desired custom field value:

DELETE https://example.gotransverse.com/billing/2/billing-accounts/{billing_account_id}/custom-field-values/{id}

Note: You cannot delete a custom field value that is in use.

Top