Payment Methods

Properties

  • Name
    object
    Type
    string
    Description

    Type of object is always paymentMethod.

  • Name
    id
    Type
    string
    Description

    Unique identifier for the payment method.

    Example: pm_1IHCiiI2m82Dc6YnhqGWH6JX
  • Name
    brand
    Type
    nullable string
    Description

    Card brand. Only available for type card.

    Example: visa
    Allowed values: amex, diners, discover, jcb, mastercard, unionpay, visa, unknown
  • Name
    clientSecret
    Type
    nullable string
    Description

    An optional Stripe specific client secret to be used for payment method confirmation.

  • Name
    createdAt
    Type
    string
    Description

    Time when the payment method was created.

    Example: 2021-02-14T19:38:34Z
  • Name
    last4
    Type
    nullable string
    Description

    The last four digits of the card. Only available for type card.

    Example: 4242
  • Name
    provider
    Type
    string
    Description

    The provider of the payment method. Currently only stripe is supported.

  • Name
    status
    Type
    string
    Description

    Status of the payment method.

    Example: available
    Allowed values: available, requiresConfirmation
  • Name
    type
    Type
    string
    Description

    Type of the payment method.

    Example: card
    Allowed values: card, applePay, googlePay
  • Name
    user
    Type
    string
    Description

    Unique identifier for the user of the payment method.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d

Response

