Skip to main content
POST
/
v1
/
stores
/
{store}
/
subscription-plans
/
{plan}
/
assignments
Create plan assignment
curl --request POST \
  --url https://api.confiopagos.com/v1/stores/{store}/subscription-plans/{plan}/assignments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "subscriptionPlan": "organizations/01JNRR1NY8MDX4XCGG0N4F06X3/stores/01JNRRDZDPH40DB2YRW329BFXM/subscription-plans/01JNRVWWHH68E76V3TMFFT6GHJ",
  "buyer": {
    "email": "[email protected]",
    "phoneNumber": "+573215786325",
    "firstName": "Santiago",
    "lastName": "García",
    "user": "01JNRVWWHH68E76V3TMFFT6GHJ"
  }
}
'
{
  "name": "organizations/01JNRR1NY8MDX4XCGG0N4F06X3/plan-assignments/01JNRVWWHH68E76V3TMFFT6GHJ",
  "subscriptionPlan": "organizations/01JNRR1NY8MDX4XCGG0N4F06X3/stores/01JNRRDZDPH40DB2YRW329BFXM/subscription-plans/01JNRVWWHH68E76V3TMFFT6GHJ",
  "status": "PENDING_ACCEPTANCE",
  "buyer": {
    "email": "<string>",
    "phoneNumber": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "user": "<string>"
  },
  "createTime": "2024-01-15T10:30:00Z",
  "acceptanceUrl": "https://checkout.confiopagos.com/s/abc123token",
  "acceptanceTokenExpiresAt": "2024-01-22T10:30:00Z",
  "currentPeriodStart": "2024-01-15T10:30:00Z",
  "currentPeriodEnd": "2024-02-15T10:30:00Z",
  "nextBillingTime": "2024-02-15T10:30:00Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

store
string
required
Example:

"01G65Z755AFWAKHE12NY0CQ9FH"

plan
string
required
Example:

"01JNRVWWHH68E76V3TMFFT6GHJ"

Body

application/json
subscriptionPlan
string
required

Resource name of the subscription plan to assign (format: organizations/{org}/stores/{store}/subscription-plans/{plan})

Example:

"organizations/01JNRR1NY8MDX4XCGG0N4F06X3/stores/01JNRRDZDPH40DB2YRW329BFXM/subscription-plans/01JNRVWWHH68E76V3TMFFT6GHJ"

buyer
object
required

Response

200 - application/json

Successfully created plan assignment.

name
string
required

Plan assignment's resource name

Example:

"organizations/01JNRR1NY8MDX4XCGG0N4F06X3/plan-assignments/01JNRVWWHH68E76V3TMFFT6GHJ"

subscriptionPlan
string
required

Resource name of the assigned subscription plan

Example:

"organizations/01JNRR1NY8MDX4XCGG0N4F06X3/stores/01JNRRDZDPH40DB2YRW329BFXM/subscription-plans/01JNRVWWHH68E76V3TMFFT6GHJ"

status
enum<string>
required

Assignment status

Available options:
ASSIGNMENT_STATUS_UNSPECIFIED,
PENDING_ACCEPTANCE,
ACTIVE,
TRIALING,
PAST_DUE,
CANCELED,
EXPIRED,
SUSPENDED
Example:

"PENDING_ACCEPTANCE"

buyer
object
required

Buyer information

createTime
string
required

Creation timestamp

Example:

"2024-01-15T10:30:00Z"

acceptanceUrl
string

URL for buyer to accept the subscription (only available when status is PENDING_ACCEPTANCE)

Example:

"https://checkout.confiopagos.com/s/abc123token"

acceptanceTokenExpiresAt
string

Expiration time of the acceptance token

Example:

"2024-01-22T10:30:00Z"

currentPeriodStart
string

Start of current billing period

Example:

"2024-01-15T10:30:00Z"

currentPeriodEnd
string

End of current billing period

Example:

"2024-02-15T10:30:00Z"

nextBillingTime
string

Next billing date

Example:

"2024-02-15T10:30:00Z"