VayuDocumentationIntegrationsAPI ReferenceChange Log
SupportGet started now
API EndpointsContracts

Refresh the credit grants on a contract

Use this endpoint to refresh the credit grants on a contract by creating a new contract phase (a contract revision) that takes effect immediately. Provide a list of credit grants to refresh in the request body — each is identified by its credit product (credit type) id and is set to non-prorated in the new phase, optionally with a new price. Every other credit grant on the contract is set to prorated. If the grants list is omitted, all credit grants on the contract are refreshed (set to non-prorated). If a supplied credit product matches more than one grant product on the contract and a newPrice is provided, the request is rejected because the price cannot be applied unambiguously.

POST
/contracts/{contractId}/credits/refresh

Authorization

BearerAuthorizer
AuthorizationBearer <token>

In: header

Path Parameters

contractId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

grants?array<>

The credit grants to refresh. Each refreshed grant is set to non-prorated (and optionally re-priced), while every other credit grant on the contract is set to prorated. If omitted, all credit grants on the contract are refreshed (set to non-prorated) and none are prorated.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/contracts/string/credits/refresh" \  -H "Content-Type: application/json" \  -d '{}'
{  "contractId": "string"}
{  "type": "invalid_request_error",  "code": "string",  "message": "string",  "param": "string",  "params": [    {      "param": "string",      "message": "string"    }  ]}
{  "type": "authentication_error",  "code": "authentication_failed",  "message": "string"}
{  "type": "rate_limit_error",  "code": "rate_limit_exceeded",  "message": "string"}
{  "type": "api_error",  "code": "internal_error",  "message": "string"}