Create a supplier

Create a supplier to your company. Before making a POST request to create a supplier in your company, you might find it useful to look at the list of available companies.

POST suppliers?skipCreationInAccountingSystem=false

Request details

The post request will contain all the required information to create a supplier in your company.

Request properties

Property Type Description Optional
Request Supplier request object The supplier request to add. No
SkipCreationInAccountingSystem Bool Flag that allow also to create the supplier in the accounting system. Yes

For supplier create request object properties see details.

Example request

{  
    "company":{  
    "companyId":"00000000-0000-0000-0000-000000000000"
    },
    "code":"code",
    "externalId":"externalId",
    "address":{  
    "streetName":"street",
    "streetNumber":"number",
    "city":"city",
    "postalCode":"postalcode",
    "country":{  
        "code":"country code"
    }
    },
    "payCollectType":{  
    "code":"code"
    },
    "vatCode":{  
    "code":"code"
    },
    "name":"name",
    "vatNumber":"vatnumber",
    "chamberOfCommerce":"ChamberOfCommerce",
    "phone":"phone",
    "fax":"fax",
    "bankAccounts":[  
    {  
        "default":true,
        "externalId":"externalId",
        "number":"number",
        "iban":"iban",
        "bicCode":"biccode",
        "bankName":"bankname",
        "nationalBankCode":"nationalbankcode",
        "country":{  
        "code":"code"
        }
    }
    ],
    "SubstitutionGeneralLedger":{  
    "Code":"code"
    },
    "PaymentDiscount":{  
    "PaymentDays":13,
    "DiscountPercentage":0.00,
    "DiscountCalculationMethod":"calcuation method",
    "GeneralLedger":{  
        "Code":"code"
    }
    },
    "Number":"number",
    "PaymentCondition":{  
    "Code":"code"
    },
    "Email":"email",
    "Metadata":{  
    "key1":"value1",
    "key2":"value2"
    }
}

Response

Upon successful creation of a supplier in the Basecone system, a 201 http status code will be returned together with the newly created SupplierId unique identifier. If something goes wrong, an error message with failure details will be given together with a suitable http error status code.

Example response

{
  "supplierId": "52a4471b-8cb4-4a13-981f-86a30b72feff"
}

Possible error responses

Status code Error code Details
400 invalid_request_payload Create supplier request cannot be null
400 invalid_request_payload Company id cannot be empty
400 invalid_request_payload The company provided does not exist.
400 user_credentials_invalid Invalid credentials.
400 invalid_request_payload The supplier code provided is invalid.
400 invalid_request_payload The supplier code provided already exists.
400 invalid_request_payload The SubstitutionGeneralLedger code provided is invalid.
400 invalid_request_payload The VatCode value provided is invalid.
400 invalid_request_payload The PaymentCondition DueDays provided is invalid.
400 invalid_request_payload The PaymentCondition provided is invalid.
400 invalid_request_payload The PayCollectType code provided is invalid.
400 invalid_request_payload The AddressCountry code provided is invalid.
400 invalid_request_payload The BankAccount Country code provided is invalid.
400 invalid_request_payload The DiscountCalculationMethod value provided is invalid.
400 invalid_request_payload The PaymentDiscount GeneralLedger provided is invalid.
400 invalid_request_payload Invalid meta data.
400 validation_error Other validation errors from the accounting system
403 unauthorized User does not have access to the company provided.
400 invalid_request_payload Request properties are not valid to perform the requested operation.
400 validation_error One or more properties were not valid
400 validation_error One or more validation errors occurred.
403 unauthorized User has no access to the accounting system company.
403 unauthorized User is not allowed to change Bank Account.