Stripe Payment
Endpoints for Stripe Payment
Endpoints for Stripe Payment
GET/api/v1/payments/stripe/publishable-key
Authentication: Bearer token (JWT)
tenantIdnumberRequiredpublishableKeystringRequired{
"publishableKey": "<publishableKey>"
}unauthorized
messageCodestringRequiredmessagestringstripeConfigurationMissing
messageCodestringRequired"stripeConfigurationMissing"messagestringpaymentProviderRequestInvalid
messageCodestringRequired"paymentProviderRequestInvalid"messagestringpaymentProviderUnavailable
messageCodestringRequired"paymentProviderUnavailable"messagestringcurlcurl 'https://api.subrite.no/api/v1/payments/stripe/publishable-key?tenantId=%3CtenantId%3E' \
--header 'Authorization: Bearer <token>'POST/api/v1/payments/stripe/intent
Authentication: Bearer token (JWT)
user-agentstringRequiredapplication/jsonpackageIdnumberRequiredminimum: POST/api/v1/payments/stripe/order-intent
Authentication: Bearer token (JWT)
application/jsonorderIdnumberRequiredminimum: 1phonestringOptionalpaymentTokenPOST/api/v1/payments/stripe/setup-intent
Authentication: Bearer token (JWT)
application/jsonsubscriptionIdnumberRequiredminimum: 1POST/api/v1/payments/stripe/recurrent-payments
Authentication: Bearer token (JWT)
This response has no body.
unauthorized
POST/api/v1/payments/stripe/webhook/{tenantId}
Authentication: Bearer token (JWT)
tenantIdnumberRequiredPATCH/api/v1/payments/stripe/card-info
Authentication: Bearer token (JWT)
idnumberRequiredThis response has no body.
errorsarray of FieldErrorRequirederrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}errorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "stripeConfigurationMissing",
"message": "string",
"errors": [
{}
]
}errorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "paymentProviderRequestInvalid",
"message": "string",
"errors": [
{}
]
}errorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "paymentProviderUnavailable",
"message": "string",
"errors": [
{}
]
}1isSavedbooleanRequiredoptionalProductsarray of OptionalProductWithQuantityOptional2 required when the containing object is present4 fieldsoptionalProductsproductIdnumberRequired when parent is presentField path: optionalProducts[].productIdminimum: 1quantitynumberRequired when parent is presentField path: optionalProducts[].quantityminimum: 1shippingCountrystringOptionalField path: optionalProducts[].shippingCountrymaxLength: 64manualPricenumberOptionalField path: optionalProducts[].manualPriceuserDataCheckoutUserRequired15 fieldsuserDatamemberIdstringOptionalField path: userData.memberIdemailstring (email)OptionalField path: userData.emailfullNamestringRequiredField path: userData.fullNamephonestringOptionalField path: userData.phonemaxLength: 20payerPhonestringOptionalField path: userData.payerPhonemaxLength: 20countryCodestringOptionalField path: userData.countryCode"NO", "SE", "DK", "FI", "FO", "GB"isCompanybooleanOptionalField path: userData.isCompanycompanyNamestringOptionalField path: userData.companyNameorganizationNostringOptionalField path: userData.organizationNoreferencestringOptionalField path: userData.referenceonCheckoutCompletedUrlstringOptionalField path: userData.onCheckoutCompletedUrluserAgentstringOptionalField path: userData.userAgentchannelstringOptionalField path: userData.channel"mobile", "desktop"sourceUrlstringOptionalField path: userData.sourceUrlreferrerUrlstringOptionalField path: userData.referrerUrlbillingAddressBillingAddressOptional3 required when the containing object is present11 fieldsbillingAddressaddressstringRequired when parent is presentField path: billingAddress.addressaddressTwostringOptionalField path: billingAddress.addressTwocompanyNamestringOptionalField path: billingAddress.companyNameorganizationNostringOptionalField path: billingAddress.organizationNopostCodestringRequired when parent is presentField path: billingAddress.postCodecitystringOptionalField path: billingAddress.citycountrystringRequired when parent is presentField path: billingAddress.countryinvoiceReferencestringOptionalField path: billingAddress.invoiceReferenceemailstringOptionalField path: billingAddress.emailfullNamestringOptionalField path: billingAddress.fullNamephonestringOptionalField path: billingAddress.phone{
"packageId": 1,
"isSaved": true,
"userData": {
"memberId": "string",
"email": "user@example.com",
"fullName": "<fullName>",
"phone": "<phone>",
"payerPhone": "<payerPhone>",
"countryCode": "NO",
"isCompany": true,
"companyName": "string",
"organizationNo": "string",
"reference": "string",
"onCheckoutCompletedUrl": "string",
"userAgent": "string",
"channel": "mobile",
"sourceUrl": "string",
"referrerUrl": "string"
},
"billingAddress": {
"address": "<address>",
"addressTwo": "<addressTwo>",
"companyName": "string",
"organizationNo": "string",
"postCode": "string",
"city": "string",
"country": "string",
"invoiceReference": "string",
"email": "string",
"fullName": "<fullName>",
"phone": "<phone>"
}
}clientSecretstringRequiredcheckoutStateUuidstring{
"clientSecret": "<clientSecret>",
"checkoutStateUuid": "string"
}unauthorized
Same fields as Get the publishable key for stripe (401).
forbidden
messageCodestringRequired"forbidden"messagestringstripeConfigurationMissing
Same fields as Get the publishable key for stripe (404).
aSubscriptionForThisPackageAlreadyExistsForThisMember, aCheckoutForThisPackageIsAlreadyInProgressForThisMember, checkoutPhoneHasAccount
messageCodestringRequired"aSubscriptionForThisPackageAlreadyExistsForThisMember", "aCheckoutForThisPackageIsAlreadyInProgressForThisMember", "checkoutPhoneHasAccount"paymentProviderRequestInvalid
Same fields as Get the publishable key for stripe (422).
paymentProviderUnavailable
Same fields as Get the publishable key for stripe (502).
curlcurl https://api.subrite.no/api/v1/payments/stripe/intent \
--request POST \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'user-agent: <user-agent>' \
--data '{
"packageId": 1,
"isSaved": true,
"optionalProducts": [
{}
],
"userData": {
"memberId": "string",
"email": "user@example.com",
"fullName": "<fullName>",
"phone": "<phone>",
"payerPhone": "<payerPhone>",
"countryCode": "NO",
"isCompany": true,
"companyName": "string",
"organizationNo": "string",
"reference": "string",
"onCheckoutCompletedUrl": "string",
"userAgent": "string",
"channel": "mobile",
"sourceUrl": "string",
"referrerUrl": "string"
},
"billingAddress": {
"address": "<address>",
"addressTwo": "<addressTwo>",
"companyName": "string",
"organizationNo": "string",
"postCode": "string",
"city": "string",
"country": "string",
"invoiceReference": "string",
"email": "string",
"fullName": "<fullName>",
"phone": "<phone>"
}
}'string (uuid){
"orderId": 1,
"phone": "<phone>",
"paymentToken": "<paymentToken>"
}Same fields as Create a new stripe payment intent (201).
{
"clientSecret": "<clientSecret>",
"checkoutStateUuid": "string"
}unauthorized
Same fields as Get the publishable key for stripe (401).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl https://api.subrite.no/api/v1/payments/stripe/order-intent \
--request POST \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"orderId": 1,
"phone": "<phone>",
"paymentToken": "<paymentToken>"
}'CreateSetupIntentDto{
"subscriptionId": 1
}Same fields as Create a new stripe payment intent (201).
{
"clientSecret": "<clientSecret>",
"checkoutStateUuid": "string"
}unauthorized
Same fields as Get the publishable key for stripe (401).
stripeConfigurationMissing
Same fields as Get the publishable key for stripe (404).
paymentProviderRequestInvalid
Same fields as Get the publishable key for stripe (422).
paymentProviderUnavailable
Same fields as Get the publishable key for stripe (502).
curlcurl https://api.subrite.no/api/v1/payments/stripe/setup-intent \
--request POST \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"subscriptionId": 1
}'This response has no body.
forbiddenResource
Same fields as Get the publishable key for stripe (401).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl https://api.subrite.no/api/v1/payments/stripe/recurrent-payments \
--request POST \
--header 'Authorization: Bearer <token>'checkoutStateUuidstringRequiredstatusstringRequired"pending", "succeeded", "failed"{
"checkoutStateUuid": "string",
"status": "pending"
}unauthorized
Same fields as Get the publishable key for stripe (401).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/payments/stripe/webhook/{tenantId}' \
--request POST \
--header 'Authorization: Bearer <token>'unauthorized
This response has no body.
forbiddenResource
Same fields as Get the publishable key for stripe (401).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/payments/stripe/card-info?id=%3Cid%3E' \
--request PATCH \
--header 'Authorization: Bearer <token>'{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}errorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "forbidden",
"message": "string",
"errors": [
{}
]
}{
"messageCode": "stripeConfigurationMissing",
"message": "string",
"errors": [
{}
]
}messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "aSubscriptionForThisPackageAlreadyExistsForThisMember",
"message": "string",
"errors": [
{}
]
}{
"messageCode": "paymentProviderRequestInvalid",
"message": "string",
"errors": [
{}
]
}{
"messageCode": "paymentProviderUnavailable",
"message": "string",
"errors": [
{}
]
}{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}{
"messageCode": "stripeConfigurationMissing",
"message": "string",
"errors": [
{}
]
}{
"messageCode": "paymentProviderRequestInvalid",
"message": "string",
"errors": [
{}
]
}{
"messageCode": "paymentProviderUnavailable",
"message": "string",
"errors": [
{}
]
}