{
  "object": "paymentMethod",
  "id": "pm_1IHCiiI2m82Dc6YnhqGWH6JX",
  "brand": "visa",
  "createdAt": "2021-02-14T19:38:34Z",
  "last4": "4242",
  "provider": "stripe",
  "status": "available",
  "type": "card",
  "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}

GET/projects/{project}/paymentMethods/{paymentMethod}

Retrieve a payment method

Retrieves the details of an existing payment method. You need only supply the unique identifier that was returned upon payment method creation.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    paymentMethod
    Type
    string
    required
    Description

    The unique identifier for the payment method.

    Example: pm_1IHCiiI2m82Dc6YnhqGWH6JX

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always paymentMethod.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the payment method.

    Example: pm_1IHCiiI2m82Dc6YnhqGWH6JX
  • Name
    brand
    Type
    nullable string
    required
    Description

    Card brand. Only available for type card.

    Example: visa
    Allowed values: amex, diners, discover, jcb, mastercard, unionpay, visa, unknown
  • Name
    clientSecret
    Type
    nullable string
    required
    Description

    An optional Stripe specific client secret to be used for payment method confirmation.

  • Name
    createdAt
    Type
    string
    required
    Description

    Time when the payment method was created.

    Example: 2021-02-14T19:38:34Z
  • Name
    last4
    Type
    nullable string
    required
    Description

    The last four digits of the card. Only available for type card.

    Example: 4242
  • Name
    provider
    Type
    string
    required
    Description

    The provider of the payment method. Currently only stripe is supported.

  • Name
    status
    Type
    string
    required
    Description

    Status of the payment method.

    Example: available
    Allowed values: available, requiresConfirmation
  • Name
    type
    Type
    string
    required
    Description

    Type of the payment method.

    Example: card
    Allowed values: card, applePay, googlePay
  • Name
    user
    Type
    string
    required
    Description

    Unique identifier for the user of the payment method.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d

Request

GET
/projects/{project}/paymentMethods/{paymentMethod}
curl https://api.gigs.com/projects/{project}/paymentMethods/{paymentMethod} \
-X GET \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"

Response

{
  "object": "paymentMethod",
  "id": "pm_1IHCiiI2m82Dc6YnhqGWH6JX",
  "brand": "visa",
  "clientSecret": null,
  "createdAt": "2021-02-14T19:38:34Z",
  "last4": "4242",
  "provider": "stripe",
  "status": "available",
  "type": "card",
  "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}

DELETE/projects/{project}/paymentMethods/{paymentMethod}

Delete a payment method

Permanently deletes a payment method. It cannot be undone.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    paymentMethod
    Type
    string
    required
    Description

    The unique identifier for the payment method.

    Example: pm_1IHCiiI2m82Dc6YnhqGWH6JX

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always paymentMethod.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the payment method.

    Example: pm_1IHCiiI2m82Dc6YnhqGWH6JX
  • Name
    brand
    Type
    nullable string
    required
    Description

    Card brand. Only available for type card.

    Example: visa
    Allowed values: amex, diners, discover, jcb, mastercard, unionpay, visa, unknown
  • Name
    clientSecret
    Type
    nullable string
    required
    Description

    An optional Stripe specific client secret to be used for payment method confirmation.

  • Name
    createdAt
    Type
    string
    required
    Description

    Time when the payment method was created.

    Example: 2021-02-14T19:38:34Z
  • Name
    last4
    Type
    nullable string
    required
    Description

    The last four digits of the card. Only available for type card.

    Example: 4242
  • Name
    provider
    Type
    string
    required
    Description

    The provider of the payment method. Currently only stripe is supported.

  • Name
    status
    Type
    string
    required
    Description

    Status of the payment method.

    Example: available
    Allowed values: available, requiresConfirmation
  • Name
    type
    Type
    string
    required
    Description

    Type of the payment method.

    Example: card
    Allowed values: card, applePay, googlePay
  • Name
    user
    Type
    string
    required
    Description

    Unique identifier for the user of the payment method.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d

Request

DELETE
/projects/{project}/paymentMethods/{paymentMethod}
curl https://api.gigs.com/projects/{project}/paymentMethods/{paymentMethod} \
-X DELETE \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"

Response

{
  "object": "paymentMethod",
  "id": "pm_1IHCiiI2m82Dc6YnhqGWH6JX",
  "brand": "visa",
  "clientSecret": null,
  "createdAt": "2021-02-14T19:38:34Z",
  "last4": "4242",
  "provider": "stripe",
  "status": "available",
  "type": "card",
  "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}

GET/projects/{project}/paymentMethods

List all payment methods

Returns a list of payment methods.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs

Query Parameters

  • Name
    user
    Type
    string
    Description

    The unique identifier for the user to be filtered by.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    type
    Type
    array
    Description

    A comma-separated list of payment method types to be filtered by.

    Default: card,applePay,googlePay
  • Name
    after
    Type
    string
    Description

    A cursor for use in pagination. The after parameter takes an object ID that defines the position in the list, only items immediately following the item with that ID will be returned.

  • Name
    before
    Type
    string
    Description

    A cursor for use in pagination. The before parameter takes an object ID that defines the position in the list, only items immediately preceding the item with that ID will be returned.

  • Name
    limit
    Type
    integer
    Description

    The limit of items to be returned in the list, between 0 and 200.

    Default: 10
    >= 0
    <= 200

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always list.

  • Name
    items
    Type
    array
    required
    Description
    List of objects of type `paymentMethod`.
  • Name
    moreItemsAfter
    Type
    nullable string
    required
    Description

    A unique identifier to be used as after pagination parameter if more items are available sorted after the current batch of items.

  • Name
    moreItemsBefore
    Type
    nullable string
    required
    Description

    A unique identifier to be used as before pagination parameter if more items are available sorted before the current batch of items.

Request

GET
/projects/{project}/paymentMethods
curl https://api.gigs.com/projects/{project}/paymentMethods \
-X GET \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"

Response

{
  "object": "list",
  "items": [
    {
      "object": "paymentMethod",
      "id": "pm_1IHCiiI2m82Dc6YnhqGWH6JX",
      "brand": "visa",
      "clientSecret": null,
      "createdAt": "2021-02-14T19:38:34Z",
      "last4": "4242",
      "provider": "stripe",
      "status": "available",
      "type": "card",
      "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
    }
  ],
  "moreItemsAfter": null,
  "moreItemsBefore": null
}

POST/projects/{project}/paymentMethods

Create a payment method

Create a new payment method with the given parameters.

Body

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the payment method.

    Example: pm_1IHCiiI2m82Dc6YnhqGWH6JX
  • Name
    user
    Type
    string
    required
    Description

    The unique identifier of the user the payment method should be created for.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always paymentMethod.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the payment method.

    Example: pm_1IHCiiI2m82Dc6YnhqGWH6JX
  • Name
    brand
    Type
    nullable string
    required
    Description

    Card brand. Only available for type card.

    Example: visa
    Allowed values: amex, diners, discover, jcb, mastercard, unionpay, visa, unknown
  • Name
    clientSecret
    Type
    nullable string
    required
    Description

    An optional Stripe specific client secret to be used for payment method confirmation.

  • Name
    createdAt
    Type
    string
    required
    Description

    Time when the payment method was created.

    Example: 2021-02-14T19:38:34Z
  • Name
    last4
    Type
    nullable string
    required
    Description

    The last four digits of the card. Only available for type card.

    Example: 4242
  • Name
    provider
    Type
    string
    required
    Description

    The provider of the payment method. Currently only stripe is supported.

  • Name
    status
    Type
    string
    required
    Description

    Status of the payment method.

    Example: available
    Allowed values: available, requiresConfirmation
  • Name
    type
    Type
    string
    required
    Description

    Type of the payment method.

    Example: card
    Allowed values: card, applePay, googlePay
  • Name
    user
    Type
    string
    required
    Description

    Unique identifier for the user of the payment method.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d

Request

POST
/projects/{project}/paymentMethods
curl https://api.gigs.com/projects/{project}/paymentMethods \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d "{\"id\":\"pm_1IHCiiI2m82Dc6YnhqGWH6JX\",\"user\":\"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d\"}"

Response

{
  "object": "paymentMethod",
  "id": "pm_1IHCiiI2m82Dc6YnhqGWH6JX",
  "brand": "visa",
  "clientSecret": null,
  "createdAt": "2021-02-14T19:38:34Z",
  "last4": "4242",
  "provider": "stripe",
  "status": "available",
  "type": "card",
  "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}