Created
April 16, 2021 17:53
-
-
Save kitze/b63aab901b5e607f7b845aef12606a7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"oneOf": [ | |
{ | |
"type": "object", | |
"description": "Success response", | |
"properties": { | |
"success": { | |
"type": "boolean" | |
}, | |
"response": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"subscription_id": { | |
"type": "integer" | |
}, | |
"plan_id": { | |
"type": "integer" | |
}, | |
"user_id": { | |
"type": "integer" | |
}, | |
"user_email": { | |
"type": "string", | |
"format": "email" | |
}, | |
"marketing_consent": { | |
"type": "boolean" | |
}, | |
"state": { | |
"type": "string", | |
"enum": ["active", "past_due", "trialling", "deleted", "paused"] | |
}, | |
"signup_date": { | |
"type": "string", | |
"format": "date" | |
}, | |
"last_payment": { | |
"type": "object", | |
"properties": { | |
"amount": { | |
"type": "number" | |
}, | |
"currency": { | |
"type": "string" | |
}, | |
"date": { | |
"type": "string" | |
} | |
} | |
}, | |
"next_payment": { | |
"type": "object", | |
"properties": { | |
"amount": { | |
"type": "number" | |
}, | |
"currency": { | |
"type": "string" | |
}, | |
"date": { | |
"type": "string" | |
} | |
} | |
}, | |
"update_url": { | |
"type": "string" | |
}, | |
"cancel_url": { | |
"type": "string" | |
}, | |
"paused_at": { | |
"type": "string", | |
"format": "date-time" | |
}, | |
"paused_from": { | |
"type": "string", | |
"format": "date-time" | |
}, | |
"payment_information": { | |
"oneOf": [ | |
{ | |
"description": "Card payment", | |
"properties": { | |
"payment_method": { | |
"type": "string", | |
"enum": ["card"] | |
}, | |
"card_type": { | |
"type": "string", | |
"enum": [ | |
"master", | |
"visa", | |
"american_express", | |
"discover", | |
"jcb", | |
"maestro", | |
"diners_club", | |
"unionpay" | |
] | |
}, | |
"last_four_digits": { | |
"type": "string", | |
"pattern": "\\d{4}" | |
}, | |
"expiry_date": { | |
"type": "string", | |
"format": "date", | |
"pattern": "\\d{2}\\/\\d{4}" | |
} | |
} | |
}, | |
{ | |
"description": "PayPal payment", | |
"properties": { | |
"payment_method": { | |
"type": "string", | |
"enum": ["paypal"] | |
} | |
} | |
} | |
], | |
"type": "object" | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"type": "object", | |
"title": "Error", | |
"description": "An unsuccessful call to the Dashboard API will return a 200 response containing a field `success` set to `false` and an error object.", | |
"properties": { | |
"success": { | |
"type": "boolean", | |
"default": false | |
}, | |
"error": { | |
"type": "object", | |
"properties": { | |
"code": { | |
"type": "integer", | |
"description": "See [list of error codes](/api-reference/intro/api-error-codes)." | |
}, | |
"message": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment