PayUp Merchant Admin API (1.0.0)
Download OpenAPI specification:Download
Administrative API used by the PayUp merchant dashboard. All routes live
under /api/merchant/v1.
Except for the explicitly public endpoints (register, verify-email,
resend-verification, login, password, passkey login, OAuth, invite
validate, currency reads/conversion, and gateway request webhooks), every
endpoint requires a merchant JWT as Authorization: Bearer <jwt>. Obtain
the JWT from POST /auth/login, POST /auth/verify-email, 2FA/passkey
verify, or OAuth — not from register.
Merchant-scoped routes also require X-Merchant-Id.
Register a merchant user
Request Body schema: application/json
| email required | string <email> |
| password required | string >= 8 characters |
| name required | string non-empty |
| company | string Accepted by validation but not persisted on register. |
Responses
Request samples
- Payload
{- "email": "merchant@example.com",
- "password": "ChangeMe123!",
- "name": "Ada Lovelace"
}Response samples
- 201
- 400
{- "verificationToken": "string",
- "email": "user@example.com",
- "message": "string"
}Verify registration email with OTP
Request Body schema: application/json
| verificationToken required | string |
| code required | string |
Responses
Request samples
- Payload
{- "verificationToken": "ver_abc123",
- "code": "123456"
}Response samples
- 200
- 400
{- "user": {
- "id": "string",
- "email": "user@example.com",
- "name": "string",
- "photo": "string",
- "companyName": "string",
- "isActive": true,
- "paymentMode": "string",
- "settings": {
- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "token": "string"
}Log in
Request Body schema: application/json
| email required | string <email> |
| password required | string >= 8 characters |
Responses
Request samples
- Payload
{- "email": "merchant@example.com",
- "password": "ChangeMe123!"
}Response samples
- 200
- 401
{- "user": {
- "id": "string",
- "email": "user@example.com",
- "name": "string",
- "photo": "string",
- "companyName": "string",
- "isActive": true,
- "paymentMode": "string",
- "settings": {
- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "token": "string"
}Response samples
- 200
- 401
{- "id": "string",
- "email": "user@example.com",
- "name": "string",
- "photo": "string",
- "companyName": "string",
- "isActive": true,
- "paymentMode": "string",
- "settings": {
- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update the current user profile
Authorizations:
Request Body schema: application/json
| name | string |
| company | string Request field. Response maps this to companyName. |
object |
Responses
Request samples
- Payload
{- "name": "Ada Lovelace",
- "company": "Example LLC"
}Response samples
- 200
{- "id": "string",
- "email": "user@example.com",
- "name": "string",
- "photo": "string",
- "companyName": "string",
- "isActive": true,
- "paymentMode": "string",
- "settings": {
- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
- 401
{- "user": {
- "id": "string",
- "email": "user@example.com",
- "name": "string",
- "photo": "string",
- "companyName": "string",
- "isActive": true,
- "paymentMode": "string",
- "settings": {
- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "token": "string"
}Verify TOTP code and enable 2FA
Authorizations:
Request Body schema: application/json
| code required | string = 6 characters |
Responses
Request samples
- Payload
{- "code": "123456"
}Response samples
- 200
- 400
{- "message": "string",
- "backupCodes": [
- "string"
], - "warning": "string"
}Complete 2FA challenge and issue JWT
Request Body schema: application/json
| challengeToken required | string |
| code required | string [ 6 .. 8 ] characters |
| type | string Default: "totp" Enum: "totp" "backup" |
Responses
Request samples
- Payload
{- "challengeToken": "ch_abc123",
- "code": "123456",
- "type": "totp"
}Response samples
- 200
- 401
{- "user": {
- "id": "string",
- "email": "user@example.com",
- "name": "string",
- "photo": "string",
- "companyName": "string",
- "isActive": true,
- "paymentMode": "string",
- "settings": {
- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "token": "string"
}Verify passkey registration
Authorizations:
Request Body schema: application/json
| challengeKey required | string |
required | object |
| deviceName | string |
Responses
Request samples
- Payload
{- "challengeKey": "pkc_abc123",
- "deviceName": "MacBook",
- "response": {
- "id": "credential-id",
- "type": "public-key"
}
}Response samples
- 200
- 400
{ }Generate WebAuthn authentication options
Request Body schema: application/json
string <email> | |
| challengeToken | string |
| resetToken | string Password-reset token when registering a passkey during reset. |
Responses
Request samples
- Payload
{- "email": "merchant@example.com"
}Response samples
- 200
{ }Verify passkey authentication and issue JWT
Request Body schema: application/json
| challengeKey required | string |
required | object |
Responses
Request samples
- Payload
{- "challengeKey": "pkc_abc123",
- "response": {
- "id": "credential-id",
- "type": "public-key"
}
}Response samples
- 200
- 401
{- "user": {
- "id": "string",
- "email": "user@example.com",
- "name": "string",
- "photo": "string",
- "companyName": "string",
- "isActive": true,
- "paymentMode": "string",
- "settings": {
- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "token": "string"
}Reset password with token
Request Body schema: application/json
| token required | string |
| password required | string >= 8 characters |
| confirmPassword required | string >= 8 characters |
object | |
object |
Responses
Request samples
- Payload
{- "token": "rst_abc123",
- "password": "NewPass123!",
- "confirmPassword": "NewPass123!"
}Response samples
- 200
- 400
{ }Response samples
- 200
{- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}Update account settings
Authorizations:
Request Body schema: application/json
object (UserSecuritySettings) | |
object (UserNotificationSettings) | |
object (UserDisplaySettings) | |
object (UserPrivacySettings) |
Responses
Request samples
- Payload
{- "display": {
- "theme": "system",
- "language": "en"
}
}Response samples
- 200
{- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}Update security settings group
Authorizations:
Request Body schema: application/json
| twoFactorMethod | string Enum: "totp" "passkey" "none" |
| requireTwoFactorForPayments | boolean |
| sessionTimeout | integer >= 1 |
| loginNotifications | boolean |
| allowedIPs | Array of strings |
| rememberDevices | boolean |
| maxActiveSessions | integer >= 1 |
Responses
Request samples
- Payload
{- "twoFactorMethod": "totp",
- "sessionTimeout": 30
}Response samples
- 200
{- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}Update notification preferences group
Authorizations:
Request Body schema: application/json
| emailOnPaymentReceived | boolean |
| emailOnPaymentFailed | boolean |
| emailOnNewCustomer | boolean |
| emailOnGatewayDown | boolean |
| emailOnSecurityAlert | boolean |
| weeklyReport | boolean |
| marketingEmails | boolean |
Responses
Request samples
- Payload
{- "emailOnPaymentReceived": true,
- "weeklyReport": true
}Response samples
- 200
{- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}Update display settings group
Authorizations:
Request Body schema: application/json
| theme | string Enum: "light" "dark" "system" |
| primaryColor | string |
| language | string |
| timezone | string |
| dateFormat | string |
| numberFormat | string |
Responses
Request samples
- Payload
{- "theme": "system",
- "language": "en"
}Response samples
- 200
{- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}Update privacy settings group
Authorizations:
Request Body schema: application/json
| showActivityLog | boolean |
| shareAnalytics | boolean |
Responses
Request samples
- Payload
{- "showActivityLog": true,
- "shareAnalytics": false
}Response samples
- 200
{- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}Response samples
- 200
{- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}Reset a settings group to defaults
Authorizations:
path Parameters
| group required | string Enum: "security" "notifications" "display" "privacy" |
Responses
Response samples
- 200
- 400
{- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}Response samples
- 200
{- "id": "string",
- "email": "user@example.com",
- "name": "string",
- "photo": "string",
- "companyName": "string",
- "isActive": true,
- "paymentMode": "string",
- "settings": {
- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update the current user profile
Authorizations:
Request Body schema: application/json
| name | string |
| company | string |
object |
Responses
Request samples
- Payload
{- "name": "Ada Lovelace",
- "company": "Example LLC"
}Response samples
- 200
{- "id": "string",
- "email": "user@example.com",
- "name": "string",
- "photo": "string",
- "companyName": "string",
- "isActive": true,
- "paymentMode": "string",
- "settings": {
- "security": {
- "twoFactorMethod": "totp",
- "requireTwoFactorForPayments": true,
- "sessionTimeout": 1,
- "loginNotifications": true,
- "allowedIPs": [
- "string"
], - "rememberDevices": true,
- "maxActiveSessions": 1
}, - "notifications": {
- "emailOnPaymentReceived": true,
- "emailOnPaymentFailed": true,
- "emailOnNewCustomer": true,
- "emailOnGatewayDown": true,
- "emailOnSecurityAlert": true,
- "weeklyReport": true,
- "marketingEmails": true
}, - "display": {
- "theme": "light",
- "primaryColor": "string",
- "language": "string",
- "timezone": "string",
- "dateFormat": "string",
- "numberFormat": "string"
}, - "privacy": {
- "showActivityLog": true,
- "shareAnalytics": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
[- {
- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "crNumber": "string",
- "vatNumber": "string",
- "country": "string",
- "city": "string",
- "address": "string",
- "postalCode": "string",
- "companyLogoMediaId": "string",
- "documents": [
- {
- "_id": "string",
- "docType": "commercial_registration",
- "name": "string",
- "url": "string",
- "key": "string",
- "mimeType": "string",
- "size": 0,
- "uploadedAt": "2019-08-24T14:15:22Z"
}
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Create a company
Authorizations:
Request Body schema: application/json
| name required | string |
| crNumber required | string |
| vatNumber | string |
| country required | string |
| city required | string |
| address required | string |
| postalCode required | string |
| companyLogoMediaId | string |
Responses
Request samples
- Payload
{- "name": "Example LLC",
- "crNumber": "1010123456",
- "country": "SA",
- "city": "Riyadh",
- "address": "King Fahd Rd",
- "postalCode": "11564"
}Response samples
- 201
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "crNumber": "string",
- "vatNumber": "string",
- "country": "string",
- "city": "string",
- "address": "string",
- "postalCode": "string",
- "companyLogoMediaId": "string",
- "documents": [
- {
- "_id": "string",
- "docType": "commercial_registration",
- "name": "string",
- "url": "string",
- "key": "string",
- "mimeType": "string",
- "size": 0,
- "uploadedAt": "2019-08-24T14:15:22Z"
}
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
- 404
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "crNumber": "string",
- "vatNumber": "string",
- "country": "string",
- "city": "string",
- "address": "string",
- "postalCode": "string",
- "companyLogoMediaId": "string",
- "documents": [
- {
- "_id": "string",
- "docType": "commercial_registration",
- "name": "string",
- "url": "string",
- "key": "string",
- "mimeType": "string",
- "size": 0,
- "uploadedAt": "2019-08-24T14:15:22Z"
}
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a company
Authorizations:
path Parameters
| id required | string |
Request Body schema: application/json
| name | string |
| crNumber | string |
| vatNumber | string |
| country | string |
| city | string |
| address | string |
| postalCode | string |
| companyLogoMediaId | string |
Responses
Request samples
- Payload
{- "name": "Example LLC",
- "city": "Jeddah"
}Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "crNumber": "string",
- "vatNumber": "string",
- "country": "string",
- "city": "string",
- "address": "string",
- "postalCode": "string",
- "companyLogoMediaId": "string",
- "documents": [
- {
- "_id": "string",
- "docType": "commercial_registration",
- "name": "string",
- "url": "string",
- "key": "string",
- "mimeType": "string",
- "size": 0,
- "uploadedAt": "2019-08-24T14:15:22Z"
}
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Upload a company document
Authorizations:
path Parameters
| id required | string |
Request Body schema: multipart/form-data
| file required | string <binary> |
| docType required | string |
Responses
Request samples
- Payload
{ "docType": "commercial_registration" }
Response samples
- 201
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "crNumber": "string",
- "vatNumber": "string",
- "country": "string",
- "city": "string",
- "address": "string",
- "postalCode": "string",
- "companyLogoMediaId": "string",
- "documents": [
- {
- "_id": "string",
- "docType": "commercial_registration",
- "name": "string",
- "url": "string",
- "key": "string",
- "mimeType": "string",
- "size": 0,
- "uploadedAt": "2019-08-24T14:15:22Z"
}
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Remove a company document
Authorizations:
path Parameters
| id required | string |
| docId required | string |
Responses
Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "crNumber": "string",
- "vatNumber": "string",
- "country": "string",
- "city": "string",
- "address": "string",
- "postalCode": "string",
- "companyLogoMediaId": "string",
- "documents": [
- {
- "_id": "string",
- "docType": "commercial_registration",
- "name": "string",
- "url": "string",
- "key": "string",
- "mimeType": "string",
- "size": 0,
- "uploadedAt": "2019-08-24T14:15:22Z"
}
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Create a merchant workspace
Auth only (no X-Merchant-Id). Creates the merchant and an owner membership.
Authorizations:
Request Body schema: application/json
| name required | string |
| slug required | string URL-safe slug matching |
Responses
Request samples
- Payload
{- "name": "Example Merchant",
- "slug": "example-merchant"
}Response samples
- 201
{- "_id": "string",
- "name": "string",
- "slug": "string",
- "logo": "string",
- "status": "active",
- "website": "string",
- "description": "string",
- "industry": "string",
- "address": "string",
- "phone": "string",
- "timezone": "string",
- "contactName": "string",
- "contactEmail": "string",
- "contactPhone": "string",
- "onboardingCompleted": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
[- {
- "_id": "string",
- "userId": "string",
- "merchantId": {
- "_id": "string",
- "name": "string",
- "slug": "string",
- "logo": "string",
- "status": "active",
- "website": "string",
- "description": "string",
- "industry": "string",
- "address": "string",
- "phone": "string",
- "timezone": "string",
- "contactName": "string",
- "contactEmail": "string",
- "contactPhone": "string",
- "onboardingCompleted": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "role": "owner",
- "joinedAt": "2019-08-24T14:15:22Z",
- "invitedBy": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Response samples
- 200
{- "_id": "string",
- "name": "string",
- "slug": "string",
- "logo": "string",
- "status": "active",
- "website": "string",
- "description": "string",
- "industry": "string",
- "address": "string",
- "phone": "string",
- "timezone": "string",
- "contactName": "string",
- "contactEmail": "string",
- "contactPhone": "string",
- "onboardingCompleted": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update the current merchant (owner or admin)
Authorizations:
Request Body schema: application/json
| name | string |
| logo | string |
| website | string |
| description | string |
| industry | string |
| address | string |
| phone | string |
| timezone | string |
| contactName | string |
| contactEmail | string |
| contactPhone | string |
Responses
Request samples
- Payload
{- "name": "Example Merchant",
}Response samples
- 200
{- "_id": "string",
- "name": "string",
- "slug": "string",
- "logo": "string",
- "status": "active",
- "website": "string",
- "description": "string",
- "industry": "string",
- "address": "string",
- "phone": "string",
- "timezone": "string",
- "contactName": "string",
- "contactEmail": "string",
- "contactPhone": "string",
- "onboardingCompleted": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
{- "_id": "string",
- "name": "string",
- "slug": "string",
- "logo": "string",
- "status": "active",
- "website": "string",
- "description": "string",
- "industry": "string",
- "address": "string",
- "phone": "string",
- "timezone": "string",
- "contactName": "string",
- "contactEmail": "string",
- "contactPhone": "string",
- "onboardingCompleted": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
[- {
- "_id": "string",
- "userId": {
- "_id": "string",
- "name": "string",
- "email": "string",
- "photo": "string"
}, - "merchantId": "string",
- "role": "owner",
- "joinedAt": "2019-08-24T14:15:22Z",
- "invitedBy": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Change a member role (owner or admin)
Authorizations:
path Parameters
| memberId required | string |
Request Body schema: application/json
| role required | string Enum: "admin" "member" "developer" |
Responses
Request samples
- Payload
{- "role": "developer"
}Response samples
- 200
{- "_id": "string",
- "userId": "string",
- "merchantId": "string",
- "role": "owner",
- "joinedAt": "2019-08-24T14:15:22Z",
- "invitedBy": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
[- {
- "_id": "string",
- "merchantId": "string",
- "email": "user@example.com",
- "role": "admin",
- "token": "string",
- "expiresAt": "2019-08-24T14:15:22Z",
- "invitedBy": "string",
- "status": "pending",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Invite a member (owner or admin)
Authorizations:
Request Body schema: application/json
| email required | string <email> |
| role required | string Enum: "admin" "member" "developer" |
Responses
Request samples
- Payload
{- "email": "teammate@example.com",
- "role": "developer"
}Response samples
- 201
{- "_id": "string",
- "merchantId": "string",
- "email": "user@example.com",
- "role": "admin",
- "token": "string",
- "expiresAt": "2019-08-24T14:15:22Z",
- "invitedBy": "string",
- "status": "pending",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Accept an invite (authenticated user)
Authorizations:
path Parameters
| token required | string |
Responses
Response samples
- 200
{- "merchant": {
- "_id": "string",
- "name": "string",
- "slug": "string",
- "logo": "string",
- "status": "active",
- "website": "string",
- "description": "string",
- "industry": "string",
- "address": "string",
- "phone": "string",
- "timezone": "string",
- "contactName": "string",
- "contactEmail": "string",
- "contactPhone": "string",
- "onboardingCompleted": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "membership": {
- "_id": "string",
- "userId": "string",
- "merchantId": "string",
- "role": "owner",
- "joinedAt": "2019-08-24T14:15:22Z",
- "invitedBy": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}Refund a payment
Authorizations:
path Parameters
| paymentId required | string |
Request Body schema: application/json
| amountMinor | integer <int64> > 0 |
| reason required | string [ 1 .. 500 ] characters |
Responses
Request samples
- Payload
{- "amountMinor": 1000,
- "reason": "Customer requested refund"
}Response samples
- 200
- 400
{- "refundId": "string",
- "amount": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "status": "init",
- "reason": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
[- {
- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "description": "string",
- "isActive": true,
- "brandName": "string",
- "brandLogo": "string",
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "settings": {
- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Create an app
Authorizations:
Request Body schema: application/json
| name required | string |
| description | string |
| brandName | string |
| brandLogo | string or null <uri> |
| showProducts | boolean |
| showCurrencySelector | boolean |
| showTaxElement | boolean |
| showCustomerElement | boolean |
| showAddressElement | boolean |
| showShipping | boolean |
| showPayment | boolean |
Responses
Request samples
- Payload
{- "name": "Storefront",
- "description": "Primary checkout app",
- "brandName": "Example"
}Response samples
- 201
- 400
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "description": "string",
- "isActive": true,
- "brandName": "string",
- "brandLogo": "string",
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "settings": {
- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "keyPairs": [
- {
- "environment": "sandbox",
- "publicKey": "string",
- "secretKey": "string",
- "secretKeyPrefix": "string",
- "secretKeyLast4": "string"
}
]
}Paginated app list
Authorizations:
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
| isActive | string Enum: "true" "false" |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Paginated lite app list for dropdowns
Authorizations:
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Response samples
- 200
- 404
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "description": "string",
- "isActive": true,
- "brandName": "string",
- "brandLogo": "string",
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "settings": {
- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update an app
Authorizations:
path Parameters
| appId required | string |
Request Body schema: application/json
| name | string |
| description | string |
| brandName | string |
| brandLogo | string or null <uri> |
| showProducts | boolean |
| showCurrencySelector | boolean |
| showTaxElement | boolean |
| showCustomerElement | boolean |
| showAddressElement | boolean |
| showShipping | boolean |
| showPayment | boolean |
Responses
Request samples
- Payload
{- "name": "Storefront",
- "brandName": "Example"
}Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "name": "string",
- "description": "string",
- "isActive": true,
- "brandName": "string",
- "brandLogo": "string",
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "settings": {
- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}Update app settings
Authorizations:
path Parameters
| appId required | string |
Request Body schema: application/json
object (AppBrandingSettings) | |
object (AppCheckoutSettings) | |
object (AppPaymentSettings) | |
object (AppNotificationSettings) | |
object (AppSecuritySettings) | |
object (AppIntegrationSettings) |
Responses
Request samples
- Payload
{- "checkout": {
- "requireCustomerVerification": true,
- "verificationMethod": "email"
}
}Response samples
- 200
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}Update app branding settings
Authorizations:
path Parameters
| appId required | string |
Request Body schema: application/json
| primaryColor | string |
| secondaryColor | string |
| accentColor | string |
| fontFamily | string |
| borderRadius | string |
| logoPosition | string Enum: "left" "center" |
Responses
Request samples
- Payload
{- "primaryColor": "#0F766E",
- "logoPosition": "left"
}Response samples
- 200
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}Update app checkout settings
Authorizations:
path Parameters
| appId required | string |
Request Body schema: application/json
| showProducts | boolean |
| showCurrencySelector | boolean |
| showTaxElement | boolean |
| showCustomerElement | boolean |
| showAddressElement | boolean |
| showShipping | boolean |
| showPayment | boolean |
| requireCustomerVerification | boolean |
| verificationMethod | string Enum: "email" "mobile" "both" |
| allowGuestCheckout | boolean |
| autoRedirectOnSuccess | boolean |
| successUrl | string |
| cancelUrl | string |
Responses
Request samples
- Payload
{- "requireCustomerVerification": true,
- "verificationMethod": "email",
}Response samples
- 200
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}Update app payment settings
Authorizations:
path Parameters
| appId required | string |
Request Body schema: application/json
| defaultCurrency | string |
| allowedCurrencies | Array of strings |
| minimumAmountMinor | integer <int64> >= 0 |
| maximumAmountMinor | integer <int64> >= 0 |
| autoCapture | boolean |
| refundPolicy | string Enum: "full" "partial" "none" |
| refundWindow | number >= 0 |
Responses
Request samples
- Payload
{- "defaultCurrency": "SAR",
- "autoCapture": true
}Response samples
- 200
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}Update app notification settings
Authorizations:
path Parameters
| appId required | string |
Request Body schema: application/json
| sendCustomerReceipt | boolean |
| sendMerchantAlert | boolean |
| webhookRetryAttempts | integer >= 0 |
| webhookRetryInterval | integer >= 0 |
Responses
Request samples
- Payload
{- "sendCustomerReceipt": true,
- "sendMerchantAlert": true
}Response samples
- 200
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}Update app security settings
Authorizations:
path Parameters
| appId required | string |
Request Body schema: application/json
| allowedDomains | Array of strings |
| enforceHttps | boolean |
| rateLimitPerMinute | integer >= 0 |
| enableFraudDetection | boolean |
| blockVpn | boolean |
Responses
Request samples
- Payload
{- "enforceHttps": true,
}Response samples
- 200
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}Update app integration settings
Authorizations:
path Parameters
| appId required | string |
Request Body schema: application/json
| sdkVersion | string |
| apiVersion | string |
| testMode | boolean |
| debugMode | boolean |
Responses
Request samples
- Payload
{- "testMode": true,
- "debugMode": false
}Response samples
- 200
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}Reset all app settings to defaults
Authorizations:
path Parameters
| appId required | string |
Responses
Response samples
- 200
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}Reset an app settings group to defaults
Authorizations:
path Parameters
| appId required | string |
| group required | string Enum: "branding" "checkout" "payment" "notifications" "security" "integration" |
Responses
Response samples
- 200
- 400
{- "branding": {
- "primaryColor": "string",
- "secondaryColor": "string",
- "accentColor": "string",
- "fontFamily": "string",
- "borderRadius": "string",
- "logoPosition": "left"
}, - "checkout": {
- "showProducts": true,
- "showCurrencySelector": true,
- "showTaxElement": true,
- "showCustomerElement": true,
- "showAddressElement": true,
- "showShipping": true,
- "showPayment": true,
- "requireCustomerVerification": true,
- "verificationMethod": "email",
- "allowGuestCheckout": true,
- "autoRedirectOnSuccess": true,
- "successUrl": "string",
- "cancelUrl": "string"
}, - "payment": {
- "defaultCurrency": "string",
- "allowedCurrencies": [
- "string"
], - "minimumAmountMinor": 0,
- "maximumAmountMinor": 0,
- "autoCapture": true,
- "refundPolicy": "full",
- "refundWindow": 0
}, - "notifications": {
- "sendCustomerReceipt": true,
- "sendMerchantAlert": true,
- "webhookRetryAttempts": 0,
- "webhookRetryInterval": 0
}, - "security": {
- "allowedDomains": [
- "string"
], - "enforceHttps": true,
- "rateLimitPerMinute": 0,
- "enableFraudDetection": true,
- "blockVpn": true
}, - "integration": {
- "sdkVersion": "string",
- "apiVersion": "string",
- "testMode": true,
- "debugMode": true
}
}List masked API keys for an app
Authorizations:
path Parameters
| appId required | string |
Responses
Response samples
- 200
[- {
- "environment": "sandbox",
- "publicKey": "string",
- "secretKeyMasked": "sk_live_...a1b2",
- "status": "active",
- "lastUsedAt": "2019-08-24T14:15:22Z",
- "lastRotatedAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z"
}
]Rotate the key pair for an environment
Authorizations:
path Parameters
| appId required | string |
| environment required | string (Environment) Enum: "sandbox" "live" |
Responses
Response samples
- 200
{- "message": "string",
- "environment": "sandbox",
- "publicKey": "string",
- "secretKey": "string",
- "secretKeyPrefix": "string",
- "secretKeyLast4": "string"
}Create a product
Authorizations:
Request Body schema: application/json
| appId required | string |
| title required | string |
| priceMinor required | integer <int64> > 0 |
| sku | string |
| currency required | string |
| description | string |
| media | Array of strings |
| category | string |
| compareAtPriceMinor | integer <int64> > 0 |
| unitPriceMinor | integer <int64> > 0 |
| chargeTax | boolean |
| costPerItemMinor | integer <int64> > 0 |
| status | string Enum: "active" "draft" "archived" |
object | |
object | |
| themeTemplate | string |
object | |
object | |
Array of objects | |
object | |
| quantity | integer >= 0 Legacy field. |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "title": "Premium Plan",
- "priceMinor": 4999,
- "currency": "USD",
- "status": "active"
}Response samples
- 201
- 400
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "storeCode": "string",
- "title": "string",
- "sku": "string",
- "price": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "description": "string",
- "media": [
- "string"
], - "category": "string",
- "compareAtPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "unitPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "chargeTax": true,
- "costPerItem": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "status": "active",
- "publishing": { },
- "productOrganization": { },
- "themeTemplate": "string",
- "inventory": { },
- "shipping": { },
- "variants": [
- { }
], - "seo": { },
- "quantity": 0,
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
[- {
- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "storeCode": "string",
- "title": "string",
- "sku": "string",
- "price": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "description": "string",
- "media": [
- "string"
], - "category": "string",
- "compareAtPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "unitPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "chargeTax": true,
- "costPerItem": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "status": "active",
- "publishing": { },
- "productOrganization": { },
- "themeTemplate": "string",
- "inventory": { },
- "shipping": { },
- "variants": [
- { }
], - "seo": { },
- "quantity": 0,
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Paginated product list for an app
Authorizations:
path Parameters
| appId required | string |
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Paginated lite product list for dropdowns
Authorizations:
path Parameters
| appId required | string |
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Response samples
- 200
- 404
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "storeCode": "string",
- "title": "string",
- "sku": "string",
- "price": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "description": "string",
- "media": [
- "string"
], - "category": "string",
- "compareAtPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "unitPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "chargeTax": true,
- "costPerItem": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "status": "active",
- "publishing": { },
- "productOrganization": { },
- "themeTemplate": "string",
- "inventory": { },
- "shipping": { },
- "variants": [
- { }
], - "seo": { },
- "quantity": 0,
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a product
Authorizations:
path Parameters
| productId required | string |
Request Body schema: application/json
| title | string |
| priceMinor | integer <int64> > 0 |
| sku | string |
| currency | string |
| description | string |
| media | Array of strings |
| category | string |
| compareAtPriceMinor | integer <int64> > 0 |
| unitPriceMinor | integer <int64> > 0 |
| chargeTax | boolean |
| costPerItemMinor | integer <int64> > 0 |
| status | string Enum: "active" "draft" "archived" |
object | |
object | |
| themeTemplate | string |
object | |
object | |
Array of objects | |
object | |
| quantity | integer >= 0 |
| isActive | boolean Legacy field. |
Responses
Request samples
- Payload
{- "title": "Premium Plan",
- "priceMinor": 5999,
- "currency": "USD",
- "status": "active"
}Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "storeCode": "string",
- "title": "string",
- "sku": "string",
- "price": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "description": "string",
- "media": [
- "string"
], - "category": "string",
- "compareAtPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "unitPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "chargeTax": true,
- "costPerItem": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "status": "active",
- "publishing": { },
- "productOrganization": { },
- "themeTemplate": "string",
- "inventory": { },
- "shipping": { },
- "variants": [
- { }
], - "seo": { },
- "quantity": 0,
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Payment session statistics
Authorizations:
query Parameters
| appId | string |
| status | string |
| gateway | string |
| startDate | string <date-time> |
| endDate | string <date-time> |
Responses
Response samples
- 200
{- "totalPayments": 0,
- "completedPayments": 0,
- "pendingPayments": 0,
- "totalRevenue": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "successRate": 0
}Paginated payment session list
Authorizations:
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
| appId | string |
| status | string |
| gateway | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}List payment sessions
Authorizations:
query Parameters
| page | integer Default: 1 |
| limit | integer Default: 50 |
Responses
Response samples
- 200
{- "sessions": [
- {
- "id": "string",
- "sessionId": "string",
- "amount": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "customerEmail": "string",
- "customerName": "string",
- "products": [
- {
- "sku": "string",
- "title": "string",
- "price": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "quantity": 0,
- "productId": "string",
- "sessionPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "paidPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "total": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "paidCurrency": "string"
}
], - "status": "string",
- "gateway": "string",
- "description": "string",
- "redirectUrl": "string",
- "expiresAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z",
- "cancelledAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Get payment session details
Authorizations:
path Parameters
| sessionId required | string |
Responses
Response samples
- 200
- 404
{- "id": "string",
- "sessionId": "string",
- "amount": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "customerEmail": "string",
- "customerName": "string",
- "products": [
- {
- "sku": "string",
- "title": "string",
- "price": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "quantity": 0,
- "productId": "string",
- "sessionPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "paidPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "total": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "paidCurrency": "string"
}
], - "status": "string",
- "gateway": "string",
- "description": "string",
- "redirectUrl": "string",
- "expiresAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z",
- "cancelledAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "returnUrl": "string",
- "cancelUrl": "string",
- "updatedAt": "2019-08-24T14:15:22Z",
- "providerPaymentId": "string",
- "gatewayTransactionId": "string",
- "error": { },
- "currencyConversion": {
- "original": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "converted": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "exchangeRate": 3.7545
}
}Create a customer
Authorizations:
Request Body schema: application/json
| appId required | string |
| firstName | string |
| lastName | string |
string <email> | |
| mobile | string |
| language | string |
object | |
object | |
| notes | string |
| tags | Array of strings |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "firstName": "Ada",
- "lastName": "Lovelace",
- "email": "ada@example.com"
}Response samples
- 201
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "user@example.com",
- "mobile": "string",
- "language": "string",
- "defaultAddress": { },
- "marketingPreferences": { },
- "notes": "string",
- "tags": [
- "string"
], - "sessionIds": [
- "string"
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
[- {
- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "user@example.com",
- "mobile": "string",
- "language": "string",
- "defaultAddress": { },
- "marketingPreferences": { },
- "notes": "string",
- "tags": [
- "string"
], - "sessionIds": [
- "string"
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Paginated customer list for an app
Authorizations:
path Parameters
| appId required | string |
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Response samples
- 200
- 404
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "user@example.com",
- "mobile": "string",
- "language": "string",
- "defaultAddress": { },
- "marketingPreferences": { },
- "notes": "string",
- "tags": [
- "string"
], - "sessionIds": [
- "string"
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a customer
Authorizations:
path Parameters
| customerId required | string |
Request Body schema: application/json
| firstName | string |
| lastName | string |
string <email> | |
| mobile | string |
| language | string |
object | |
object | |
| notes | string |
| tags | Array of strings |
Responses
Request samples
- Payload
{- "firstName": "Ada",
- "email": "ada@example.com"
}Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "user@example.com",
- "mobile": "string",
- "language": "string",
- "defaultAddress": { },
- "marketingPreferences": { },
- "notes": "string",
- "tags": [
- "string"
], - "sessionIds": [
- "string"
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Customer payment history
Authorizations:
path Parameters
| customerId required | string |
query Parameters
| page | integer Default: 1 |
| limit | integer Default: 10 |
Responses
Response samples
- 200
{- "payments": [
- {
- "sessionId": "string",
- "amount": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "gateway": "string",
- "status": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}
], - "total": 0,
- "page": 0,
- "limit": 0,
- "totalPages": 0
}Paginated lite gateway catalog for dropdowns
Authorizations:
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}List an app's configured gateways
Authorizations:
path Parameters
| appId required | string |
Responses
Response samples
- 200
{- "gateways": [
- {
- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "name": "string",
- "config": { },
- "defaultCurrency": "string",
- "acceptedCurrencies": [
- "string"
], - "supportedPaymentMethods": [
- "string"
], - "isDefault": true,
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]
}Configure a gateway for an app
Authorizations:
path Parameters
| appId required | string |
Request Body schema: application/json
| name required | string Enum: "paypal" "stripe" "moyasar" "myfatoorah" |
required | object |
| defaultCurrency | string = 3 characters |
| acceptedCurrencies | Array of strings |
| isDefault | boolean Default: false |
Responses
Request samples
- Payload
{- "name": "moyasar",
- "config": {
- "secretKey": "sk_test_xxx",
- "publishableKey": "pk_test_xxx",
- "environment": "sandbox"
}, - "defaultCurrency": "SAR",
- "isDefault": true
}Response samples
- 201
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "name": "string",
- "config": { },
- "defaultCurrency": "string",
- "acceptedCurrencies": [
- "string"
], - "supportedPaymentMethods": [
- "string"
], - "isDefault": true,
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Paginated list of an app's configured gateways
Authorizations:
path Parameters
| appId required | string |
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Update an app gateway
Authorizations:
path Parameters
| appId required | string |
| gatewayId required | string |
Request Body schema: application/json
| name | string Enum: "paypal" "stripe" "moyasar" "myfatoorah" |
object | |
| defaultCurrency | string = 3 characters |
| acceptedCurrencies | Array of strings |
| isDefault | boolean |
| isActive | boolean |
Responses
Request samples
- Payload
{- "isActive": true,
- "isDefault": true,
- "defaultCurrency": "SAR"
}Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "name": "string",
- "config": { },
- "defaultCurrency": "string",
- "acceptedCurrencies": [
- "string"
], - "supportedPaymentMethods": [
- "string"
], - "isDefault": true,
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Create a gateway onboarding request
Authorizations:
Request Body schema: application/json
| gateway required | string |
required | object |
required | object |
required | object |
object | |
Array of objects (GatewayRequestAttachment) |
Responses
Request samples
- Payload
{- "gateway": "moyasar",
- "customer": {
- "nationalId": "1234567890",
- "name": {
- "first": "Ada",
- "last": "Lovelace"
}, - "email": "ada@example.com",
- "phone": "+966500000000",
- "country": "SA",
- "city": "Riyadh",
- "address": "King Fahd Rd",
- "postalCode": "11564"
}, - "company": {
- "crNumber": "1010123456",
- "name": "Example LLC",
- "country": "SA",
- "city": "Riyadh",
- "address": "King Fahd Rd",
- "postalCode": "11564"
},
}Response samples
- 201
{ }Paginated gateway onboarding requests
Authorizations:
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
| status | string |
| gateway | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Update a draft gateway request
Authorizations:
path Parameters
| id required | string |
Request Body schema: application/json
| gateway | string |
object | |
object | |
object | |
object | |
Array of objects (GatewayRequestAttachment) |
Responses
Request samples
- Payload
{
}Response samples
- 200
{ }Update request status (admin only)
Authorizations:
path Parameters
| id required | string |
Request Body schema: application/json
| status required | string Enum: "Draft" "Submitted" "InReview" "ActionRequired" "Approved" "Rejected" "Live" |
| note | string |
Responses
Request samples
- Payload
{- "status": "Submitted",
- "note": "Ready for review"
}Response samples
- 403
{- "error": "string",
- "message": "string"
}Add corrections to a request (admin only)
Authorizations:
path Parameters
| id required | string |
Request Body schema: application/json
| required required | boolean |
| message | string |
| fields | Array of strings |
Responses
Request samples
- Payload
{- "required": true,
- "message": "Upload a clearer CR document",
- "fields": [
- "company.crFileMediaId"
]
}Response samples
- 403
{- "error": "string",
- "message": "string"
}Create a gateway routing rule
Authorizations:
Request Body schema: application/json
| appId required | string |
| name required | string |
| description | string |
| ruleType required | string |
required | Array of objects non-empty |
| preferredGateway required | string |
| environment required | string (Environment) Enum: "sandbox" "live" |
| score | number |
| priority | integer |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "name": "Prefer Moyasar for SAR",
- "ruleType": "currency",
- "conditions": [
- {
- "field": "currency",
- "operator": "eq",
- "value": "SAR"
}
], - "preferredGateway": "moyasar",
- "environment": "sandbox",
- "priority": 10
}Response samples
- 201
{- "success": true,
- "data": null,
- "message": "string",
- "error": "string"
}Paginated gateway routing rules
Authorizations:
query Parameters
| appId required | string |
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
| environment | string (Environment) Enum: "sandbox" "live" |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Update a gateway rule
Authorizations:
path Parameters
| id required | string |
Request Body schema: application/json
| name | string |
| description | string |
| ruleType | string |
Array of objects | |
| preferredGateway | string |
| environment | string (Environment) Enum: "sandbox" "live" |
| score | number |
| priority | integer |
| isActive | boolean |
Responses
Request samples
- Payload
{- "name": "Prefer Moyasar for SAR",
- "priority": 5,
- "isActive": true
}Response samples
- 200
{- "success": true,
- "data": null,
- "message": "string",
- "error": "string"
}Seed default gateway rules
Authorizations:
Request Body schema: application/json
| appId required | string |
| environment required | string (Environment) Enum: "sandbox" "live" |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "environment": "sandbox"
}Response samples
- 200
{- "success": true,
- "data": null,
- "message": "string",
- "error": "string"
}Test gateway rule matching
Authorizations:
Request Body schema: application/json
| appId required | string |
| environment required | string (Environment) Enum: "sandbox" "live" |
required | object |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "environment": "sandbox",
- "context": {
- "currency": "SAR",
- "amountMinor": 10000
}
}Response samples
- 200
{- "success": true,
- "data": null,
- "message": "string",
- "error": "string"
}Provider webhook for gateway request status
path Parameters
| provider required | string Enum: "stripe" "paypal" "moyasar" "myfatoorah" |
Request Body schema: application/json
| externalId required | string |
| status required | string Enum: "approved" "rejected" "pending" "live" |
| encryptedSecrets | string |
Responses
Request samples
- Payload
{- "externalId": "acct_123",
- "status": "approved"
}Response samples
- 200
{- "success": true,
- "request": { }
}Response samples
- 200
{- "statistics": {
- "apps": {
- "total": 0,
- "active": 0
}, - "gateways": {
- "total": 0,
- "active": 0
}, - "products": {
- "total": 0,
- "active": 0
}, - "tokens": {
- "total": 0,
- "active": 0
}, - "orders": {
- "total": 0,
- "completed": 0,
- "pending": 0,
- "failed": 0,
- "revenue": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}
}
}, - "latestSessions": [
- {
- "id": "string",
- "sessionId": "string",
- "amount": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "customerEmail": "string",
- "customerName": "string",
- "products": [
- {
- "sku": "string",
- "title": "string",
- "price": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "currency": "string",
- "quantity": 0,
- "productId": "string",
- "sessionPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "paidPrice": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "total": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "paidCurrency": "string"
}
], - "status": "string",
- "gateway": "string",
- "description": "string",
- "redirectUrl": "string",
- "expiresAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z",
- "cancelledAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z"
}
], - "recentActivity": {
- "property1": 0,
- "property2": 0
}, - "chartData": {
- "dailyPayments": [
- {
- "date": "string",
- "amount": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "count": 0
}
], - "summary": {
- "totalAmount": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "totalCount": 0,
- "averageDaily": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}
}
}, - "shortcuts": [
- {
- "label": "string",
- "path": "string",
- "icon": "string"
}
]
}Create an SDK/client token
Authorizations:
Request Body schema: application/json
| appId required | string |
| name | string |
| libraryIds required | Array of strings non-empty |
| environment | string (Environment) Enum: "sandbox" "live" |
| domains | Array of strings <uri> |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "name": "Storefront SDK",
- "libraryIds": [
- "lib_checkout"
], - "environment": "sandbox",
}Response samples
- 201
- 400
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "libraryIds": [
- "string"
], - "libraries": [
- {
- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "token": "string",
- "name": "string",
- "scopes": [
- "string"
], - "environment": "sandbox",
- "domains": [
- "string"
], - "isActive": true,
- "lastUsed": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
[- {
- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "libraryIds": [
- "string"
], - "libraries": [
- {
- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "token": "string",
- "name": "string",
- "scopes": [
- "string"
], - "environment": "sandbox",
- "domains": [
- "string"
], - "isActive": true,
- "lastUsed": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Paginated token list for an app
Authorizations:
path Parameters
| appId required | string |
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Paginated lite token list for dropdowns
Authorizations:
path Parameters
| appId required | string |
query Parameters
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Response samples
- 200
- 404
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "libraryIds": [
- "string"
], - "libraries": [
- {
- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "token": "string",
- "name": "string",
- "scopes": [
- "string"
], - "environment": "sandbox",
- "domains": [
- "string"
], - "isActive": true,
- "lastUsed": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a token
Authorizations:
path Parameters
| tokenId required | string |
Request Body schema: application/json
| name | string |
| libraryIds | Array of strings non-empty |
| environment | string (Environment) Enum: "sandbox" "live" |
| domains | Array of strings <uri> |
Responses
Request samples
- Payload
{- "name": "Storefront SDK",
- "environment": "live"
}Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "libraryIds": [
- "string"
], - "libraries": [
- {
- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "token": "string",
- "name": "string",
- "scopes": [
- "string"
], - "environment": "sandbox",
- "domains": [
- "string"
], - "isActive": true,
- "lastUsed": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "libraryIds": [
- "string"
], - "libraries": [
- {
- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "token": "string",
- "name": "string",
- "scopes": [
- "string"
], - "environment": "sandbox",
- "domains": [
- "string"
], - "isActive": true,
- "lastUsed": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Add an allowed domain to a token
Authorizations:
path Parameters
| tokenId required | string |
Request Body schema: application/json
| domain required | string |
Responses
Request samples
- Payload
{
}Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "libraryIds": [
- "string"
], - "libraries": [
- {
- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "token": "string",
- "name": "string",
- "scopes": [
- "string"
], - "environment": "sandbox",
- "domains": [
- "string"
], - "isActive": true,
- "lastUsed": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}List webhook endpoints for an app
Authorizations:
query Parameters
| appId required | string |
Responses
Response samples
- 200
- 400
[- {
- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "description": "string",
- "secretEnc": "string",
- "authHeaderName": "string",
- "authHeaderValueEnc": "string",
- "isActive": true,
- "consecutiveFailures": 0,
- "disabledReason": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Create a webhook endpoint
Authorizations:
Request Body schema: application/json
| appId required | string |
| url required | string <uri> |
| description | string |
| authHeaderName | string |
| authHeaderValue | string |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "description": "Order events"
}Response samples
- 201
{- "endpoint": {
- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "description": "string",
- "secretEnc": "string",
- "authHeaderName": "string",
- "authHeaderValueEnc": "string",
- "isActive": true,
- "consecutiveFailures": 0,
- "disabledReason": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "secret": "string"
}Paginated webhook endpoint list
Authorizations:
query Parameters
| appId required | string |
| page | integer Default: 1 |
| limit | integer <= 100 Default: 20 |
| sortBy | string Default: "createdAt" |
| sortOrder | string Default: "desc" Enum: "asc" "desc" |
| search | string |
| isActive | string Enum: "true" "false" |
Responses
Response samples
- 200
{- "data": [
- { }
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Response samples
- 200
- 404
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "description": "string",
- "secretEnc": "string",
- "authHeaderName": "string",
- "authHeaderValueEnc": "string",
- "isActive": true,
- "consecutiveFailures": 0,
- "disabledReason": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a webhook endpoint
Authorizations:
path Parameters
| id required | string |
Request Body schema: application/json
| url | string <uri> |
| description | string |
| isActive | boolean |
| authHeaderName | string |
| authHeaderValue | string |
Responses
Request samples
- Payload
{- "isActive": true
}Response samples
- 200
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "description": "string",
- "secretEnc": "string",
- "authHeaderName": "string",
- "authHeaderValueEnc": "string",
- "isActive": true,
- "consecutiveFailures": 0,
- "disabledReason": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}List notification rules for an app
Authorizations:
query Parameters
| appId required | string |
Responses
Response samples
- 200
[- {
- "_id": "string",
- "appId": "string",
- "eventType": "string",
- "channel": "string",
- "recipient": "string",
- "isActive": true,
- "config": { },
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Create a notification rule
Authorizations:
Request Body schema: application/json
| appId required | string |
| eventType required | string |
| channel required | string |
| recipient required | string |
| isActive | boolean Default: true |
required | object |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "eventType": "payment.completed",
- "channel": "webhook",
- "recipient": "endpoint",
- "isActive": true,
- "config": {
- "endpointId": "ep_123"
}
}Response samples
- 201
{- "_id": "string",
- "appId": "string",
- "eventType": "string",
- "channel": "string",
- "recipient": "string",
- "isActive": true,
- "config": { },
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
- 404
{- "_id": "string",
- "appId": "string",
- "eventType": "string",
- "channel": "string",
- "recipient": "string",
- "isActive": true,
- "config": { },
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a notification rule
Authorizations:
path Parameters
| id required | string |
Request Body schema: application/json
| isActive | boolean |
object |
Responses
Request samples
- Payload
{- "isActive": false
}Response samples
- 200
{- "_id": "string",
- "appId": "string",
- "eventType": "string",
- "channel": "string",
- "recipient": "string",
- "isActive": true,
- "config": { },
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}List notification deliveries for an app
Authorizations:
query Parameters
| appId required | string |
| channel | string |
| status | string |
| eventType | string |
| page | integer Default: 1 |
| limit | integer <= 100 Default: 50 |
Responses
Response samples
- 200
{- "deliveries": [
- {
- "_id": "string",
- "appId": "string",
- "ruleId": "string",
- "eventType": "string",
- "channel": "string",
- "recipient": "string",
- "eventId": "string",
- "target": "string",
- "payloadSnapshot": { },
- "status": "pending",
- "attempts": 0,
- "lastStatusCode": 0,
- "lastResponseSnippet": "string",
- "lastError": "string",
- "durationMs": 0,
- "nextRetryAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Response samples
- 200
- 404
{- "_id": "string",
- "appId": "string",
- "ruleId": "string",
- "eventType": "string",
- "channel": "string",
- "recipient": "string",
- "eventId": "string",
- "target": "string",
- "payloadSnapshot": { },
- "status": "pending",
- "attempts": 0,
- "lastStatusCode": 0,
- "lastResponseSnippet": "string",
- "lastError": "string",
- "durationMs": 0,
- "nextRetryAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}List notification templates for an app
Authorizations:
query Parameters
| appId required | string |
Responses
Response samples
- 200
[- {
- "_id": "string",
- "appId": "string",
- "channel": "string",
- "eventType": "string",
- "recipient": "string",
- "locale": "string",
- "subject": "string",
- "body": "string",
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Create a notification template
Authorizations:
Request Body schema: application/json
| appId | string or null |
| channel required | string |
| eventType required | string |
| recipient required | string |
| locale | string Default: "en" |
| subject | string |
| body required | string |
| isActive | boolean Default: true |
Responses
Request samples
- Payload
{- "channel": "email",
- "eventType": "payment.completed",
- "recipient": "customer",
- "subject": "Payment received",
- "body": "Your payment of {{amount}} {{currency}} was completed."
}Response samples
- 201
{- "_id": "string",
- "appId": "string",
- "channel": "string",
- "eventType": "string",
- "recipient": "string",
- "locale": "string",
- "subject": "string",
- "body": "string",
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
- 404
{- "_id": "string",
- "appId": "string",
- "channel": "string",
- "eventType": "string",
- "recipient": "string",
- "locale": "string",
- "subject": "string",
- "body": "string",
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a notification template
Authorizations:
path Parameters
| id required | string |
Request Body schema: application/json
| subject | string |
| body | string |
| isActive | boolean |
Responses
Request samples
- Payload
{- "subject": "Payment received",
- "isActive": true
}Response samples
- 200
{- "_id": "string",
- "appId": "string",
- "channel": "string",
- "eventType": "string",
- "recipient": "string",
- "locale": "string",
- "subject": "string",
- "body": "string",
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}List in-app notifications for the current user
Authorizations:
query Parameters
| page | integer Default: 1 |
| limit | integer <= 50 Default: 5 |
Responses
Response samples
- 200
{- "notifications": [
- {
- "_id": "string",
- "merchantId": "string",
- "appId": "string",
- "title": "string",
- "body": "string",
- "eventType": "string",
- "channel": "string",
- "viewed": true,
- "viewedAt": "2019-08-24T14:15:22Z",
- "metadata": { },
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "unreadCount": 0,
- "pagination": {
- "page": 0,
- "limit": 0
}
}Mark an in-app notification as viewed
Authorizations:
path Parameters
| id required | string |
Responses
Response samples
- 200
- 404
{- "_id": "string",
- "merchantId": "string",
- "appId": "string",
- "title": "string",
- "body": "string",
- "eventType": "string",
- "channel": "string",
- "viewed": true,
- "viewedAt": "2019-08-24T14:15:22Z",
- "metadata": { },
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Query audit logs (admin only)
Requires admin role (requireAdmin).
Authorizations:
query Parameters
| actorId | string |
| action | string |
| status | string Enum: "success" "failure" |
| startDate | string <date-time> |
| endDate | string <date-time> |
| page | integer Default: 1 |
| limit | integer Default: 50 |
Responses
Response samples
- 200
- 403
{- "logs": [
- {
- "_id": "string",
- "actorId": "string",
- "actorType": "string",
- "action": "string",
- "status": "success",
- "ip": "string",
- "userAgent": "string",
- "metadata": { },
- "createdAt": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "page": 0,
- "limit": 0,
- "total": 0,
- "pages": 0
}
}Get audit logs for the current user
Authorizations:
query Parameters
| limit | integer Default: 100 |
Responses
Response samples
- 200
{- "logs": [
- {
- "_id": "string",
- "actorId": "string",
- "actorType": "string",
- "action": "string",
- "status": "success",
- "ip": "string",
- "userAgent": "string",
- "metadata": { },
- "createdAt": "2019-08-24T14:15:22Z"
}
]
}Create a currency
Authorizations:
Request Body schema: application/json
| code required | string = 3 characters |
| name required | string |
| symbol | string |
| rateFromUsd required | number > 0 Units of this currency per 1 USD (fastFOREX fetch-all shape). USD is always 1. This inverted the old USD-per-unit field — SAR is 3.7545, not 0.27. |
| minorUnitExponent required | integer Enum: 0 2 3 ISO 4217 exponent. 3 for KWD/BHD/OMR, 0 for JPY, 2 for most. |
| isActive | boolean |
Responses
Request samples
- Payload
{- "code": "USD",
- "name": "US Dollar",
- "symbol": "$",
- "rateFromUsd": 1,
- "minorUnitExponent": 2,
- "isActive": true
}Response samples
- 201
{- "code": "SAR",
- "name": "string",
- "symbol": "string",
- "rateFromUsd": 3.7545,
- "minorUnitExponent": 2,
- "rateUpdatedAt": "2019-08-24T14:15:22Z",
- "rateProviderUpdatedAt": "2019-08-24T14:15:22Z",
- "rateSource": "seed",
- "isActive": true
}Response samples
- 200
- 404
{- "code": "SAR",
- "name": "string",
- "symbol": "string",
- "rateFromUsd": 3.7545,
- "minorUnitExponent": 2,
- "rateUpdatedAt": "2019-08-24T14:15:22Z",
- "rateProviderUpdatedAt": "2019-08-24T14:15:22Z",
- "rateSource": "seed",
- "isActive": true
}Update a currency
Authorizations:
path Parameters
| code required | string Example: USD |
Request Body schema: application/json
| name | string |
| symbol | string |
| rateFromUsd | number > 0 Units of this currency per 1 USD. A manually supplied rate sets rateSource to manual. |
| minorUnitExponent | integer Enum: 0 2 3 |
| isActive | boolean |
Responses
Request samples
- Payload
{- "name": "US Dollar",
- "rateFromUsd": 1,
- "minorUnitExponent": 2,
- "isActive": true
}Response samples
- 200
{- "code": "SAR",
- "name": "string",
- "symbol": "string",
- "rateFromUsd": 3.7545,
- "minorUnitExponent": 2,
- "rateUpdatedAt": "2019-08-24T14:15:22Z",
- "rateProviderUpdatedAt": "2019-08-24T14:15:22Z",
- "rateSource": "seed",
- "isActive": true
}Convert an amount for a gateway
Request Body schema: application/json
| amountMinor required | integer <int64> |
| fromCurrency required | string |
| gatewayId required | string |
Responses
Request samples
- Payload
{- "amountMinor": 10000,
- "fromCurrency": "USD",
- "gatewayId": "gw_123"
}Response samples
- 200
{- "original": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "converted": {
- "minor": 3750,
- "currency": "SAR",
- "exponent": 2,
- "display": "37.50 SAR"
}, - "exchangeRate": 3.7545
}Generate a domain verification file
Authorizations:
Request Body schema: application/json
| appId required | string |
| domain required | string |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "domain": "store.example.com"
}Response samples
- 200
{ }Check whether a domain is verified
Authorizations:
Request Body schema: application/json
| appId required | string |
| domain required | string |
Responses
Request samples
- Payload
{- "appId": "app_123",
- "domain": "store.example.com"
}Response samples
- 200
{ }Response samples
- 200
[- {
- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Create a library
Authorizations:
Request Body schema: application/json
| identifier required | string |
| name required | string |
| description | string |
| scopes required | Array of strings non-empty |
Responses
Request samples
- Payload
{- "identifier": "checkout-web",
- "name": "Checkout Web",
- "description": "Hosted checkout scopes",
- "scopes": [
- "product:link",
- "payment:send_otp"
]
}Response samples
- 201
{- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
- 404
{- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a library
Authorizations:
path Parameters
| libraryId required | string |
Request Body schema: application/json
| name | string |
| description | string |
| scopes | Array of strings |
| isActive | boolean |
Responses
Request samples
- Payload
{- "name": "Checkout Web",
- "isActive": true
}Response samples
- 200
{- "_id": "string",
- "identifier": "string",
- "name": "string",
- "description": "string",
- "scopes": [
- "string"
], - "modules": [
- "string"
], - "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Upload a media file
Authorizations:
Request Body schema: multipart/form-data
| file required | string <binary> |
| appId required | string |
Responses
Request samples
- Payload
{ "appId": "app_123" }
Response samples
- 201
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "type": "image",
- "extension": "string",
- "url": "string",
- "name": "string",
- "size": 0,
- "mimeType": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Response samples
- 200
[- {
- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "type": "image",
- "extension": "string",
- "url": "string",
- "name": "string",
- "size": 0,
- "mimeType": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Response samples
- 200
- 404
{- "_id": "string",
- "merchantId": "string",
- "createdBy": "string",
- "appId": "string",
- "type": "image",
- "extension": "string",
- "url": "string",
- "name": "string",
- "size": 0,
- "mimeType": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}