# Update organization PUT https://api-sandbox.payabli.com/api/Organization/{orgId} Content-Type: application/json Updates an organization's details by ID. Reference: https://docs.payabli.com/developers/api-reference/organization/update-organization ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Update organization version: endpoint_organization.EditOrganization paths: /Organization/{orgId}: put: operationId: edit-organization summary: Update organization description: Updates an organization's details by ID. tags: - - subpackage_organization parameters: - name: orgId in: path description: The numeric identifier for organization, assigned by Payabli. required: true schema: type: integer - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: >- #/components/schemas/type_organization:EditOrganizationResponse '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: type: object properties: services: type: array items: $ref: '#/components/schemas/type_:ServiceCost' billingInfo: $ref: '#/components/schemas/type_:Instrument' contacts: $ref: '#/components/schemas/type_:ContactsField' hasBilling: type: boolean hasResidual: type: boolean orgAddress: $ref: '#/components/schemas/type_:Orgaddress' orgCity: $ref: '#/components/schemas/type_:Orgcity' orgCountry: $ref: '#/components/schemas/type_:Orgcountry' orgEntryName: $ref: '#/components/schemas/type_:Orgentryname' orgId: $ref: '#/components/schemas/type_:Orgidstring' orgLogo: $ref: '#/components/schemas/type_:FileContent' orgName: $ref: '#/components/schemas/type_:Orgname' orgParentId: $ref: '#/components/schemas/type_:OrgParentId' orgState: $ref: '#/components/schemas/type_:Orgstate' orgTimezone: $ref: '#/components/schemas/type_:Orgtimezone' orgType: $ref: '#/components/schemas/type_:Orgtype' orgWebsite: $ref: '#/components/schemas/type_:Orgwebsite' orgZip: $ref: '#/components/schemas/type_:Orgzip' replyToEmail: $ref: '#/components/schemas/type_:ReplyToEmail' components: schemas: type_:Enabled: type: boolean type_:ServiceCost: type: object properties: description: type: string enabled: $ref: '#/components/schemas/type_:Enabled' monthlyCost: type: number format: double name: type: string reseller: type: boolean setupCost: type: number format: double txCost: type: number format: double txPercentCost: type: number format: double type_:Achaccount: type: string type_:Achrouting: type: string type_:BillingAddressNullable: type: string type_:BillingCityNullable: type: string type_:BillingCountryNullable: type: string type_:BillingStateNullable: type: string type_:BillingZip: type: string type_:Instrument: type: object properties: achAccount: $ref: '#/components/schemas/type_:Achaccount' achRouting: $ref: '#/components/schemas/type_:Achrouting' billingAddress: $ref: '#/components/schemas/type_:BillingAddressNullable' billingCity: $ref: '#/components/schemas/type_:BillingCityNullable' billingCountry: $ref: '#/components/schemas/type_:BillingCountryNullable' billingState: $ref: '#/components/schemas/type_:BillingStateNullable' billingZip: $ref: '#/components/schemas/type_:BillingZip' required: - achAccount - achRouting type_:Email: type: string format: email type_:AdditionalDataString: type: string type_:Contacts: type: object properties: contactEmail: $ref: '#/components/schemas/type_:Email' description: Contact email address. contactName: type: string description: Contact name. contactPhone: type: string description: Contact phone number. contactTitle: type: string description: Contact title. additionalData: $ref: '#/components/schemas/type_:AdditionalDataString' type_:ContactsField: type: array items: $ref: '#/components/schemas/type_:Contacts' type_:Orgaddress: type: string type_:Orgcity: type: string type_:Orgcountry: type: string type_:Orgentryname: type: string type_:Orgidstring: type: string type_:FileContentFtype: type: string enum: - value: pdf - value: doc - value: docx - value: jpg - value: jpeg - value: png - value: gif - value: txt type_:FileContent: type: object properties: fContent: type: string description: >- Content of file, Base64-encoded. Ignored if furl is specified. Max upload size is 30 MB. filename: type: string description: The name of the attached file. ftype: $ref: '#/components/schemas/type_:FileContentFtype' description: The MIME type of the file (if content is provided) furl: type: string description: Optional URL provided to show or download the file remotely type_:Orgname: type: string type_:OrgParentId: type: integer format: int64 type_:Orgstate: type: string type_:Orgtimezone: type: integer type_:Orgtype: type: integer type_:Orgwebsite: type: string type_:Orgzip: type: string type_:ReplyToEmail: type: string format: email type_:IsSuccess: type: boolean type_:PageIdentifier: type: string type_:Responsecode: type: integer type_:Responsedatanonobject: oneOf: - type: string - type: integer type_:ResponseText: type: string type_organization:EditOrganizationResponse: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' pageIdentifier: $ref: '#/components/schemas/type_:PageIdentifier' responseCode: $ref: '#/components/schemas/type_:Responsecode' responseData: $ref: '#/components/schemas/type_:Responsedatanonobject' description: Returns the organization ID. responseText: $ref: '#/components/schemas/type_:ResponseText' required: - responseCode - responseText ``` ## SDK Code Examples ```typescript Example1 import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node"; async function main() { const client = new PayabliClient({ environment: PayabliEnvironment.Sandbox, apiKey: "YOUR_API_KEY_HERE", }); await client.organization.editOrganization(123, { contacts: [ { contactEmail: "herman@hermanscoatings.com", contactName: "Herman Martinez", contactPhone: "3055550000", contactTitle: "Owner", }, ], orgAddress: "123 Walnut Street", orgCity: "Johnson City", orgCountry: "US", orgEntryName: "pilgrim-planner", organizationDataOrgId: "123", orgName: "Pilgrim Planner", orgState: "TN", orgTimezone: -5, orgType: 0, orgWebsite: "www.pilgrimageplanner.com", orgZip: "37615", }); } main(); ``` ```python Example1 from payabli import payabli from payabli.environment import payabliEnvironment client = payabli( environment=payabliEnvironment.SANDBOX, api_key="YOUR_API_KEY_HERE" ) client.organization.edit_organization( org_id=123, contacts=[ { "contact_email": "herman@hermanscoatings.com", "contact_name": "Herman Martinez", "contact_phone": "3055550000", "contact_title": "Owner" } ], org_address="123 Walnut Street", org_city="Johnson City", org_country="US", org_entry_name="pilgrim-planner", organization_data_org_id="123", org_name="Pilgrim Planner", org_state="TN", org_timezone=-5, org_type=0, org_website="www.pilgrimageplanner.com", org_zip="37615" ) ``` ```csharp Example1 using PayabliApi; using System.Threading.Tasks; using System.Collections.Generic; namespace Usage; public class Example { public async Task Do() { var client = new PayabliApiClient( apiKey: "YOUR_API_KEY_HERE", clientOptions: new ClientOptions { BaseUrl = PayabliApiEnvironment.Sandbox } ); await client.Organization.EditOrganizationAsync( 123, new OrganizationData { Contacts = new List(){ new Contacts { ContactEmail = "herman@hermanscoatings.com", ContactName = "Herman Martinez", ContactPhone = "3055550000", ContactTitle = "Owner" }, } , OrgAddress = "123 Walnut Street", OrgCity = "Johnson City", OrgCountry = "US", OrgEntryName = "pilgrim-planner", OrganizationDataOrgId = "123", OrgName = "Pilgrim Planner", OrgState = "TN", OrgTimezone = -5, OrgType = 0, OrgWebsite = "www.pilgrimageplanner.com", OrgZip = "37615" } ); } } ``` ```go Example1 package example import ( client "github.com/payabli/sdk-go/v/client" option "github.com/payabli/sdk-go/v/option" payabli "github.com/payabli/sdk-go/v" context "context" ) func do() { client := client.NewClient( option.WithBaseURL( payabli.Environments.Sandbox, ), option.WithApiKey( "YOUR_API_KEY_HERE", ), ) request := &payabli.OrganizationData{ Contacts: []*payabli.Contacts{ &payabli.Contacts{ ContactEmail: payabli.String( "herman@hermanscoatings.com", ), ContactName: payabli.String( "Herman Martinez", ), ContactPhone: payabli.String( "3055550000", ), ContactTitle: payabli.String( "Owner", ), }, }, OrgAddress: payabli.String( "123 Walnut Street", ), OrgCity: payabli.String( "Johnson City", ), OrgCountry: payabli.String( "US", ), OrgEntryName: payabli.String( "pilgrim-planner", ), OrganizationDataOrgId: payabli.String( "123", ), OrgName: payabli.String( "Pilgrim Planner", ), OrgState: payabli.String( "TN", ), OrgTimezone: payabli.Int( -5, ), OrgType: payabli.Int( 0, ), OrgWebsite: payabli.String( "www.pilgrimageplanner.com", ), OrgZip: payabli.String( "37615", ), } client.Organization.EditOrganization( context.TODO(), 123, request, ) } ``` ```ruby Example1 require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Organization/123") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"contacts\": [\n {\n \"contactEmail\": \"herman@hermanscoatings.com\",\n \"contactName\": \"Herman Martinez\",\n \"contactPhone\": \"3055550000\",\n \"contactTitle\": \"Owner\"\n }\n ],\n \"orgAddress\": \"123 Walnut Street\",\n \"orgCity\": \"Johnson City\",\n \"orgCountry\": \"US\",\n \"orgEntryName\": \"pilgrim-planner\",\n \"orgId\": \"123\",\n \"orgName\": \"Pilgrim Planner\",\n \"orgState\": \"TN\",\n \"orgTimezone\": -5,\n \"orgType\": 0,\n \"orgWebsite\": \"www.pilgrimageplanner.com\",\n \"orgZip\": \"37615\"\n}" response = http.request(request) puts response.read_body ``` ```java Example1 import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api-sandbox.payabli.com/api/Organization/123") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"contacts\": [\n {\n \"contactEmail\": \"herman@hermanscoatings.com\",\n \"contactName\": \"Herman Martinez\",\n \"contactPhone\": \"3055550000\",\n \"contactTitle\": \"Owner\"\n }\n ],\n \"orgAddress\": \"123 Walnut Street\",\n \"orgCity\": \"Johnson City\",\n \"orgCountry\": \"US\",\n \"orgEntryName\": \"pilgrim-planner\",\n \"orgId\": \"123\",\n \"orgName\": \"Pilgrim Planner\",\n \"orgState\": \"TN\",\n \"orgTimezone\": -5,\n \"orgType\": 0,\n \"orgWebsite\": \"www.pilgrimageplanner.com\",\n \"orgZip\": \"37615\"\n}") .asString(); ``` ```php Example1 request('PUT', 'https://api-sandbox.payabli.com/api/Organization/123', [ 'body' => '{ "contacts": [ { "contactEmail": "herman@hermanscoatings.com", "contactName": "Herman Martinez", "contactPhone": "3055550000", "contactTitle": "Owner" } ], "orgAddress": "123 Walnut Street", "orgCity": "Johnson City", "orgCountry": "US", "orgEntryName": "pilgrim-planner", "orgId": "123", "orgName": "Pilgrim Planner", "orgState": "TN", "orgTimezone": -5, "orgType": 0, "orgWebsite": "www.pilgrimageplanner.com", "orgZip": "37615" }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift Example1 import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = [ "contacts": [ [ "contactEmail": "herman@hermanscoatings.com", "contactName": "Herman Martinez", "contactPhone": "3055550000", "contactTitle": "Owner" ] ], "orgAddress": "123 Walnut Street", "orgCity": "Johnson City", "orgCountry": "US", "orgEntryName": "pilgrim-planner", "orgId": "123", "orgName": "Pilgrim Planner", "orgState": "TN", "orgTimezone": -5, "orgType": 0, "orgWebsite": "www.pilgrimageplanner.com", "orgZip": "37615" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Organization/123")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```