# Create a new record Endpoint: POST /v2/payment_subscriptions Version: 1.0 Security: bearerAuth ## Query parameters: - `fields` (string) sparse fieldsets: fields[TYPE]=field1,field2,... - `include` (string) list of included related resources ## Header parameters: - `User-Agent` (string, required) The name and version of the client making the request Example: "CHOAM EPT Client v10191 (Ruby Client v3)" ## Response 201 fields (application/vnd.api+json): - `data` (object) Payment Subscriptions allow you to charge customers recurringly for access to a product or service. Edge supports subscriptions with billing cycles weekly, biweekly, monthly, bimonthly, quarterly, semiannual, and yearly. Edge will create a new charge against the associated payment method when a new cycle begins. ### Events You can listen to payment_subscriptions.created, payment_subscriptions.updated and payment_subscriptions.deleted events on the resource. In addition, charges would trigger their respective events as they advance through their lifecycle. ### Detecting Failures A subscription will be in an active status unless specified otherwise. However, the customer may have entered the card details incorrectly. In this case, the subscription status will transit from active to past_due. Track this transition using WebhookSubscription by listening to the subscription.updated event. Example: {"attributes":{"created_at":"2024-06-06T21:48:33.382755Z","line_items":[{"amount_cents":10000,"amount_currency":"USD","description":"A toy","fee_cents":500,"quantity":1}],"status":"active","updated_at":"2024-06-06T21:48:33.382755Z"},"id":"246daff2-e2d3-4ed4-9ffc-546460c9d129","links":{},"relationships":{},"type":"payment_subscriptions"} - `data.attributes` (object) Members of the attributes object (attributes) represent information about the resource object in which it's defined. Example: {"created_at":"2024-06-06T21:48:33.382755Z","line_items":[{"amount_cents":10000,"amount_currency":"USD","description":"A toy","fee_cents":500,"quantity":1}],"status":"active","updated_at":"2024-06-06T21:48:33.382755Z"} - `data.attributes.acs_transaction_eid` (string) The 3DSecure transaction UUID assigned by the issuer - `data.attributes.address_line1_verification` (string) The status of the billing address (Line 1) verification process Enum: "match", "mismatch", "retry", "unavailable", "unverified" - `data.attributes.amount_cents` (integer) The amount of the payment demand in cents - `data.attributes.amount_currency` (string) The currency of the charge (ISO 4217) - `data.attributes.billing_cycle_anchor_at` (string) The reference date for the billing_period - `data.attributes.billing_period` (string) The reference date for the billing_period Enum: "one_day", "seven_days", "fourteen_days", "thirty_days", "one_month", "six_months", "twelve_months" - `data.attributes.canceled_at` (string) The date the subscription should be cancelled after - `data.attributes.confirmed` (boolean) Whether the payment should be processed immediately - `data.attributes.created_at` (string) Example: "2024-06-06T21:48:33.382755Z" - `data.attributes.cvc2_check` (string) The status of the CVC verification process Enum: "match", "unprocessed", "missing", "unavailable", "unresponsive" - `data.attributes.description` (string) A description of the charge - `data.attributes.directory_transaction_eid` (string) The 3DSecure transaction UUID assigned by the directory - `data.attributes.discount_cents` (integer) The amount of money given as a discount on the total of the purchase - `data.attributes.eci` (string) The 3DSecure Electronic Commerce Indicator for the verification process - `data.attributes.fee_cents` (integer) - `data.attributes.idempotency_key` (string) A unique value that prevents double charging - `data.attributes.line_items` (array) Itemized list of services or products being paid for in the purchase Example: [{"amount_cents":10000,"amount_currency":"USD","description":"A toy","fee_cents":500,"quantity":1}] - `data.attributes.payer_timezone` (string) IANA timezone name of the payer at time of purchase - `data.attributes.postal_code_verification` (string) The status of the billing address (postal code) verification process Enum: "match", "mismatch", "retry", "unavailable", "unverified" - `data.attributes.purchase_kind` (string) The type of purchase Enum: "order", "invoice" - `data.attributes.purchase_reference` (string) The unique identification for the purchase given by the merchant - `data.attributes.shipping_detail` (object) The purchase shipping details - `data.attributes.slug` (string) A reference name from which subscriptions can be grouped for - `data.attributes.status` (string) The period the subscriptions charge for, in relation to the billing_cycle_anchor Enum: "active", "paused", "cancelled" - `data.attributes.tax_detail` (object) The purchase tax details - `data.attributes.threeds_cryptogram` (string) The 3DSecure cryptogram used for verification - `data.attributes.threeds_status` (string) The status of the 3DSecure verification process - `data.attributes.threeds_version` (string) The 3DSecure Version used for verification - `data.attributes.updated_at` (string) Example: "2024-06-06T21:48:33.382755Z" - `data.id` (string, required) [resource object identifier](https://jsonapi.org/format/#document-resource-object-identification) - `data.links` (object, required) The links of the type Example: {} - `data.relationships` (object) The relationships of the type Example: {} - `data.type` (string, required) [resource object type](https://jsonapi.org/format/#document-resource-object-identification) Enum: "payment_subscriptions" - `jsonapi` (object) An object describing the server's implementation - `jsonapi.meta` (object) Non-standard meta-information that can not be represented as an attribute or relationship. - `jsonapi.meta.authors` (array) A list of all the authors of this work - `jsonapi.meta.copyright` (string) - `jsonapi.version` (string) - `links` (object, required) May contain self, related, or pagination links (first, last, prev, next). - `links.first` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `links.last` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `links.next` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `links.prev` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `links.related` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `links.self` (any) A link MUST be represented as either: a string containing the link's URL or a link object. ## Response 422 fields (application/vnd.api+json): - `errors` (array, required) - `errors.code` (string) An application-specific error code, expressed as a string value. - `errors.detail` (string) A human-readable explanation specific to this occurrence of the problem. - `errors.id` (string) A unique identifier for this particular occurrence of the problem. - `errors.links` (object) May contain self, related, or pagination links (first, last, prev, next). - `errors.links.first` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `errors.links.last` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `errors.links.next` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `errors.links.prev` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `errors.links.related` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `errors.links.self` (any) A link MUST be represented as either: a string containing the link's URL or a link object. - `errors.meta` (object) Non-standard meta-information that can not be represented as an attribute or relationship. - `errors.meta.authors` (array) A list of all the authors of this work - `errors.meta.copyright` (string) - `errors.source` (object) - `errors.source.parameter` (string) A string indicating which query parameter caused the error. - `errors.source.pointer` (string) A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. /data for a primary data object, or /data/attributes/title for a specific attribute]. - `errors.status` (string) The HTTP status code applicable to this problem, expressed as a string value. - `errors.title` (string) A short, human-readable summary of the problem. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. - `jsonapi` (object) An object describing the server's implementation - `jsonapi.version` (string) ## Response 400 fields ## Response 401 fields ## Response 403 fields ## Response 404 fields ## Response 406 fields ## Response 409 fields ## Response 415 fields