{"components":{"examples":{"AccountResponse":{"value":{"id":"gynger-unique-identifier","primaryAccountId":"your-client-unique-identifier","status":"PREQUALIFIED","deals":[{"id":"gynger-unique-identifier","externalDealId":"your-deal-identifier","name":"Deal 1","amount":100000,"stage":"Prospecting","closeDate":"2021-12-31"}]}},"PartnerWebhookResponse":{"value":{"id":"gynger-unique-identifier","url":"https://example.com","events":["offer.status.updated","account.status.updated"],"secret":"generated-secret-key"}},"CheckoutSessionResponse":{"value":{"id":"gynger-unique-identifier","expirationDate":"2024-10-31","amount":100000,"productDescription":"My Product Description","buyerEmail":"user@example.com","status":"CREATED","offerId":"gynger-offer-unique-identifier","accountId":"gynger-account-unique-identifier","createdAt":"2024-10-23"}},"SyncAccountRequest":{"value":{"id":"gynger-unique-identifier","primaryAccountId":"your-client-unique-identifier","crmAccountId":"001Ab00000XyZ12AAA","name":"Gynger","domain":"gynger.io","address":"123 Main St","city":"New York","state":"NY","postalCode":"10001","country":"USA","accountOwner":"John Doe","deals":[{"externalDealId":"your-deal-identifier","name":"Deal 1","amount":100000,"stage":"Prospecting","closeDate":"2021-12-31"}]}},"CreateWebhookRequest":{"value":{"url":"https://example.com","events":["account.status.updated","offer.status.updated"]}},"UpdateWebhookRequest":{"value":{"url":"https://example.com","events":["account.status.updated"]}},"CreateCheckoutSessionRequest":{"value":{"amount":100000,"productDescription":"My Product Description","buyerEmail":"user@example.com","expirationDate":"2024-10-31","autoBillCreation":true,"contractType":"SINGLE","subscriptionStartDate":"2024-11-01","billingStartDate":"2024-11-01","upfrontPaymentAmount":0,"numberOfPayments":12,"cardFeePercent":2.5}},"OfferStatusUpdatedEvent":{"value":{"type":"offer.status.updated","timestamp":"2021-01-01T00:00:00Z","data":{"id":"gynger-offer-unique-identifier","accountId":"gynger-client-unique-identifier","primaryAccountId":"your-client-unique-identifier","dealId":"gynger-deal-identifier","externalDealId":"your-deal-identifier","amount":100000,"status":"APPROVED","subStatus":"WAITING_FOR_CUSTOMER","link":"https://gynger.com/offer/1","checkoutSessionId":"checkout-session-token"}}},"AccountStatusUpdatedEvent":{"value":{"type":"account.status.updated","timestamp":"2021-01-01T00:00:00Z","data":{"id":"gynger-unique-identifier","primaryAccountId":"your-client-unique-identifier","availableCreditAmountDollars":100000,"status":"CREDIT_APPROVED","deals":[{"id":"gynger-unique-identifier","externalDealId":"your-deal-identifier","name":"Deal 1","amount":100000,"stage":"Prospecting","closeDate":"2021-12-31","checkoutSessionId":"checkout-session-token"}]}}},"CheckoutSessionStatusUpdatedEvent":{"value":{"type":"checkout.session.status.updated","timestamp":"2021-01-01T00:00:00Z","data":{"id":"gynger-unique-identifier","offerId":"unique-offer-identifier","accountId":"unique-account-identifier","productDescription":"Product description","status":"OFFER_CREATED","amount":100000,"buyerEmail":"buyer@example.com","expirationDate":"2024-01-02","createdAt":"2024-01-10"}}},"SubscriptionStatusUpdatedEvent":{"value":{"type":"subscription.status.updated","timestamp":"2021-01-01T00:00:00Z","data":{"id":"gynger-subscription-unique-identifier","customerAccountId":"gynger-client-unique-identifier","subscriptionName":"Acme subscription - 2024-01-01","amount":100000,"upfrontAmount":null,"subscriptionStartDate":"2024-01-01","startOnCustomerActivation":false,"billingStartDate":"2024-01-15","isOpenEnded":false,"numberOfPayments":12,"cardFeePercent":null,"status":"APPROVED","billingStatus":"ACTIVE","scheduledPayments":[],"link":"https://gynger.com/offer/1"}}}},"headers":{},"parameters":{},"requestBodies":{},"responses":{},"schemas":{"AccountStatus":{"enum":["PREQUALIFIED","NOT_QUALIFIED","NO_RESULT","PENDING","ACCOUNT_IN_REVIEW","APPLICATION_STARTED","AWAITING_CUSTOMER_INFO","CREDIT_APPROVED","CREDIT_DENIED"],"type":"string","properties":{}},"PartnerDealResponse":{"properties":{"id":{"type":"string","description":"Gynger unique identifier for the deal"},"externalDealId":{"type":"string","nullable":true,"description":"Your unique identifier for the deal"},"name":{"type":"string","nullable":true,"description":"Deal name"},"amount":{"type":"integer","format":"int32","nullable":true,"description":"The deal amount in cents"},"stage":{"type":"string","nullable":true,"description":"Deal stage"},"closeDate":{"type":"string","nullable":true,"description":"Deal close date"},"checkoutSessionId":{"type":"string","nullable":true,"description":"The associated checkout session if any"}},"required":["id"],"type":"object","additionalProperties":false},"AccountResponse":{"properties":{"id":{"type":"string","description":"Gynger unique identifier for the account"},"primaryAccountId":{"type":"string","nullable":true,"description":"Your unique identifier for the account"},"status":{"nullable":true,"description":"The pre-qualification result of the account","type":"string","enum":["PREQUALIFIED","NOT_QUALIFIED","NO_RESULT","PENDING","ACCOUNT_IN_REVIEW","APPLICATION_STARTED","AWAITING_CUSTOMER_INFO","CREDIT_APPROVED","CREDIT_DENIED"]},"deals":{"items":{"$ref":"#/components/schemas/PartnerDealResponse"},"type":"array","description":"List of deals created for the account"}},"required":["id","status","deals"],"type":"object","additionalProperties":false,"example":{"id":"gynger-unique-identifier","primaryAccountId":"your-client-unique-identifier","status":"PREQUALIFIED","deals":[{"id":"gynger-unique-identifier","externalDealId":"your-deal-identifier","name":"Deal 1","amount":100000,"stage":"Prospecting","closeDate":"2021-12-31"}]}},"IValidationError":{"properties":{"message":{"type":"string","enum":["Argument Validation Error"],"nullable":false},"details":{"anyOf":[{"type":"string"},{"properties":{},"additionalProperties":{},"type":"object"}]},"errorId":{"type":"string"}},"required":["message","details","errorId"],"type":"object","additionalProperties":false},"IAuthenticationError":{"properties":{"message":{"type":"string","enum":["Authentication Error"],"nullable":false},"details":{"anyOf":[{"type":"string"},{"properties":{},"additionalProperties":{},"type":"object"}]},"errorId":{"type":"string"}},"required":["message","details","errorId"],"type":"object","additionalProperties":false},"IRateLimitError":{"properties":{"message":{"type":"string","enum":["Too Many Requests"],"nullable":false},"details":{"type":"string","enum":["You have exceeded the rate limit for this endpoint. Please try again later."],"nullable":false},"errorId":{"type":"string"}},"required":["message","details","errorId"],"type":"object","additionalProperties":false},"SyncDealInput":{"properties":{"externalDealId":{"type":"string","description":"Deal unique identifier"},"name":{"type":"string","description":"Deal name"},"amount":{"type":"integer","format":"int32","description":"Deal amount in cents"},"stage":{"type":"string","description":"Deal stage"},"closeDate":{"type":"string","description":"Deal close date. Format: YYYY-MM-DD","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["externalDealId"],"type":"object","additionalProperties":false},"SyncAccountRequest":{"properties":{"id":{"type":"string","description":"Gynger unique identifier for the account"},"primaryAccountId":{"type":"string","description":"Your unique identifier for the account"},"crmAccountId":{"type":"string","description":"Your CRM's native identifier for the account, for example a Salesforce 18 character\nAccount Id. Matched against existing accounts before name or domain matching."},"name":{"type":"string","description":"Account name. This is a required field and will be used to match against existing accounts."},"domain":{"type":"string","description":"Account domain. If provided it will be used to match against existing accounts.","pattern":"^(?:https:\\/\\/)?[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z]{2,}$"},"accountOwner":{"type":"string","description":"Account owner"},"address":{"type":"string","description":"Account address line. Provide this field to increase the accuracy of the account matching."},"city":{"type":"string","description":"City, district, suburb, town, or village. Required along with state field if zip is not provided."},"state":{"type":"string","description":"US two-letter state code. Required along with city field if zip is not provided."},"country":{"type":"string","description":"Account country"},"postalCode":{"type":"string","description":"Account zip code. Required if city and state fields are not provided.","pattern":"^\\d{5}(?:(-)?\\d{4})?$"},"deals":{"items":{"$ref":"#/components/schemas/SyncDealInput"},"type":"array","description":"Account deals"}},"required":["name"],"type":"object","additionalProperties":false,"example":{"id":"gynger-unique-identifier","primaryAccountId":"your-client-unique-identifier","crmAccountId":"001Ab00000XyZ12AAA","name":"Gynger","domain":"gynger.io","address":"123 Main St","city":"New York","state":"NY","postalCode":"10001","country":"USA","accountOwner":"John Doe","deals":[{"externalDealId":"your-deal-identifier","name":"Deal 1","amount":100000,"stage":"Prospecting","closeDate":"2021-12-31"}]}},"CheckoutSessionStatus":{"enum":["CREATED","EXPIRED","OFFER_CREATED"],"type":"string","properties":{}},"CheckoutSessionResponse":{"properties":{"id":{"type":"string","description":"The ID of the checkout session"},"expirationDate":{"type":"string","description":"The expiration date of the checkout session, in the format YYYY-MM-DD"},"amount":{"type":"integer","format":"int32","description":"The purchase amount in cents"},"productDescription":{"type":"string","description":"Description of the product being purchased"},"buyerEmail":{"type":"string","nullable":true,"description":"The email of the buyer"},"status":{"allOf":[{"$ref":"#/components/schemas/CheckoutSessionStatus"}],"description":"The status of the checkout session"},"offerId":{"type":"string","nullable":true,"description":"The ID of the offer associated with the checkout session"},"accountId":{"type":"string","nullable":true,"description":"The ID of the account associated with the checkout session"},"createdAt":{"type":"string","description":"The date the checkout session was created"}},"required":["id","expirationDate","amount","productDescription","status","createdAt"],"type":"object","additionalProperties":false,"example":{"id":"gynger-unique-identifier","expirationDate":"2024-10-31","amount":100000,"productDescription":"My Product Description","buyerEmail":"user@example.com","status":"CREATED","offerId":"gynger-offer-unique-identifier","accountId":"gynger-account-unique-identifier","createdAt":"2024-10-23"}},"ContractType":{"enum":["SUBSCRIPTION","SINGLE"],"type":"string","properties":{}},"CreateCheckoutSessionRequest":{"properties":{"amount":{"type":"integer","format":"int32","description":"The purchase amount in cents"},"productDescription":{"type":"string","description":"Description of the product being purchased"},"buyerEmail":{"type":"string","description":"The email of the buyer. This will pre-fill the email field in Gynger sign-up page. They can still change it if they choose to","pattern":"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"},"expirationDate":{"type":"string","description":"The expiration date of the checkout session in format YYYY-MM-DD. If not provided, the expiration date will be set to 7 days from the current date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"autoBillCreation":{"type":"boolean","description":"Enables auto bill creation for the buyer from the checkout session. If disabled, the buyer will have to upload a bill in order to sign the loan and complete the purchase","default":true},"contractType":{"allOf":[{"$ref":"#/components/schemas/ContractType"}],"description":"The contract type for the checkout session. This will determine if the offer configured for one time billing or subscription. If not provided, the contract type will be set to SINGLE."},"subscriptionStartDate":{"type":"string","description":"The subscription start date in format YYYY-MM-DD. If not provided, the subscription will start immediately after the checkout session is completed. this field is required if contract type is SUBSCRIPTION","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"billingStartDate":{"type":"string","description":"The billing start date in format YYYY-MM-DD. If not provided, the billing will start immediately after the checkout session is completed.","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"upfrontPaymentAmount":{"type":"integer","format":"int32","description":"The upfront payment amount in cents. This will be charged immediately after the checkout session is completed. If not provided, no upfront payment will be charged","default":0},"numberOfPayments":{"type":"integer","format":"int32","description":"The number of payments for the subscription. This will determine the number of billing cycles for the subscription. If not provided, the subscription will be billed indefinitely until cancelled"},"cardFeePercent":{"type":"number","format":"double","description":"Card processing fee percent that will be charged to the buyer. This will be added on top of the purchase amount. If not provided, no card processing fee will be charged","default":0}},"required":["amount","productDescription"],"type":"object","additionalProperties":false,"example":{"amount":100000,"productDescription":"My Product Description","buyerEmail":"user@example.com","expirationDate":"2024-10-31","autoBillCreation":true,"contractType":"SINGLE","subscriptionStartDate":"2024-11-01","billingStartDate":"2024-11-01","upfrontPaymentAmount":0,"numberOfPayments":12,"cardFeePercent":2.5}},"PaymentFrequency":{"enum":["MONTHLY","QUARTERLY","SEMI_ANNUALLY","ANNUALLY","NET_TERMS","CUSTOM"],"type":"string","properties":{}},"TermOption":{"properties":{"id":{"type":"number","format":"double"},"uuid":{"type":"string"},"numberOfTerms":{"type":"number","format":"double"},"costPerPeriod":{"type":"number","format":"double"},"totalCost":{"type":"number","format":"double"},"feeAmount":{"type":"number","format":"double"},"feePercent":{"type":"number","format":"double"},"apr":{"type":"number","format":"double"},"yieldApr":{"type":"number","format":"double"},"loanAmount":{"type":"number","format":"double"},"firstPaymentDelayDays":{"type":"number","format":"double"},"unsubsidizedFeePercent":{"type":"number","format":"double"},"unsubsidizedFeeAmount":{"type":"number","format":"double"},"firstMonthFree":{"type":"boolean"}},"required":["id","uuid","numberOfTerms","costPerPeriod","totalCost","feeAmount","feePercent","apr","yieldApr","loanAmount"],"type":"object","additionalProperties":false},"FrequencyTermsOptions":{"properties":{"frequency":{"$ref":"#/components/schemas/PaymentFrequency"},"terms":{"items":{"$ref":"#/components/schemas/TermOption"},"type":"array"}},"required":["frequency","terms"],"type":"object","additionalProperties":false},"BillingOption":{"enum":["GYNGER_TERMS","VENDOR_TERMS","PAY_NOW","PAY_SCHEDULED","RECURRING"],"type":"string","properties":{}},"CheckoutTerms":{"properties":{"amountDollars":{"type":"number","format":"double"},"terms":{"items":{"$ref":"#/components/schemas/FrequencyTermsOptions"},"type":"array"},"billingOptions":{"items":{"$ref":"#/components/schemas/BillingOption"},"type":"array"}},"required":["amountDollars","terms","billingOptions"],"type":"object","additionalProperties":false},"SelectPaymentTermRequest":{"properties":{"termUuid":{"type":"string"}},"required":["termUuid"],"type":"object","additionalProperties":false},"OfferStatus":{"enum":["DRAFT","CREATED","VIEWED","APPLYING","APPROVED","ACTIVE","PAID","DECLINED","CANCELED"],"type":"string","properties":{}},"OfferSubStatus":{"enum":["WAITING_FOR_CUSTOMER","LOAN_SIGNED"],"type":"string","properties":{}},"PartnerOffer":{"properties":{"id":{"type":"string","description":"Gynger unique identifier for the offer"},"accountId":{"type":"string","description":"Gynger unique identifier for the client account"},"primaryAccountId":{"type":"string","nullable":true,"description":"Your unique identifier for the client account"},"dealId":{"type":"string","nullable":true,"description":"The associated Gynger deal ID"},"externalDealId":{"type":"string","nullable":true,"description":"Your associated deal ID if any"},"checkoutSessionId":{"type":"string","nullable":true,"description":"The associated checkout session ID if any"},"amount":{"type":"number","format":"double","nullable":true,"description":"The offer amount in cents"},"status":{"allOf":[{"$ref":"#/components/schemas/OfferStatus"}],"description":"The current status of the offer. For new offers, the status will be CREATED"},"subStatus":{"nullable":true,"description":"The underlying state of the offer while it is APPROVED. WAITING_FOR_CUSTOMER means credit is\napproved but the loan agreement has not been signed yet, LOAN_SIGNED means the customer has\nsigned. Null for every other status.","type":"string","enum":["WAITING_FOR_CUSTOMER","LOAN_SIGNED"]},"link":{"type":"string","description":"Offer link to share with the client"}},"required":["id","accountId","status","link"],"type":"object","additionalProperties":false},"AdvanceOfferStatusRequest":{"properties":{"status":{"$ref":"#/components/schemas/OfferStatus"}},"required":["status"],"type":"object","additionalProperties":false},"AdvanceAccountStatusRequest":{"properties":{"status":{"$ref":"#/components/schemas/AccountStatus"}},"required":["status"],"type":"object","additionalProperties":false},"AdvanceCheckoutSessionStatusRequest":{"properties":{"status":{"$ref":"#/components/schemas/CheckoutSessionStatus"}},"required":["status"],"type":"object","additionalProperties":false},"Events.OfferStatusUpdated":{"enum":["offer.status.updated"],"type":"string","properties":{}},"PartnerEvents":{"enum":["offer.status.updated","account.status.updated","checkout.session.status.updated","offer.receivable.processed","subscription.status.updated"],"type":"string","properties":{}},"OfferStatusUpdatedEvent":{"properties":{"type":{"$ref":"#/components/schemas/Events.OfferStatusUpdated"},"timestamp":{"type":"string"},"data":{"$ref":"#/components/schemas/PartnerOffer"}},"required":["type","timestamp","data"],"type":"object","additionalProperties":false,"example":{"type":"offer.status.updated","timestamp":"2021-01-01T00:00:00Z","data":{"id":"gynger-offer-unique-identifier","accountId":"gynger-client-unique-identifier","primaryAccountId":"your-client-unique-identifier","dealId":"gynger-deal-identifier","externalDealId":"your-deal-identifier","amount":100000,"status":"APPROVED","subStatus":"WAITING_FOR_CUSTOMER","link":"https://gynger.com/offer/1","checkoutSessionId":"checkout-session-token"}}},"Events.AccountStatusUpdated":{"enum":["account.status.updated"],"type":"string","properties":{}},"AccountStatusUpdatedData":{"properties":{"id":{"type":"string"},"primaryAccountId":{"type":"string","nullable":true},"availableCreditAmountDollars":{"type":"number","format":"double"},"status":{"$ref":"#/components/schemas/AccountStatus"},"deals":{"items":{"$ref":"#/components/schemas/PartnerDealResponse"},"type":"array"}},"required":["id","availableCreditAmountDollars","status","deals"],"type":"object","additionalProperties":false},"AccountStatusUpdatedEvent":{"properties":{"type":{"$ref":"#/components/schemas/Events.AccountStatusUpdated"},"timestamp":{"type":"string"},"data":{"$ref":"#/components/schemas/AccountStatusUpdatedData"}},"required":["type","timestamp","data"],"type":"object","additionalProperties":false,"example":{"type":"account.status.updated","timestamp":"2021-01-01T00:00:00Z","data":{"id":"gynger-unique-identifier","primaryAccountId":"your-client-unique-identifier","availableCreditAmountDollars":100000,"status":"CREDIT_APPROVED","deals":[{"id":"gynger-unique-identifier","externalDealId":"your-deal-identifier","name":"Deal 1","amount":100000,"stage":"Prospecting","closeDate":"2021-12-31","checkoutSessionId":"checkout-session-token"}]}}},"Events.CheckoutSessionStatusUpdated":{"enum":["checkout.session.status.updated"],"type":"string","properties":{}},"CheckoutSessionStatusUpdatedData":{"properties":{"id":{"type":"string","description":"The ID of the checkout session"},"expirationDate":{"type":"string","description":"The expiration date of the checkout session, in the format YYYY-MM-DD"},"amount":{"type":"integer","format":"int32","description":"The purchase amount in cents"},"productDescription":{"type":"string","description":"Description of the product being purchased"},"buyerEmail":{"type":"string","nullable":true,"description":"The email of the buyer"},"status":{"allOf":[{"$ref":"#/components/schemas/CheckoutSessionStatus"}],"description":"The status of the checkout session"},"offerId":{"type":"string","nullable":true,"description":"The ID of the offer associated with the checkout session"},"accountId":{"type":"string","nullable":true,"description":"The ID of the account associated with the checkout session"},"createdAt":{"type":"string","description":"The date the checkout session was created"}},"required":["id","expirationDate","amount","productDescription","status","createdAt"],"type":"object","additionalProperties":false},"CheckoutSessionStatusUpdatedEvent":{"properties":{"type":{"$ref":"#/components/schemas/Events.CheckoutSessionStatusUpdated"},"timestamp":{"type":"string"},"data":{"$ref":"#/components/schemas/CheckoutSessionStatusUpdatedData"}},"required":["type","timestamp","data"],"type":"object","additionalProperties":false,"example":{"type":"checkout.session.status.updated","timestamp":"2021-01-01T00:00:00Z","data":{"id":"gynger-unique-identifier","offerId":"unique-offer-identifier","accountId":"unique-account-identifier","productDescription":"Product description","status":"OFFER_CREATED","amount":100000,"buyerEmail":"buyer@example.com","expirationDate":"2024-01-02","createdAt":"2024-01-10"}}},"Events.SubscriptionStatusUpdated":{"enum":["subscription.status.updated"],"type":"string","properties":{}},"BillingScheduleStatus":{"enum":["CREATED","ACTIVE","COMPLETE","PENDING_VERIFICATION","FAILED","RETURNED","CANCELED","PAUSED"],"type":"string","properties":{}},"ScheduledPaymentStatus":{"enum":["SCHEDULED","PROCESSING","RECEIVED","OVERDUE","PAUSED","CANCELED"],"type":"string","properties":{}},"ScheduledPaymentType":{"enum":["REGULAR","UPFRONT","OVERAGE"],"type":"string","properties":{}},"ScheduledPaymentResponse":{"properties":{"id":{"type":"string","description":"Gynger unique identifier for the scheduled payment."},"amount":{"type":"number","format":"double","description":"Total payment amount in cents (USD)."},"paymentNumber":{"type":"number","format":"double","nullable":true,"description":"Sequential payment number within the subscription."},"status":{"allOf":[{"$ref":"#/components/schemas/ScheduledPaymentStatus"}],"description":"Current status of the scheduled payment."},"type":{"allOf":[{"$ref":"#/components/schemas/ScheduledPaymentType"}],"description":"Type of the scheduled payment."},"applyDate":{"type":"string","description":"Date the payment is scheduled to be collected, in YYYY-MM-DD format."}},"required":["id","amount","paymentNumber","status","type","applyDate"],"type":"object","additionalProperties":false},"SubscriptionResponse":{"properties":{"id":{"type":"string","description":"Gynger unique identifier for the subscription."},"customerAccountId":{"type":"string","description":"Gynger unique identifier for the customer account."},"subscriptionName":{"type":"string","nullable":true,"description":"Display name for the subscription."},"amount":{"type":"number","format":"double","description":"Monthly charge amount in cents (USD)."},"upfrontAmount":{"type":"number","format":"double","nullable":true,"description":"One-time setup fee in cents (USD), collected before recurring billing begins."},"subscriptionStartDate":{"type":"string","nullable":true,"description":"Date the subscription service began or will begin, in YYYY-MM-DD format."},"startOnCustomerActivation":{"type":"boolean","description":"Whether billing starts once the customer confirms their payment method."},"billingStartDate":{"type":"string","nullable":true,"description":"Date billing begins for the customer, in YYYY-MM-DD format."},"isOpenEnded":{"type":"boolean","description":"Whether the subscription renews indefinitely with no fixed end date (evergreen)."},"numberOfPayments":{"type":"number","format":"double","nullable":true,"description":"Number of monthly billing cycles for a fixed-term subscription."},"cardFeePercent":{"type":"number","format":"double","nullable":true,"description":"Percentage surcharge applied to customers who pay by card."},"status":{"allOf":[{"$ref":"#/components/schemas/OfferStatus"}],"description":"Current offer status of the subscription."},"billingStatus":{"allOf":[{"$ref":"#/components/schemas/BillingScheduleStatus"}],"description":"Current billing schedule status of the subscription."},"scheduledPayments":{"items":{"$ref":"#/components/schemas/ScheduledPaymentResponse"},"type":"array","description":"Scheduled payments for the subscription."},"link":{"type":"string","description":"Link to share with the customer to activate the subscription."}},"required":["id","customerAccountId","amount","startOnCustomerActivation","isOpenEnded","status","scheduledPayments","link"],"type":"object","additionalProperties":false},"SubscriptionStatusUpdatedEvent":{"properties":{"type":{"$ref":"#/components/schemas/Events.SubscriptionStatusUpdated"},"timestamp":{"type":"string"},"data":{"$ref":"#/components/schemas/SubscriptionResponse"}},"required":["type","timestamp","data"],"type":"object","additionalProperties":false,"example":{"type":"subscription.status.updated","timestamp":"2021-01-01T00:00:00Z","data":{"id":"gynger-subscription-unique-identifier","customerAccountId":"gynger-client-unique-identifier","subscriptionName":"Acme subscription - 2024-01-01","amount":100000,"upfrontAmount":null,"subscriptionStartDate":"2024-01-01","startOnCustomerActivation":false,"billingStartDate":"2024-01-15","isOpenEnded":false,"numberOfPayments":12,"cardFeePercent":null,"status":"APPROVED","billingStatus":"ACTIVE","scheduledPayments":[],"link":"https://gynger.com/offer/1"}}},"CrmContext":{"properties":{"accountId":{"type":"string","description":"Your CRM's native identifier for the account, for example a Salesforce 18 character Account Id.\nMatched against existing accounts before customerAccountId or customerDetails are considered."},"opportunityId":{"type":"string","description":"Your CRM's native identifier for the opportunity this offer belongs to.\nA deal is created or reused for this id and linked to the offer."}},"required":["accountId"],"type":"object","additionalProperties":false},"CustomerDetails":{"properties":{"customerEmail":{"type":"string","description":"The email of the customer","pattern":"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"},"customerAccountName":{"type":"string","description":"The name of the customer account\nrequired if customerDomain is not provided"},"customerDomain":{"type":"string","description":"The domain of the customer\nrequired if customerAccountName is not provided"}},"type":"object","additionalProperties":false},"OfferEmailRequest":{"properties":{"to":{"items":{"type":"string"},"type":"array","description":"The email addresses the offer is sent to. At least one address is required."},"cc":{"items":{"type":"string"},"type":"array","description":"The email addresses copied on the offer email. Unlike the app, the vendor's own\naddress is not added automatically."}},"required":["to"],"type":"object","additionalProperties":false},"CreateOfferRequest":{"properties":{"crm":{"allOf":[{"$ref":"#/components/schemas/CrmContext"}],"description":"The CRM record this offer originates from. When provided the offer is recorded as\nCRM sourced and linked back to the deal."},"customerAccountId":{"type":"string","description":"The unique identifier of the customer account for which the offer is being created\nIf not provided, customer details will be used to find or create a customer account"},"customerDetails":{"allOf":[{"$ref":"#/components/schemas/CustomerDetails"}],"description":"The details of the customer for which the offer is being created"},"offerName":{"type":"string","description":"The name of the offer"},"paymentTemplateId":{"type":"string","description":"The payment template id to be used for the offer\nIf not provided, the vendor's default API template will be used, or the first payment template created for the vendor if none is set"},"upfrontAmount":{"type":"integer","format":"int32","description":"The upfront payment amount in cents","default":0},"amount":{"type":"integer","format":"int32","description":"The receivable bill amount in cents"},"dueDate":{"type":"string","description":"The due date of the bill in format YYYY-MM-DD","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"invoiceNumber":{"type":"string","description":"The invoice number"},"invoiceBase64":{"type":"string","description":"Invoice file in base64. Optional, but fileName must be provided alongside it."},"fileName":{"type":"string","description":"File name of the invoice. Required when invoiceBase64 is provided."},"email":{"allOf":[{"$ref":"#/components/schemas/OfferEmailRequest"}],"description":"When provided, the offer email is sent to these recipients once the offer is created.\nOmit it and no email is sent."}},"required":["amount"],"type":"object","additionalProperties":false},"SuccessResponse":{"properties":{"success":{"type":"boolean","description":"Operation was successful"}},"required":["success"],"type":"object","additionalProperties":false},"CreateSubscriptionRequest":{"properties":{"customerAccountId":{"type":"string","description":"Unique identifier of an existing customer account.\nIf omitted, `customerDetails` will be used to find or create one."},"customerDetails":{"allOf":[{"$ref":"#/components/schemas/CustomerDetails"}],"description":"Details used to look up or create a customer account.\nRequired if `customerAccountId` is not provided."},"subscriptionName":{"type":"string","description":"Display name for the subscription, visible in the vendor dashboard."},"amount":{"type":"integer","format":"int32","description":"Monthly charge amount in cents (USD)."},"upfrontAmount":{"type":"integer","format":"int32","description":"One-time setup fee in cents (USD), collected before recurring billing begins.","default":0},"subscriptionStartDate":{"type":"string","description":"Date the subscription service began or will begin, in YYYY-MM-DD format.\nCan be set to a past date if the subscription is already active but only now being billed through Gynger.","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startOnCustomerActivation":{"type":"boolean","description":"When true, billing starts once the customer confirms their payment method and recurs monthly from that date.\nWhen false, `billingStartDate` must be provided.","default":false},"billingStartDate":{"type":"string","description":"Date to begin billing the customer, in YYYY-MM-DD format.\nRequired if `startOnCustomerActivation` is false.","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"isOpenEnded":{"type":"boolean","description":"When true, the subscription renews indefinitely with no fixed end date (evergreen).\nWhen false, the subscription runs for a fixed term defined by `billingCycles`.","default":false},"numberOfPayments":{"type":"integer","format":"int32","description":"Number of monthly billing cycles for a fixed-term subscription.\nRequired when `isOpenEnded` is false."},"contractBase64":{"type":"string","description":"Contract document in base64-encoded format."},"fileName":{"type":"string","description":"File name of the contract document (e.g. \"contract.pdf\")."},"cardFeePercent":{"type":"number","format":"double","description":"Percentage surcharge applied to customers who pay by card.\nAllows the vendor to pass through Stripe card processing fees to the customer."},"email":{"allOf":[{"$ref":"#/components/schemas/OfferEmailRequest"}],"description":"When provided, the subscription email is sent to these recipients once the subscription is\ncreated. Omit it and no email is sent."}},"required":["amount"],"type":"object","additionalProperties":false},"Events":{"enum":["offer.status.updated","account.status.updated","checkout.session.status.updated","offer.receivable.processed","subscription.status.updated"],"type":"string","properties":{}},"PartnerWebhookResponse":{"properties":{"id":{"type":"string","description":"Gynger unique identifier for the webhook"},"url":{"type":"string","description":"The URL that Gynger will send the webhook to"},"secret":{"type":"string","description":"The secret Gynger uses to sign webhook deliveries. Each delivery includes an\n`x-gynger-signature` header formatted as `t=<unix timestamp>,v1=<hex hmac-sha256>`, where the\nhmac is computed over `${timestamp}.${rawRequestBody}`. For backward compatibility the raw\nsecret is also still sent as the `authorization` header, but new integrations should verify\n`x-gynger-signature` instead."},"events":{"items":{"$ref":"#/components/schemas/Events"},"type":"array","description":"The events the webhook will subscribe to"}},"required":["id","url","secret","events"],"type":"object","additionalProperties":false,"example":{"id":"gynger-unique-identifier","url":"https://example.com","events":["offer.status.updated","account.status.updated"],"secret":"generated-secret-key"}},"CreateWebhookRequest":{"properties":{"url":{"type":"string","description":"The URL that Gynger will send the webhook to","pattern":"^https?:\\/\\/[^\\s\\/$.?#].[^\\s]*$"},"events":{"items":{"$ref":"#/components/schemas/Events"},"type":"array","description":"The events that Gynger will send the webhook for"}},"required":["url","events"],"type":"object","additionalProperties":false,"example":{"url":"https://example.com","events":["account.status.updated","offer.status.updated"]}},"UpdateWebhookRequest":{"properties":{"url":{"type":"string","description":"The URL that Gynger will send the webhook to","pattern":"^https?:\\/\\/[^\\s\\/$.?#].[^\\s]*$"},"events":{"items":{"$ref":"#/components/schemas/Events"},"type":"array","description":"The events that Gynger will send the webhook for"}},"type":"object","additionalProperties":false,"example":{"url":"https://example.com","events":["account.status.updated"]}}},"securitySchemes":{"apiKey":{"type":"apiKey","name":"Authorization","in":"header"},"publicKey":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v1/accounts/{accountId}":{"get":{"operationId":"getAccount","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Get account details by Gynger ID or primary account ID","tags":["Accounts"],"security":[{"apiKey":[]}],"parameters":[{"description":"either gynger id or primaryAccountId","in":"path","name":"accountId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"summary":"Get account details by Gynger ID or primary account ID"}},"/v1/accounts":{"put":{"operationId":"syncAccount","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Sync account and deals with Gynger. Use this endpoint to either add new accounts or update existing accounts using your primary account ID. If account ID is not provided Gynger will try to match your data to an existing account before creating a new one.","tags":["Accounts"],"security":[{"apiKey":[]}],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncAccountRequest"}}}},"summary":"Sync account and deals with Gynger"}},"/v1/checkout/sessions":{"post":{"operationId":"createCheckoutSession","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Create a checkout session","tags":["Checkout"],"security":[{"apiKey":[]}],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionRequest"}}}},"summary":"Create a checkout session"}},"/v1/checkout/sessions/{sessionId}":{"get":{"operationId":"getCheckoutSession","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"tags":["Checkout"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"sessionId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"summary":"Get checkout session"}},"/v1/sandbox/offers/{offerId}/status":{"put":{"operationId":"advanceOfferStatus","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOffer"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Advance Offer Status","tags":["Testing"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"offerId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your sandbox secret API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceOfferStatusRequest"}}}},"summary":"Advance Offer Status"}},"/v1/sandbox/accounts/{accountId}/status":{"put":{"operationId":"advanceAccountStatus","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Advance account status. Account status changes must follow a sequential order.\nThe following account status transitions are allowed: `PENDING` -> `PREQUALIFIED` | `NOT_QUALIFIED` | `NO_RESULT` -> `APPLICATION_STARTED` -> `ACCOUNT_IN_REVIEW` -> `CREDIT_APPROVED` | `CREDIT_DENIED`","tags":["Testing"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"accountId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your sandbox secret API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceAccountStatusRequest"}}}},"summary":"Advance account status"}},"/v1/sandbox/checkout/sessions/{sessionId}/status":{"put":{"operationId":"advanceCheckoutSessionStatus","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Advance checkout session status. Checkout status changes must follow a sequential order.\nThe following checkout status transitions are allowed: `CREATED` -> `OFFER_CREATED` | `EXPIRED`","tags":["Testing"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"sessionId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your sandbox secret API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceCheckoutSessionStatusRequest"}}}},"summary":"Advance checkout session status"}},"/v1/offers":{"post":{"operationId":"createOffer","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOffer"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Create a new offer","tags":["Offers"],"security":[{"apiKey":[]}],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOfferRequest"}}}},"summary":"Create a new offer"}},"/v1/offers/{offerId}/upload-receivable":{"post":{"operationId":"uploadReceivable","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Upload a receivable PDF file to an offer","tags":["Offers"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"offerId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"summary":"Upload a receivable PDF file to an offer"}},"/v1/subscriptions":{"post":{"operationId":"createSubscription","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Create a new subscription for a customer. Subscriptions represent recurring billing arrangements\nwhere the customer is charged a fixed monthly amount.","tags":["Subscriptions"],"security":[{"apiKey":[]}],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionRequest"}}}},"summary":"Create a new subscription for a customer"}},"/v1/webhooks":{"post":{"operationId":"CreateWebhook","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerWebhookResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Create a webhook","tags":["Webhooks"],"security":[{"apiKey":[]}],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"summary":"Create a webhook"},"get":{"operationId":"ListWebhooks","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PartnerWebhookResponse"},"type":"array"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"List all webhooks","tags":["Webhooks"],"security":[{"apiKey":[]}],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"summary":"List all webhooks"}},"/v1/webhooks/{webhookId}":{"put":{"operationId":"UpdateWebhook","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerWebhookResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Update a webhook","tags":["Webhooks"],"security":[{"apiKey":[]}],"parameters":[{"description":"Gynger unique identifier for the webhook","in":"path","name":"webhookId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequest"}}}},"summary":"Update a webhook"},"delete":{"operationId":"DeleteWebhook","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"Delete a webhook","tags":["Webhooks"],"security":[{"apiKey":[]}],"parameters":[{"description":"Gynger unique identifier for the webhook","in":"path","name":"webhookId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Your secret API key"}],"summary":"Delete a webhook"}}},"servers":[{"url":"https://api.gynger.io","description":"Production"},{"url":"https://sandbox.api.gynger.io","description":"Sandbox"}],"openapi":"3.0.0","info":{"version":"1.0.0","title":"Gynger API","description":"Gynger Partner API for accounts, checkout sessions, offers, subscriptions, and webhooks.","contact":{"name":"Gynger","url":"https://gynger.io"},"x-logo":{"url":"https://storage.googleapis.com/gynger-344819.appspot.com/gynger/gynger-docs.svg"}},"x-webhooks":{"/webhooks/offer-status-updated":{"post":{"operationId":"offer.status.updated","responses":{"200":{"description":"Ok"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"The event will be triggered when the status of an offer is updated.","tags":["Events"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferStatusUpdatedEvent"}}}},"summary":"The event will be triggered when the status of an offer is updated"}},"/webhooks/account-status-updated":{"post":{"operationId":"account.status.updated","responses":{"200":{"description":"Ok"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"The event will be triggered when the status of an account is updated.","tags":["Events"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountStatusUpdatedEvent"}}}},"summary":"The event will be triggered when the status of an account is updated"}},"/webhooks/checkout-session-status-updated":{"post":{"operationId":"checkout.session.status.updated","responses":{"200":{"description":"Ok"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"The event will be triggered when the status of a checkout session is updated.","tags":["Events"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionStatusUpdatedEvent"}}}},"summary":"The event will be triggered when the status of a checkout session is updated"}},"/webhooks/subscription-status-updated":{"post":{"operationId":"subscription.status.updated","responses":{"200":{"description":"Ok"},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IValidationError"}}}},"401":{"description":"Authentication Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuthenticationError"}}}},"429":{"description":"Rate Limit Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRateLimitError"}}}}},"description":"The event will be triggered when the billing status of a subscription is updated.","tags":["Events"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionStatusUpdatedEvent"}}}},"summary":"The event will be triggered when the billing status of a subscription is updated"}}},"tags":[{"name":"Introduction","description":"Gynger API for vendors allows Gynger's vendor partners to embed payment terms offers into their workflows. Key use cases for the API:\n\n#### **Support \"Pay with Gynger\" checkout widget**\nYou can embed a `Pay with Gynger` widget within online checkout pages to handle all billing needs with your customers - whether annual/one-time billing or monthly recurring billing. You can collect payment upfront, allow flexible payments over time with or without financing, or charge for a monthly subscription.\n\n#### **Create payment offers**\nYou can create payment offers for invoices with flexible payment terms - with or without financing, or for monthly subscriptions. You'll receive a payment link you can share with customers anywhere in your workflow.\n\n#### **Get credit approval and payment status updates**\nYou can subscribe to webhook events to receive real-time updates on customer account approvals and status changes on their payment terms offers. This enables you to keep track of your customers' progress and take necessary actions when required from within your CRM, accounting systems, etc.\n\n#### **Sync Accounts from your CRM and run pre-qualification**\nYou can sync CRM accounts and run credit pre-qualification checks prior to offering them payment terms. Pre-qualification statuses of accounts are shown to users within the Gynger vendor app and can also be synced back into corresponding CRM records.\n"},{"name":"Getting started","description":"To get started with ***Gynger API***, your secret API key can be generated within **Integrations → API**. Your API key must be kept secure and only be used in server-side code.\nThe API server is available at `https://api.gynger.io`.\n\n<br></br>\nYou can request creation of a Sandbox account within **Integrations → API**. Access will be granted automatically to Gynger's sandbox environment, which will allow you to test your integration end to end.\n"},{"name":"API keys","description":"Gynger authenticates your API requests using API keys. Each request must include a valid API key to be processed successfully. If a request is missing a key or includes an invalid, deleted, or revoked key, Gynger will return an authentication error.\n#### **Secret API Key**\nYour secret API key is used to authenticate server-side requests and should be kept secure. Never expose your secret key in client-side code, browser environments, or publicly accessible repositories.\n\n#### **Public API Key**\nThe public API key is intended for client-side usage, specifically for initializing the `Pay with Gynger` checkout widget. This key is safe to use in your frontend code but should not be used for server-side requests.\n\n### **Accessing API Keys**\nYou can find and manage your API keys in the [Gynger Dashboard](https://app.gynger.io/integrations/api) by navigating to ***Integrations &rarr; API***.\n"},{"name":"Checkout widget","description":"The Gynger Checkout Widget allows vendors to offer flexible payment and billing options directly within their checkout flows by integrating a `Pay with Gynger` button. It supports multiple offer types, enabling customers to pay invoices or subscriptions through Gynger using different payment configurations.\n\n# Overview\n\n| Offer Type                        | Description                                                         |\n|-----------------------------------|---------------------------------------------------------------------|\n| Gynger financing | Gynger provides financing, allowing the customer to pay over time.                                           |\n| Pay Now                           | Customer pays the full amount upfront through Gynger.                                  |\n| Monthly Subscription              | Recurring monthly billing handled via Gynger for subscriptions.                                |\n| Pay with Terms (no financing)     | Vendor extends payment terms through Gynger  without financing. |\n\n# Checkout widget flow\nWhen customers click `Pay with Gynger`, the checkout flow varies based on the widget configuration:\n\n- **Gynger financing**\n  Vendors can optionally display a **Terms preview** within the widget before redirecting the customer to the Gynger checkout page. During checkout, the customer is prompted to create a Gynger account to submit a credit application. Both the **Offer status** and the corresponding **Account status** can then be tracked throughout the lifecycle, and customer credit approval is required before the offer can be accepted.\n\n- **Pay Now, Monthly Subscription**, and **Pay with Terms (no financing)**\n  Customers are redirected directly to a white-labeled Gynger checkout page to complete payment or set up auto-debit. These offer types do not require credit approval and therefore only include **Offer status** tracking.\n\n### Offer Statuses\n\n| Status     | Description                                                         |\n|------------|---------------------------------------------------------------------|\n| `CREATED`  | Offer has been created                                              |\n| `VIEWED`   | Offer has been viewed by the user                                   |\n| `APPLYING` | Customer is actively progressing through the credit application or is under review. |\n| `APPROVED` | Customer is approved for credit, loan signature and disbursement are next. |\n| `ACTIVE`   | Offer has been activated (payments scheduled or in progress).                                           |\n| `PAID`     | The bill or subscription associated with the offer has been fully paid.                    |\n| `DECLINED` | Offer has been declined by the user                                 |\n\n#### Approved sub-statuses\n\nWhile an offer is `APPROVED`, the `subStatus` field denotes where the customer is within that state. It is `null` for every other offer status, and is included on the `offer.status.updated` webhook payload.\n\n| Sub-status             | Description                                                          |\n|------------------------|----------------------------------------------------------------------|\n| `WAITING_FOR_CUSTOMER` | Credit is approved, but the loan agreement has not been signed yet.  |\n| `LOAN_SIGNED`          | Customer has signed the loan agreement.                              |\n\n### Account Statuses\n\n| Status                | Description                                         |\n|-----------------------|-----------------------------------------------------|\n| `PENDING`               | Account pre-qualification is in progress.           |\n| `PREQUALIFIED`          | Account is prequalified based on initial review.    |\n| `NOT_QUALIFIED`         | Account is not qualified after review.              |\n| `NO_RESULT`             | No results were found during the pre-qualification. |\n| `APPLICATION_STARTED`   | Financing application initiated.                    |\n| `ACCOUNT_IN_REVIEW`     | Account under review for credit approval.           |\n| `CREDIT_APPROVED`       | Credit approved.            |\n| `CREDIT_DENIED`         | Credit denied.              |\n\n\nWhen an account is created through the checkout flow, it skips the pre-qualification step and begins at APPLICATION_STARTED. A Gynger financing offer cannot be accepted until the customer’s account reaches `CREDIT_APPROVED`.\n\n# Checkout widget integration\n\n### 1. Embedding the checkout widget\n\nInclude the Gynger Checkout script in your HTML file to load the widget from the CDN:\n```html\n<script src=\"https://storage.googleapis.com/gynger-checkout-widget/gynger-checkout.bundle.js\"></script>\n```\n### 2. Creating a checkout session\n\nFrom your backend, [create a checkout session](#tag/Checkout/operation/createCheckoutSession) using your Gynger API Secret Key. Each session corresponds to one offer and returns a session ID required for initializing the widget.\n\n### 3. Initializing the widget\n\nInitialize the widget client-side with your public API key and the session token:\n```javascript\nGyngerCheckout.initWidget({\n  token: '<checkout-session-id>',  // Replace with session id returned from createCheckoutSession request\n  publicKey: '<public_key>',       // Your public key\n  containerId: 'gynger-checkout-widget',\n  mode: 'sandbox', // Options: 'sandbox', 'production' (default: 'production')\n  onError: (message) => {\n    console.error(message);\n    alert('Error: ' + message);\n  },\n  previewEnabled: true, // Optional: Enable terms preview for 'Pay with Terms' offers (default: true)\n  styles: {\n    size: 'large',            // Options: 'small', 'medium', 'large' (default: 'medium')\n    borderRadius: 'round',    // Options: 'none', 'slight', 'round' (default: 'none')\n    theme: 'dark',            // Options: 'light', 'dark' (default: 'dark')\n    border: 'solid'           // Options: 'solid', 'none' (default: 'none')\n  }\n});\n```\n### 4. Terms template configuration\n\nAll checkout sessions that are offering payment terms default to the ‘Default Payment Link’ payment terms template. Vendors can override this template within Integrations → API to apply a different template for the widget.\n\n### Widget configuration options\n\n| **Option**            | **Description**                                        | **Possible Values**                            |\n|-----------------------|--------------------------------------------------------|------------------------------------------------|\n| `token`               | The session id generated from the checkout session API | Valid session id (required)                    |\n| `publicKey`           | Your public API key                                    | Your public API key (required)                 |\n| `containerId`         | The CSS selector for the widget container element      | Any valid CSS selector (required)              |\n| `mode`                | The mode of the widget                                 | `sandbox`, `production` (default)              |\n| `previewEnabled`      | Enable preview of financing terms                      | Boolean value (default: true)                  |\n| `onError`             | Callback function to handle errors                     | Any valid function, default: `console.error()` |\n| `styles.size`         | Size of the widget                                     | `small`, `medium` (default), `large`           |\n| `styles.borderRadius` | Controls the roundness of the widget corners           | `none` (default), `slight`, `round`            |\n| `styles.theme`        | Theme of the widget                                    | `light`, `dark` (default)                      |\n| `styles.border`       | Border style of the widget                             | `solid`, `none` (default)                      |\n\n---\n\n### React integration example\nYou can create a React component to encapsulate the widget initialization logic and render the widget in your React application.\nHere is an example of a React component that initializes the Gynger checkout widget:\n```typescript\nimport React, { useRef, useEffect } from 'react';\n\ninterface GyngerWidgetProps {\n  token: string;\n  publicKey: string;\n  containerId?: string;\n  mode?: 'production' | 'sandbox';\n  onError: (error: any) => any;\n  styles: {\n    size?: 'small' | 'medium' | 'large';\n    borderRadius?: 'none' | 'slight' | 'round';\n    theme?: 'light' | 'dark';\n    border?: 'solid' | 'none';\n  };\n}\n\nexport function GyngerCheckoutWidget(props: GyngerWidgetProps) {\n  const containerRef = useRef(null);\n\n  useEffect(() => {\n    if (containerRef.current) {\n      GyngerCheckout.initWidget(props);\n    }\n  }, [props]);\n\n  return (\n    <div\n      id={props.containerId || 'gynger-checkout-widget'}\n      ref={containerRef}\n    ></div>\n  );\n}\n```\nThen you can use the component in your React application like this:\n```typescript\nimport { GyngerCheckoutWidget } from './GyngerCheckoutWidget';\n\nexport const CheckoutPage = () => (\n  <div>\n    <h1>Checkout Page</h1>\n    <GyngerCheckoutWidget\n      token=\"<checkout-session-id>\"\n      publicKey=\"<public_key>\"\n      mode=\"sandbox\"\n      onError={(error) => console.error(error)}\n      styles={{\n        size: 'large',\n        borderRadius: 'round',\n        theme: 'dark',\n        border: 'solid'\n      }}\n    />\n  </div>\n);\n```"},{"name":"Testing","description":"# Getting started with Gynger Sandbox\n\nGynger provides you with a sandbox environment to test your integration. The sandbox environment allows you to test the API without affecting your production environment.\n\nTo begin using the Gynger sandbox environment, follow these steps:\n\n#### **1. Request access**\nRequest your sandbox account within the Gynger app by going to Integrations → API.\n\n#### **2. Accessing sandbox**\nYour account will be automatically created once requested. To access your sandbox account, click the 'Open Sandbox' button within Integrations → API.\n\n#### **3. Test the API**\nTest the Gynger API and add webhook subscribers in your backend code. You can download the openAPI specification [here](https://api.gynger.io/spec). Be sure to set the provided sandbox API key as the authorization header for all API requests.\nThe sandbox api server is available at `https://sandbox.api.gynger.io`.\n\n#### **4. Test the checkout widget**\nYou can test the checkout widget by embedding it in your test environment using `sandbox` mode. Follow the instructions in the [checkout widget integration guide](#tag/Checkout-widget/Checkout-widget-integration) to get started.\n\n\n# Testing the checkout flow\n\nTo test the checkout flow and ensure you're receiving webhook events for status transitions, follow these steps:\n\n#### **1. Create a checkout session:**\nCreate a checkout session using the [`createCheckoutSession` endpoint](#tag/Checkout/operation/createCheckoutSession). This request will generate a unique session id which you can then use to trigger specific status transitions.\n\n#### **2. Use the Advance Checkout Session Status endpoint:**\nWhen customers click the `Pay with Gynger` button, they will be redirected to the Gynger sign-up page for buyers. After they complete the sign-up, an account record will be created for their organization, and an offer will be generated and associated with the checkout session.\nAt this stage, the checkout session status will be `OFFER_CREATED`. You can simulate this status transition using the [`advanceCheckoutSessionStatus` sandbox endpoint](#tag/Testing/operation/advanceCheckoutSessionStatus), with the session id from the previous step. The response will include the `offerId`, which can be used to advance the offer status to other states.\nOnce the account and offer are created, you will be able to view them in your sandbox dashboard.\n\n#### **3. Use the Advance Offer Status endpoint:**\nYou can simulate changes in the offer status using a dedicated sandbox API endpoint (without the need to complete buyer sign-up and onboarding).\nUse the `offerId` obtained from the previous step to advance the offer status to `OFFER_VIEWED`, `OFFER_DECLINED`, `OFFER_APPROVED`, or `BILL_PAID` using the [`advanceOfferStatus` sandbox endpoint](#tag/Testing/operation/advanceOfferStatus).\nYou can expect to receive webhook events for each status transition, and the status changes will also be reflected in your sandbox dashboard.\n\n\n\n# Testing Account statuses\n\nTo test pre-qualification flows and ensure you're receiving webhook events for status transitions, you have two options:\n\n#### **1. Create accounts using specific zip codes**  \n   When creating accounts through the sandbox app, you can use the following zip codes to trigger specific status transitions:\n\n\n| Status                | Zip Code Override      |\n|-----------------------|------------------------|\n| `PENDING`             | 10001                  |\n| `PREQUALIFIED`        | 10002                  |\n| `NOT_QUALIFIED`       | 10003                  |\n| `NO_RESULT`           | 10004                  |\n| `APPLICATION_STARTED` | 10005                  |\n| `ACCOUNT_IN_REVIEW`   | 10006                  |\n| `CREDIT_APPROVED`     | 10007                  |\n| `CREDIT_DENIED`       | 10008                  |\n\n\n\n\n\n#### **2. Use the Advance Account Status endpoint**  \n   You can also use the [`advanceAccountStatus` sandbox endpoint](#tag/Testing/operation/advanceAccountStatus) to simulate specific status transitions.\n   To obtain the account id needed for the request, you can create an account using the sandbox app and retrieve the account id from the route, when navigating to the account details page.\n"},{"name":"Events","description":"Gynger will trigger webhook events upon changes in Account and Offer statuses as your customers are interacting with the offer through the Gynger buyer app."},{"name":"Accounts","description":"The following endpoints allow you to add, update and retrieve Accounts and associated Deals within your Gynger instance."},{"name":"Webhooks","description":"Specify the event types you want to subscribe to, and the URL where you want to receive the webhook notifications."}],"x-tagGroups":[{"name":"How to guides","tags":["Introduction","Getting started","API keys","Checkout widget","Testing"]},{"name":"Webhook Events","tags":["Events"]},{"name":"API","tags":["Accounts","Checkout","Offers","Subscriptions","Webhooks"]}]}