Custom Schema - Inbound
Load records into a custom schema and see how GAINS checks them.
Load records into a custom schema with POST /custom/{ApiRoute}. What GAINS sets up for a schema is described in Custom Schema.
Load records
Send an array of records to POST /custom/{ApiRoute}, each record holding the schema's attributes.
POST /api/v1/custom/warehouse-zones HTTP/1.1
Host: acme.gainsystems.com
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJqTl9F...
Content-Type: application/json[
{
"ZoneCode": "CHI01-A3",
"LocationCode": "CHI01",
"Capacity": "1250.5",
"Refrigerated": "true",
"Notes": "Cold storage aisle, north wall"
},
{
"ZoneCode": "CHI01-B1",
"LocationCode": "CHI01",
"Capacity": "800",
"Refrigerated": "false",
"Notes": "Bulk pallets"
}
]The load behaves like every other inbound endpoint: at most 1000 records per request; 202 or 207 with a TaskId for the accepted records, 422 when no record was accepted, and 429 when GAINS Connect is busy. See Inbound Endpoints & Integration Tasks.
{
"Status": "Queued",
"TaskId": "5b9e2c71-0a4d-4f36-8e1b-7c3d9a2f6e15"
}GAINS loads the records at its next scheduled load for custom data. The task shows the task type set up for the schema, for example WarehouseZones. To list these tasks with GET /tasks, filter on TaskType=InboundCustomSchema, which covers every custom schema.
No idempotency key on custom loadsThis endpoint ignores
Idempotency-Key, so a resent request is loaded again. After a timeout, look for the first attempt's task withGET /tasksbefore you send it again.
How records are checked
Each record is checked against the schema on its own. A record that fails is listed under RejectedRecords in the 207 or 422 response; the others are accepted.
| Check | Rule |
|---|---|
| Required attributes | Each must be present. |
| Unknown attributes | An attribute the schema does not define rejects the record. Names are case-sensitive: zonecode is not ZoneCode. |
string | A JSON string of at most 500 characters, or fewer if GAINS stores the attribute in a shorter field. |
text | A JSON string of any length. |
numeric | A JSON string holding a number: "1250.5", "-3". |
boolean | The JSON string "true" or "false", in any letter case. |
Send every value as a JSON string, numbers and booleans included: "Capacity": 1250.5 is rejected, "Capacity": "1250.5" is accepted. Leave out an optional attribute you have no value for instead of sending null, which fails the type check.
Reading rejected records is described in Rejected Records.
Related guides
Updated about 9 hours ago
