New customer checkout
This API takes minimal offering configuration and optionally payment method information to provision a contract.
POST/api/selfService/checkout
operation: provisionContract
Request body
type CreateOfferingItemRequest = {
productId: string;
quantity: number;
}
type CreateOfferingRequest = {
offeringId: string;
rateId: string;
}
type PaymentConfiguration = {
paymentToken: string;
paymentGatewayId: string;
}
type NewCustomerCheckoutRequest = {
accountId: string;
currency: string;
offerings: CreateOfferingRequest[];
startDate: Iso8601DateString;
endDate?: Iso8601DateString;
payment?: PaymentConfiguration;
}Response body
Errors
| Error description | Error code |
|---|---|
| Account ID nonexistent | INVALID_ACCOUNT |
| Request contains no offerings | EMPTY_OFFERINGS |
| Request contains nonexistent offerings | INVALID_OFFERINGS |
| Request contains nonexistent rates | INVALID_RATES |
| Specified rates belong to other accounts | ACCOUNT_RATE_MISMATCH |
| Specified end date of contract is greater than the start date | INVALID_CONTRACT_END_DATE |
| Pricing of offerings failed due to validation error(s) | PRICE_OFFERINGS_FAILED |
Success
type NewContractCheckoutResponse = {
accountId: string;
contractId: string;
billGroupId: string;
paymentMethod?: {
id: string;
type: string;
externalId: string;
};
}paymentMethod.idwould be a MonetizeNow ID for your optionally supplied payment methodpaymentMethod.externalIdwould be the ID of the payment method in the payment gateway (e.g. Stripe) you've configured
Updated about 3 hours ago