{"openapi":"3.0.2","info":{"title":"Energy Sales & Marketing - Integrations Service","version":"1.0.1","description":"A service to provide API integrations for Energy Sales & Marketing customers"},"servers":[{"url":"https://digitalcommerce-integrations.dtn.com","description":"Production API URL"}],"paths":{"/health":{"summary":"Health Check","description":"The health check endpoint provides information about the health of a web service. If each of the components required by the service are healthy, then the service is considered healthy and will return a 200 OK response. If any of the components needed by the service are unhealthy, then a 503 Service Unavailable response will be provided.","get":{"tags":["Health"],"summary":"Health Check","responses":{"200":{"$ref":"#/components/responses/HealthCheckReport"},"503":{"$ref":"#/components/responses/ErrorResponse"}},"operationId":"healthCheck","x-eov-operation-handler":"health","description":""}},"/orders":{"get":{"tags":["Orders"],"description":"Get Prompt Orders","operationId":"getSpotOrders","x-eov-operation-handler":"orders","security":[{"clientCredentials":[]}],"parameters":[{"in":"query","name":"startDate","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endDate","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"status","schema":{"type":"string","enum":["PENDING","CONFIRMED"]}},{"in":"query","name":"page","schema":{"type":"number","default":1,"minimum":1}},{"in":"query","name":"limit","schema":{"type":"number","default":25,"minimum":1,"maximum":25}}],"responses":{"200":{"$ref":"#/components/responses/OrderResponse"}}}},"/orders/forward":{"get":{"tags":["Orders"],"description":"Get Forward Orders","operationId":"getForwardOrders","x-eov-operation-handler":"orders","security":[{"clientCredentials":[]}],"parameters":[{"in":"query","name":"startDate","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endDate","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"status","schema":{"type":"string","enum":["PENDING","CONFIRMED"]}},{"in":"query","name":"page","schema":{"type":"number","default":1,"minimum":1}},{"in":"query","name":"limit","schema":{"type":"number","default":25,"minimum":1,"maximum":25}}],"responses":{"200":{"$ref":"#/components/responses/ForwardOrderResponse"}}}},"/order/{orderId}/data-management":{"put":{"tags":["Orders"],"description":"Update Orders","operationId":"updateOrder","x-eov-operation-handler":"orders","security":[{"clientCredentials":[]}],"parameters":[{"in":"path","name":"orderId","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The requested updates to the order","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["CONFIRMED","CANCELLED"]},"quantityOrdered":{"type":"number","minimum":1,"example":10000},"liftingEnd":{"type":"string","format":"date-time"},"buyerUsername":{"type":"string"},"terminals":{"type":"array","items":{"$ref":"#/components/schemas/TerminalUpdate"},"minimum":1},"consigneeId":{"type":"string","description":"The id of a consignee to assign to this order. Required when confirming an order."},"tabsAllowAdditionalVolume":{"type":"boolean","description":"Specifies whether this order should allocate additional (new) volume outside of the usual allocation within TABS. Required when confirming an order."},"contractNumber":{"type":"string","description":"Attaches a contract number to the order, this identifier is displayed on the Digital Commerce platform alongside the order details."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/responses/Success"}}}}}}},"/pricing":{"get":{"tags":["Pricing"],"description":"Get Pricing Rules","operationId":"getPricingRules","x-eov-operation-handler":"pricing","security":[{"clientCredentials":[]}],"parameters":[{"in":"query","name":"pageNumber","schema":{"type":"number","default":1,"minimum":1}},{"in":"query","name":"pageLimit","schema":{"type":"number","default":25,"minimum":1,"maximum":100}},{"in":"query","name":"terminalSplc","schema":{"type":"string"}},{"in":"query","name":"terminalOwner","schema":{"type":"string"}},{"in":"query","name":"productGroup","schema":{"type":"string"}},{"in":"query","name":"product","schema":{"type":"string"}},{"in":"query","name":"areFixedRules","schema":{"type":"boolean"}},{"in":"query","name":"labels","description":"The internal category behind Basis, Margin and Cost pricing values","schema":{"type":"array","items":{"$ref":"#/components/schemas/PricingRuleLabels"}}}],"responses":{"200":{"description":"A successful response containing a list of matching differential values","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/PricingRule"}},"metadata":{"$ref":"#/components/schemas/Pagination"}}}}}}}},"put":{"tags":["Pricing"],"description":"Creates new & updates existing pricing values","operationId":"putPricingRules","x-eov-operation-handler":"pricing","security":[{"clientCredentials":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PricingRulePut"}}}}},"responses":{"200":{"description":"A successful response containing a list of updated differential values","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"array","items":{"$ref":"#/components/schemas/PricingRule"}},"updated":{"type":"array","items":{"$ref":"#/components/schemas/PricingRule"}},"failed":{"type":"array","items":{"$ref":"#/components/schemas/PricingRulePut"}}}}}}}}},"delete":{"tags":["Pricing"],"description":"Delete Pricing Rules","operationId":"deletePricingRules","x-eov-operation-handler":"pricing","security":[{"clientCredentials":[]}],"requestBody":{"description":"List of pricing ID's to be deleted","content":{"application/json":{"schema":{"type":"array","minItems":1,"items":{"type":"string"}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/responses/DeletePriceResponse"}}}}}}},"/users/buyers/setup":{"post":{"tags":["Users"],"description":"Create and/or update buyer account(s) and user(s) with specified roles and permissions","operationId":"setupBuyerAccountsAndUsers","x-eov-operation-handler":"users","security":[{"clientCredentials":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SetupBuyerRequest"}}}}},"responses":{"200":{"description":"Information about which users were successfully set up and which failed","content":{"application/json":{"schema":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/SetupBuyerRequestSuccessfulItem"}},"failed":{"type":"array","items":{"$ref":"#/components/schemas/SetupBuyerRequestFailedItem"}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"schemas":{"ErrorDetails":{"type":"object","required":["type","status"],"properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"}}},"Error":{"title":"Root Type for Error","description":"Error","required":["code","description","status"],"type":"object","properties":{"status":{"enum":["error"],"type":"string"},"code":{"enum":["invalid-id","internal-error","invalid-token","missing-scope"],"type":"string"},"description":{"type":"string"}},"example":{"status":"error","code":"invalid-token","description":"The token has expired."}},"HealthCheck":{"title":"HealthCheckResponse","description":"Health Check Response","required":["status"],"type":"object","properties":{"status":{"type":"string"},"version":{"type":"string"},"info":{"type":"string"},"timestamp":{"format":"date-time","type":"string"},"env":{"type":"string"}},"example":{"status":"up","version":"unknown","info":"Service is healthy","timestamp":"2021-04-19T22:10:53Z","env":"unknown"}},"ProductPriceUpdate":{"required":["id","price"],"properties":{"id":{"type":"string","example":"D7B"},"price":{"$ref":"#/components/schemas/Price"},"quantityOrdered":{"type":"number","minimum":0}}},"ProductQuantityUpdate":{"required":["id","quantityOrdered"],"properties":{"id":{"type":"string","example":"D7B"},"price":{"$ref":"#/components/schemas/Price"},"quantityOrdered":{"type":"number","minimum":0}}},"TerminalUpdate":{"required":["splc","owner"],"properties":{"splc":{"type":"string","example":"447850"},"owner":{"type":"string","example":"145"},"products":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/ProductPriceUpdate"},{"$ref":"#/components/schemas/ProductQuantityUpdate"}]},"minimum":1}}},"Product":{"properties":{"id":{"type":"string","example":"D7B"},"productCustomCode":{"type":"string","example":"MP2"},"basePrice":{"type":"number","example":3.696},"finalPrice":{"type":"number","example":3.646},"differential":{"type":"number","example":-0.05},"customerAdjustment":{"type":"number","example":-0.05},"contractMonth":{"type":"string","example":"August `22"},"quote":{"type":"string","example":"QRB"},"quoteType":{"type":"string","example":"ask"},"market":{"type":"string","example":"Philadelphia"},"supplier":{"type":"string","example":"Citgo"},"name":{"type":"string","example":"87 E10"},"quantityOrdered":{"type":"number","example":5000}}},"Terminal":{"properties":{"splc":{"type":"string","example":"123456"},"owner":{"type":"string","example":"123"},"name":{"type":"string","example":"Terminal Name 1"},"tcn":{"type":"string","example":"T00GA0000"},"plantId":{"type":"string","example":"M17"},"terminalCustomCode":{"type":"string","example":"MT2"},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}},"ForwardTerminal":{"properties":{"splc":{"type":"string","example":"123456"},"owner":{"type":"string","example":"123"},"name":{"type":"string","example":"Terminal Name 1"},"tcn":{"type":"string","example":"T00GA0000"},"plantId":{"type":"string","example":"M17"},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}},"Buyer":{"type":"object","properties":{"name":{"type":"string","example":"Fuel Buyer"},"customCode":{"type":"string","example":"44444"},"user":{"type":"object","properties":{"username":{"type":"string","example":"john.smith@fuelbuyer.dtn.com"},"email":{"type":"string","example":"john.smith@fuelbuyer.dtn.com"}}}}},"Seller":{"type":"object","properties":{"name":{"type":"string","example":"Fuel Seller"},"user":{"type":"object","properties":{"username":{"type":"string","example":"jane.smith@fuelseller.dtn.com"},"email":{"type":"string","example":"jane.smith@fuelseller.dtn.com"}}}}},"LiftingPeriod":{"type":"object","properties":{"start":{"type":"string","format":"date-time","example":"2022-08-11T12:00:00.000Z"},"end":{"type":"string","format":"date-time","example":"2022-08-13T12:00:00.000Z"}}},"ContractPeriod":{"type":"object","properties":{"liftingPeriod":{"$ref":"#/components/schemas/LiftingPeriod"},"basis":{"type":"number","example":0.1},"margin":{"type":"number","example":0.25},"costs":{"type":"number","example":0.045},"quantity":{"type":"number","example":50000},"marketPrice":{"type":"number","example":6.2581}}},"Order":{"properties":{"orderId":{"type":"string","example":"13ABCDE"},"contractNumber":{"type":"string","example":"order123"},"status":{"type":"string","enum":["PENDING","CONFIRMED","CANCELLED"]},"buyer":{"$ref":"#/components/schemas/Buyer"},"seller":{"$ref":"#/components/schemas/Seller"},"marketIndex":{"type":"string","enum":["NYMEX","OPIS"]},"type":{"type":"string","enum":["Real-Time","Trade At Settlement"]},"terminals":{"type":"array","items":{"$ref":"#/components/schemas/Terminal"}},"consignee":{"type":"object","properties":{"name":{"type":"string","example":"Fuel Buyer Contract"},"id":{"type":"string","example":"Fuel Buyer Contract"}}},"soldTo":{"type":"object","properties":{"name":{"type":"string","example":"Sold to"},"id":{"type":"string","example":"Sold to"}}},"productGroup":{"type":"object","properties":{"name":{"type":"string","example":"Reg Gas"},"quantityOrdered":{"type":"number","example":25000}}},"liftingPeriod":{"$ref":"#/components/schemas/LiftingPeriod"},"created":{"type":"string","format":"date-time","example":"2022-08-11T10:31:27.182Z"}}},"ForwardOrder":{"properties":{"orderId":{"type":"string","example":"13ABCDE"},"contractNumber":{"type":"string","example":"order123"},"status":{"type":"string","enum":["PENDING","CONFIRMED","CANCELLED"]},"buyer":{"$ref":"#/components/schemas/Buyer"},"seller":{"$ref":"#/components/schemas/Seller"},"marketIndex":{"type":"string","enum":["NYMEX","OPIS"]},"type":{"type":"string","enum":["Forward-Order"]},"contractType":{"type":"string","enum":["CURVE","FIXED","FLEX","STRIP"]},"contractPrice":{"type":"number","example":6.6531},"terminals":{"type":"array","items":{"$ref":"#/components/schemas/ForwardTerminal"}},"contractPeriods":{"type":"array","items":{"$ref":"#/components/schemas/ContractPeriod"}},"consignee":{"type":"object","properties":{"name":{"type":"string","example":"Fuel Buyer Contract"},"id":{"type":"string","example":"Fuel Buyer Contract"}}},"soldTo":{"type":"object","properties":{"name":{"type":"string","example":"Sold to"},"id":{"type":"string","example":"Sold to"}}},"productGroup":{"type":"object","properties":{"name":{"type":"string","example":"Reg Gas"},"quantityOrdered":{"type":"number","example":25000}}},"liftingPeriod":{"$ref":"#/components/schemas/LiftingPeriod"},"created":{"type":"string","format":"date-time","example":"2022-08-11T10:31:27.182Z"}}},"Price":{"type":"number","multipleOf":0.0001,"minimum":0.0001},"PricingRulePut":{"required":["value","terminalSplc","terminalOwner","productGroup","product"],"properties":{"value":{"type":"number"},"terminalSplc":{"type":"string"},"terminalOwner":{"type":"string"},"productGroup":{"type":"string"},"product":{"type":"string"},"label":{"$ref":"#/components/schemas/PricingRuleLabels"}}},"PricingRule":{"properties":{"id":{"type":"string"},"value":{"type":"number"},"terminalSplc":{"type":"string"},"terminalOwner":{"type":"string"},"productGroup":{"type":"string"},"product":{"type":"string"},"label":{"$ref":"#/components/schemas/PricingRuleLabels"}}},"PricingRuleLabels":{"type":"string","enum":["BASIS","MARGIN","COST"]},"Pagination":{"properties":{"pageTotal":{"type":"number"},"pageNumber":{"type":"number"},"pageLimit":{"type":"number"}}},"SetupBuyerRequest":{"type":"object","description":"Request body for setting up buyer accounts and users","additionalProperties":false,"required":["status","userName","name","surname","email","locale","customUserId","soldTos","shipTos","permissions","roles"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"userName":{"type":"string"},"name":{"type":"string"},"surname":{"type":"string"},"email":{"type":"string"},"locale":{"type":"string","enum":["en-US","fr-FR","es-ES","nb-NO","nl-NL","de-DE","browserDefault"]},"customUserId":{"type":"string"},"soldTos":{"type":"array","items":{"type":"string"}},"shipTos":{"type":"array","items":{"type":"string"}},"permissions":{"type":"array","items":{"type":"object","required":["feature","access"],"properties":{"feature":{"type":"string","enum":["allocation_viewer","contracts","forecast","loading_data","orders","pre_orders","terminals"]},"access":{"type":"string","enum":["READ","WRITE"]}}}},"roles":{"type":"array","items":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["ADMIN","USER"]}}}}}},"SetupBuyerRequestSuccessfulItem":{"required":["customUserId","soldTos","shipTos"],"properties":{"customUserId":{"type":"string"},"soldTos":{"type":"array","items":{"type":"string"}},"shipTos":{"type":"array","items":{"type":"string"}}}},"SetupBuyerRequestFailedItem":{"required":["customUserId","reason"],"properties":{"customUserId":{"type":"string"},"reason":{"type":"string","description":"Short description of why the buyer user setup failed","example":"No buyer account has been set up for sold to number(s): 12345, 101010"}}}},"responses":{"BadRequest":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetails"},"example":{"type":"bad-request","title":"Invalid Request","status":400,"detail":"request/body/0/locale must be equal to one of the allowed values: en-US, fr-FR, es-ES, nb-NO, nl-NL, de-DE, browserDefault"}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetails"},"example":{"type":"unauthorized","title":"Error while authenticating the user","status":401,"detail":"Provided token does not grant access to this route"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetails"},"example":{"type":"internal-server-error","title":"Internal Server Error","status":500,"detail":"internal error"}}}},"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"Error":{"value":{"status":"error","code":"invalid-token","description":"bad token"}}}}},"description":"info about error"},"HealthCheckReport":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheck"},"examples":{"Success":{"value":{"status":"up","version":"v2","info":"Service is healthy.","timestamp":"2018-02-10T09:30Z","env":"unknown"}}}}},"description":"Health Check report"},"Success":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","enum":["success"]}}}}},"description":"a successful response"},"DeletePriceResponse":{"description":"A successful response containing details of the deleted prices","content":{"application/json":{"schema":{"properties":{"deleted":{"type":"number","example":2}}}}}},"OrderResponse":{"description":"A successful response containing details of the orders requested","content":{"application/json":{"schema":{"properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"pageInformation":{"type":"object","properties":{"total":{"type":"number","example":10},"limit":{"type":"number","example":25},"page":{"type":"number","example":1},"pages":{"type":"number","example":1}}}}}}}},"ForwardOrderResponse":{"description":"A successful response containing details of the forward orders requested","content":{"application/json":{"schema":{"properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/ForwardOrder"}},"pageInformation":{"type":"object","properties":{"total":{"type":"number","example":10},"limit":{"type":"number","example":25},"page":{"type":"number","example":1},"pages":{"type":"number","example":1}}}}}}}}},"securitySchemes":{"clientCredentials":{"type":"oauth2","x-receive-token-in":"request-body","flows":{"clientCredentials":{"tokenUrl":"https://api.auth.dtn.com/v1/tokens/authorize"}},"description":"# Using DAIS for M2M/API Auth\nYou have been given a Client ID and a Client Secret, which are used to request a DTN Access Token. DTN Access Tokens are required when making calls to each and every DTN API endpoint. The following information provides additional details on these tokens and how they are generated.\n## What is an Access Token and how is it different from an API Key?\nAn API Key is a random string of characters that an API uses to authorize whether or not a calling client has approved access to an endpoint. These keys are a non-standard approach to API authorization and are generally issued on a per-API basis.\n\nAn Access Token is also a string of characters but is a base-64 encoded JavaScript Object Notation Web Token, or JWT. JWTs are a widely accepted standard that use OAuth concepts and approaches. \n\nBoth API Keys and Access Tokens are used in an Authorization Request Header as a Bearer, meaning there is no difference in where you put this string of characters when you make calls to DTN APIs.\n## How to generate an Access Token?\nWhen requested, an Access Token is generated for your specific Client (ID/Secret) and for a specific API. The DTN Auth and Identity Service (DAIS) generates new Access Tokens for your client. The DAIS endpoint is `POST https://api.auth.dtn.com/v1/tokens/authorize`.\n\nThis endpoint takes two Header parameters:\n * `Content-Type: application/json`\n * `Accept: application/json`\n\nThis endpoint takes four parameters in the Request Body:\n * `grant_type`: this should always be client_credentials for generating machine-to-machine tokens.\n * `client_id`: this is the Client ID or Application ID using the token and is given to you by DTN's Identity Team. This ID will never change for your client/application.\n * `client_secret`: this is the Client Secret that is associated with the Application ID and is given to you by DTN's Identity Team. This key is subject to rotation for security purposes but always with the client's knowledge.\n * `audience`: this is the API for which this Access Token will be used. For the Energy Sales & Marketing Integrations API, you need to use the following audience: https://digitalcommerce-integrations.dtn.com\n\nYou can use this CURL command template as a reference for obtaining an access token:\n ```\n curl --location --request POST 'https://api.auth.dtn.com/v1/tokens/authorize' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n\"grant_type\": \"client_credentials\",\n\"client_id\": \"insert your client id here\",\n\"client_secret\": \"insert your client secret here\",\n\"audience\": \"insert your audience here\"\n}' \n ```\n\n*This document, for demonstration purposes, supplies a client_id and client_secret in all code examples. This client/application is for a fictitious API and cannot be used in practice to gain unauthorized access to any other DTN API.*\nUpon generating a new Access Token, you should receive an HTTP Response from DAIS similar to this:\n ```\n {\n \"data\": {\n \"access_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InpfX21pZW13NGhoTmdvQWQxR3N6ciJ9.eyJodHRwczovL2F1dGguZHRuLmNvbS9jdXN0b21lcklkIjoiMTIzNDU2Nzg5MERlbW8iLCJodHRwczovL2F1dGguZHRuLmNvbS9wcm9kdWN0Q29kZSI6IkRlbW9BcGlQIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcmVxdWVzdGVySXAiOiIxOC4yMTMuMTc0LjI3IiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcnBzIjoiMTAwIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vdGllciI6IkJhc2ljIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcXVvdGEiOiI5OTk5OTkiLCJpc3MiOiJodHRwczovL2lkLmF1dGguZHRuLmNvbS8iLCJzdWIiOiJuZnlPM0tpS1BSOE4wREtSNUNMOGpTOUdGQkNEZXlGTUBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9kZW1vLWFwaS5hdXRoLmR0bi5jb20vIiwiaWF0IjoxNjU2MDk5MDY4LCJleHAiOjE2NTYwOTkxNTgsImF6cCI6Im5meU8zS2lLUFI4TjBES1I1Q0w4alM5R0ZCQ0RleUZNIiwic2NvcGUiOiJyZWFkOmRlbW8gY3JlYXRlOmRlbW8gdXBkYXRlOmRlbW8iLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMiLCJwZXJtaXNzaW9ucyI6WyJyZWFkOmRlbW8iLCJjcmVhdGU6ZGVtbyIsInVwZGF0ZTpkZW1vIl19.0VHdyp1w9PPFVI0FPheAwuKZwb5C25rwP-LPMXcSNoRmouvga1DZtNLA67ZzE_sAlc_VpaDRr6daLKr_Alw4347mw9sdjP8wKR27kCZa9JZK5PGQMmXHscATbzBEJYpCPklfyGaajgymqTBGnedcv8F0UvlRzQPsFeRPnVoX7BWOSXpMbyToGiXWkQLBQT7r96KAmLZOPJFZspPtjw-wH2mSL2WNa_nkB4j5vMGhGxlKiNRsKb30TH_WAel2hsxNlcPK3XHCmrMTYsNnu7HNqOTMn2i0__0rvBrhSWEw-_grqQDmWFJuWd7Qhi1q81AaJcdqgoSa_efz93QFclJUNw\",\n \"scope\": \"read:demo create:demo update:demo\",\n \"expires_in\": 90,\n \"token_type\": \"Bearer\"\n },\n \"meta\": {\n \"date_time\": \"2022-06-24T19:09:42.963Z\",\n \"name\": \"v1.tokens.authorize\",\n \"uuid\": \"ee6f9feb-dcf8-4421-a6fd-efd6beabdaa9\",\n \"start_timestamp\": 1656097782509,\n \"end_timestamp\": 1656097782963,\n \"execution_time\": 454\n }\n }\n ```\nLooking at this Response, you will see:\n * `access_token`: contains the JWT Access Token string you will use as your Bearer token.\n * `scope`: contains the scopes that this Access Token gives you permissions to access.\n * `expires_in`: contains the length of time before this Access Token will expire, in seconds.\n * `token_type`: verifies that this Access Token should be used as a Bearer token.\n\n## How to use an Access Token after one is generated?\nOnce a new Access Token is obtained, it is used in each call to a DTN API endpoint as a Bearer token in an Authorization Request Header. For example:\n ```\n Header: 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InpfX21pZW13NGhoTmdvQWQxR3N6ciJ9.eyJodHRwczovL2F1dGguZHRuLmNvbS9jdXN0b21lcklkIjoiMTIzNDU2Nzg5MERlbW8iLCJodHRwczovL2F1dGguZHRuLmNvbS9wcm9kdWN0Q29kZSI6IkRlbW9BcGlQIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcmVxdWVzdGVySXAiOiIxOC4yMTMuMTc0LjI3IiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcnBzIjoiMTAwIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vdGllciI6IkJhc2ljIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcXVvdGEiOiI5OTk5OTkiLCJpc3MiOiJodHRwczovL2lkLmF1dGguZHRuLmNvbS8iLCJzdWIiOiJuZnlPM0tpS1BSOE4wREtSNUNMOGpTOUdGQkNEZXlGTUBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9kZW1vLWFwaS5hdXRoLmR0bi5jb20vIiwiaWF0IjoxNjU2MDk5MDY4LCJleHAiOjE2NTYwOTkxNTgsImF6cCI6Im5meU8zS2lLUFI4TjBES1I1Q0w4alM5R0ZCQ0RleUZNIiwic2NvcGUiOiJyZWFkOmRlbW8gY3JlYXRlOmRlbW8gdXBkYXRlOmRlbW8iLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMiLCJwZXJtaXNzaW9ucyI6WyJyZWFkOmRlbW8iLCJjcmVhdGU6ZGVtbyIsInVwZGF0ZTpkZW1vIl19.0VHdyp1w9PPFVI0FPheAwuKZwb5C25rwP-LPMXcSNoRmouvga1DZtNLA67ZzE_sAlc_VpaDRr6daLKr_Alw4347mw9sdjP8wKR27kCZa9JZK5PGQMmXHscATbzBEJYpCPklfyGaajgymqTBGnedcv8F0UvlRzQPsFeRPnVoX7BWOSXpMbyToGiXWkQLBQT7r96KAmLZOPJFZspPtjw-wH2mSL2WNa_nkB4j5vMGhGxlKiNRsKb30TH_WAel2hsxNlcPK3XHCmrMTYsNnu7HNqOTMn2i0__0rvBrhSWEw-_grqQDmWFJuWd7Qhi1q81AaJcdqgoSa_efz93QFclJUNw'\n ```\n\n## Deconstructing the Access Token\nA DTN Access Token carries information within its JWT Body that is available on every API call. By deconstructing the JWT token, our Access Tokens will resemble:\n ```\n {\n \"https://auth.dtn.com/customerId\": \"1234567890Demo\",\n \"https://auth.dtn.com/productCode\": \"DemoApiP\",\n \"https://auth.dtn.com/requesterIp\": \"18.213.174.27\",\n \"https://auth.dtn.com/rps\": \"100\",\n \"https://auth.dtn.com/tier\": \"Basic\",\n \"https://auth.dtn.com/quota\": \"999999\",\n \"iss\": \"https://id.auth.dtn.com/\",\n \"sub\": \"nfyO3KiKPR8N0DKR5CL8jS9GFBCDeyFM@clients\",\n \"aud\": \"https://demo-api.auth.dtn.com/\",\n \"iat\": 1656099068,\n \"exp\": 1656099158,\n \"azp\": \"nfyO3KiKPR8N0DKR5CL8jS9GFBCDeyFM\",\n \"scope\": \"read:demo create:demo update:demo\",\n \"gty\": \"client-credentials\",\n \"permissions\": [\n \"read:demo\",\n \"create:demo\",\n \"update:demo\"\n ]\n }\n ```\n### Description of Claims\n\n | Claim | Type | Description |\n | -----------------------------------| --------------------------------------------| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `https://auth.dtn.com/customerId` | String | Custom DTN claim containing the Customer ID found in the DTN Order Management/Salesforce system associated with this token. |\n | `https://auth.dtn.com/productCode` | String | Custom DTN claim containing the Identity product code associated with this token. |\n | `https://auth.dtn.com/requesterIp` | String | Custom DTN claim containing the IP address of the requesting client. |\n | `https://auth.dtn.com/rps` | String | Custom DTN claim containing the maximum rate per second this customer is authorized to utilize. |\n | `https://auth.dtn.com/tier` | String | Custom DTN claim containing the data tier the customer purchased for the requested access. |\n | `https://auth.dtn.com/quota` | String | Custom DTN claim containing the maximum yearly quota the customer purchased for calling DTN endpoints for the specific product. |\n | `iss` | String (URI) | The Security Token Service (STS) that issues and returns the token. If this value is not from `https://id.auth.dtn.com/`, the token should not be considered trusted. |\n | `sub` | String (URI) | The principle about which the token asserts information (the User ID or Client ID within the Identity Provider). A User ID will start with a prefix of `auth0\\|`, while the Client ID will end with the suffix `@clients`. |\n | `aud` | String \\| Array (Strings) (URI \\| [URI, …]) | Identifies the intended recipient(s) of the token – its audience. The token should be rejected if the audience does not contain values expected by the calling application. |\n | `iat` | Number (Timestamp) | “Issued At” indicates when the authentication for this token occurred. |\n | `exp` | Number (Timestamp) | The “expiration time” on or after which the JWT must not be accepted for processing. |\n | `azp` | String | The application/client ID of the client using the token. The application can cat as itself or on behalf of a user. |\n | `gty` | String (Space-delimited) | The grant type that was used to request the token – not an RFC 7519 registered claim (Auth0-specific). |\n | `permissions` | Array (Strings) | The grant type that was used to request the token – not an RFC 7519 registered claim (Auth0-specific). |\n\n "}}},"tags":[{"name":"Health","description":"Energy Sales & Marketing Integrations Health Check"},{"name":"Orders","description":"Energy Sales & Marketing Orders API"},{"name":"Pricing","description":"Energy Sales & Marketing Pricing API"},{"name":"Users","description":"Energy Sales & Marketing Users API"}]}