Payments

Properties

  • Name
    object
    Type
    string
    Description

    Type of object is always payment.

  • Name
    id
    Type
    string
    Description

    Unique identifier for the payment.

    Example: pay_0SNlurA049MEWV2HRA0slWFuS8DV
  • Name
    amount
    Type
    object
    Description
    The total amount paid.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    attemptedAt
    Type
    string
    Description

    Time when the payment was last attempted.

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

    Time when the payment was created.

    Example: 2021-02-14T19:38:34Z
  • Name
    discount
    Type
    object
    Description
    The total discount applied to this payment.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    disputeClosedAt
    Type
    nullable string
    Description

    Time when the payment dispute was closed. Otherwise null.

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

    The outcome of a payment dispute. Otherwise null.

    Allowed values: , lost, won
  • Name
    failedAttempts
    Type
    integer
    Description

    The number of failed payment attempts so far.

    Example: 3
    >= 0
  • Name
    failureCode
    Type
    nullable string
    Description

    An error code indicating the reason for the payment failure.

    Example: paymentCardDeclined
  • Name
    failureMessage
    Type
    nullable string
    Description

    A human-readable message indicating the reason for the payment failure.

    Example: The card has been declined.
  • Name
    invoiceNumber
    Type
    string
    Description

    The number of the invoice from the payment provider

    Example: B74BDB55-0555
  • Name
    method
    Type
    nullable object
    Description
    The payment method describes how a payment can be made.
  • Name
    reason
    Type
    string
    Description

    The reason for this payment.

    Allowed values: subscriptionCreation, subscriptionRenewal, other
  • Name
    receipt
    Type
    nullable string
    Description

    The URL of a PDF receipt. The URL and the content it links to might change whenever the payment transitions to another state. The URL is signed, but care should be taken when sharing it, as it is publicly accessible.

    Example: https://files.gigs.com/receipts/pay_0SNlurA049MEWV2HRA0slWFuS8DV.pdf
  • Name
    references
    Type
    array
    Description
    List of payment references. Supported reference types are `order` and `subscription`.
    • Name
      object
      Type
      string
      Description

      The type of the referenced object.

      Allowed values: order, subscription, subscriptionAddon
    • Name
      id
      Type
      string
      Description

      Unique identifier of the referenced object.

      Example: ord_0SNlurA049MEWV0SiRFOw0dmChqN
  • Name
    refunded
    Type
    object
    Description
    The sum of all refunds related to this payment. Cannot be greater than the paid sum.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    refundedAt
    Type
    nullable string
    Description

    Time when the payment was fully refunded. Otherwise null.

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

    The status of the payment. Can be succeeded, requiresConfirmation, failed, refunded or disputed.

    Allowed values: succeeded, requiresConfirmation, failed, refunded, disputed, requiresPaymentMethod
  • Name
    subtotal
    Type
    object
    Description
    The total amount to be paid before any applied discounts.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    taxes
    Type
    array
    PREVIEW
    Description
    List of taxes.
  • Name
    total
    Type
    object
    PREVIEW
    Description
    The total amount paid.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    user
    Type
    object
    Description
  • Name
    voucher
    Type
    nullable object
    Description
    Voucher applied to the payment.
  • Name
    voucherCode
    Type
    nullable object
    Description
    Voucher code applied to the payment.

Response

{
  "object": "payment",
  "id": "pay_0SNlurA049MEWV2HRA0slWFuS8DV",
  "amount": {
    "amount": 999,
    "currency": "USD"
  },
  "attemptedAt": "2021-02-14T19:38:34Z",
  "createdAt": "2021-02-14T19:38:34Z",
  "discount": {
    "amount": 999,
    "currency": "USD"
  },
  "disputeClosedAt": "2021-02-14T19:38:34Z",
  "disputeOutcome": null,
  "failedAttempts": 3,
  "failureCode": "paymentCardDeclined",
  "failureMessage": "The card has been declined.",
  "invoiceNumber": "B74BDB55-0555",
  "method": {
    "object": "paymentMethod",
    "id": "pm_1IHCiiI2m82Dc6YnhqGWH6JX",
    "brand": "visa",
    "createdAt": "2021-02-14T19:38:34Z",
    "last4": "4242",
    "provider": "stripe",
    "status": "available",
    "type": "card",
    "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
  },
  "reason": "subscriptionCreation",
  "receipt": "https://files.gigs.com/receipts/pay_0SNlurA049MEWV2HRA0slWFuS8DV.pdf",
  "refunded": {
    "amount": 999,
    "currency": "USD"
  },
  "refundedAt": "2021-02-14T19:38:34Z",
  "status": "succeeded",
  "subtotal": {
    "amount": 999,
    "currency": "USD"
  },
  "taxes": [
    {
      "object": "tax",
      "inclusive": false,
      "name": "State Sales Tax",
      "value": {
        "amount": 90,
        "currency": "USD"
      }
    }
  ],
  "total": {
    "amount": 999,
    "currency": "USD"
  },
  "user": {
    "object": "user",
    "id": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
    "birthday": "2017-07-21",
    "createdAt": "2021-01-21T19:38:34Z",
    "email": "jerry@example.com",
    "emailVerified": true,
    "fullName": "Jerry Seinfeld",
    "preferredLocale": "en-US"
  },
  "voucher": {
    "object": "voucher",
    "id": "vou_0SNlurA049MEWV0h2jfjkdiOdplN",
    "createdAt": "2021-02-14T19:38:34Z",
    "name": "Monthly Basic 15%",
    "priceDiscount": {
      "amount": 999,
      "currency": "USD"
    },
    "priceDiscountPercentage": 30.12,
    "recurrence": {
      "type": "once"
    },
    "redemptions": 2,
    "restrictions": {
      "expiresAt": "2021-04-14T19:38:34Z"
    },
    "retiredReason": null,
    "status": "available"
  },
  "voucherCode": {
    "object": "voucherCode",
    "id": "voc_0SNlurA049MEWV0Q5vaTJnKoXc1v",
    "code": "BlackFriday22",
    "createdAt": "2021-02-14T19:38:34Z",
    "redemptions": 2,
    "restrictions": {
      "firstTimeTransaction": true,
      "minimumPrice": {
        "amount": 999,
        "currency": "USD"
      },
      "expiresAt": "2021-04-14T19:38:34Z"
    },
    "retiredReason": null,
    "status": "active",
    "voucher": "vou_0SNlurA049MEWV0h2jfjkdiOdplN"
  }
}

GET/projects/{project}/payments/{payment}

Retrieve a payment

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

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    payment
    Type
    string
    required
    Description

    The unique identifier for the payment.

    Example: pay_0SNlurA049MEWV2HRA0slWFuS8DV

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always payment.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the payment.

    Example: pay_0SNlurA049MEWV2HRA0slWFuS8DV
  • Name
    amount
    Type
    object
    required
    Description
    The total amount paid.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    attemptedAt
    Type
    string
    required
    Description

    Time when the payment was last attempted.

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

    Time when the payment was created.

    Example: 2021-02-14T19:38:34Z
  • Name
    discount
    Type
    object
    required
    Description
    The total discount applied to this payment.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    disputeClosedAt
    Type
    nullable string
    required
    Description

    Time when the payment dispute was closed. Otherwise null.

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

    The outcome of a payment dispute. Otherwise null.

    Allowed values: , lost, won
  • Name
    failedAttempts
    Type
    integer
    required
    Description

    The number of failed payment attempts so far.

    Example: 3
    >= 0
  • Name
    failureCode
    Type
    nullable string
    required
    Description

    An error code indicating the reason for the payment failure.

    Example: paymentCardDeclined
  • Name
    failureMessage
    Type
    nullable string
    required
    Description

    A human-readable message indicating the reason for the payment failure.

    Example: The card has been declined.
  • Name
    invoiceNumber
    Type
    string
    required
    Description

    The number of the invoice from the payment provider

    Example: B74BDB55-0555
  • Name
    method
    Type
    nullable object
    required
    Description
    The payment method describes how a payment can be made.
  • Name
    reason
    Type
    string
    required
    Description

    The reason for this payment.

    Allowed values: subscriptionCreation, subscriptionRenewal, other
  • Name
    receipt
    Type
    nullable string
    required
    Description

    The URL of a PDF receipt. The URL and the content it links to might change whenever the payment transitions to another state. The URL is signed, but care should be taken when sharing it, as it is publicly accessible.

    Example: https://files.gigs.com/receipts/pay_0SNlurA049MEWV2HRA0slWFuS8DV.pdf
  • Name
    references
    Type
    array
    required
    Description
    List of payment references. Supported reference types are `order` and `subscription`.
    • Name
      object
      Type
      string
      Description

      The type of the referenced object.

      Allowed values: order, subscription, subscriptionAddon
    • Name
      id
      Type
      string
      Description

      Unique identifier of the referenced object.

      Example: ord_0SNlurA049MEWV0SiRFOw0dmChqN
  • Name
    refunded
    Type
    object
    required
    Description
    The sum of all refunds related to this payment. Cannot be greater than the paid sum.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    refundedAt
    Type
    nullable string
    required
    Description

    Time when the payment was fully refunded. Otherwise null.

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

    The status of the payment. Can be succeeded, requiresConfirmation, failed, refunded or disputed.

    Allowed values: succeeded, requiresConfirmation, failed, refunded, disputed, requiresPaymentMethod
  • Name
    subtotal
    Type
    object
    required
    Description
    The total amount to be paid before any applied discounts.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    taxes
    Type
    array
    PREVIEW
    required
    Description
    List of taxes.
  • Name
    total
    Type
    object
    PREVIEW
    required
    Description
    The total amount paid.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    user
    Type
    object
    required
    Description
  • Name
    voucher
    Type
    nullable object
    required
    Description
    Voucher applied to the payment.
  • Name
    voucherCode
    Type
    nullable object
    required
    Description
    Voucher code applied to the payment.

Request

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

Response

{
  "object": "payment",
  "id": "pay_0SNlurA049MEWV2HRA0slWFuS8DV",
  "amount": {
    "amount": 990,
    "currency": "USD"
  },
  "attemptedAt": "2021-02-14T19:38:34Z",
  "createdAt": "2021-02-14T19:38:34Z",
  "discount": {
    "amount": 100,
    "currency": "USD"
  },
  "disputeClosedAt": "2021-02-14T19:38:34Z",
  "disputeOutcome": null,
  "failedAttempts": 3,
  "failureCode": "paymentCardDeclined",
  "failureMessage": "The card has been declined.",
  "invoiceNumber": "B74BDB55-0555",
  "method": {
    "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"
  },
  "reason": "subscriptionCreation",
  "receipt": "https://files.gigs.com/receipts/pay_0SNlurA049MEWV2HRA0slWFuS8DV.pdf",
  "references": [
    {
      "object": "order",
      "id": "ord_0SNlurA049MEWV0SiRFOw0dmChqN"
    }
  ],
  "refunded": {
    "amount": 0,
    "currency": "USD"
  },
  "refundedAt": "2021-02-14T19:38:34Z",
  "status": "succeeded",
  "subtotal": {
    "amount": 1000,
    "currency": "USD"
  },
  "taxes": [
    {
      "object": "tax",
      "inclusive": false,
      "name": "State Sales Tax",
      "value": {
        "amount": 90,
        "currency": "USD"
      }
    }
  ],
  "total": {
    "amount": 990,
    "currency": "USD"
  },
  "user": {
    "object": "user",
    "id": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
    "metadata": {},
    "birthday": "2017-07-21",
    "createdAt": "2021-01-21T19:38:34Z",
    "email": "jerry@example.com",
    "emailVerified": true,
    "fullName": "Jerry Seinfeld",
    "preferredLocale": "en-US"
  },
  "voucher": {
    "object": "voucher",
    "id": "vou_0SNlurA049MEWV0h2jfjkdiOdplN",
    "createdAt": "2021-02-14T19:38:34Z",
    "name": "Monthly Basic 15%",
    "priceDiscount": {
      "amount": 100,
      "currency": "USD"
    },
    "priceDiscountPercentage": null,
    "recurrence": {
      "type": "once",
      "durationInMonths": null
    },
    "redemptions": 2,
    "restrictions": {
      "expiresAt": "2021-04-14T19:38:34Z",
      "maximumRedemptions": null
    },
    "retiredReason": null,
    "status": "available"
  },
  "voucherCode": {
    "object": "voucherCode",
    "id": "voc_0SNlurA049MEWV0Q5vaTJnKoXc1v",
    "code": "BlackFriday22",
    "createdAt": "2021-02-14T19:38:34Z",
    "redemptions": 2,
    "restrictions": {
      "firstTimeTransaction": true,
      "maximumRedemptions": null,
      "minimumPrice": {
        "amount": 999,
        "currency": "USD"
      },
      "expiresAt": "2021-04-14T19:38:34Z"
    },
    "retiredReason": null,
    "status": "active",
    "voucher": "vou_0SNlurA049MEWV0h2jfjkdiOdplN"
  }
}

GET/projects/{project}/payments

List all payments

Returns a list of payments.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs

Query Parameters

  • Name
    invoiceNumber
    Type
    string
    Description

    The unique invoice number to be filtered by.

    Example: B74BDB55-0555
  • Name
    order
    Type
    string
    Description

    The unique identifier of the order to be filtered by.

    Example: ord_0SNlurA049MEWV0SiRFOw0dmChqN
  • Name
    reason
    Type
    array
    Description

    A comma-separated list of reasons to filter the payments by.

    Default: subscriptionCreation,subscriptionRenewal,other
  • Name
    status
    Type
    array
    Description

    A comma-separated list of statuses to filter the payments by.

    Default: succeeded,requiresConfirmation,failed,refunded,disputed,requiresPaymentMethod
  • Name
    subscription
    Type
    string
    Description

    The unique identifier of the subscription to be filtered by.

    Example: sub_0SNlurA049MEWV2gSfSxi00xlPIi
  • Name
    user
    Type
    string
    Description

    The unique identifier of the user to be filtered by.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • 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 `payment`.
  • 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}/payments
curl https://api.gigs.com/projects/{project}/payments \
-X GET \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"

Response

{
  "object": "list",
  "items": [
    {
      "object": "payment",
      "id": "pay_0SNlurA049MEWV2HRA0slWFuS8DV",
      "amount": {
        "amount": 990,
        "currency": "USD"
      },
      "attemptedAt": "2021-02-14T19:38:34Z",
      "createdAt": "2021-02-14T19:38:34Z",
      "discount": {
        "amount": 100,
        "currency": "USD"
      },
      "disputeClosedAt": "2021-02-14T19:38:34Z",
      "disputeOutcome": null,
      "failedAttempts": 3,
      "failureCode": "paymentCardDeclined",
      "failureMessage": "The card has been declined.",
      "invoiceNumber": "B74BDB55-0555",
      "method": {
        "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"
      },
      "reason": "subscriptionCreation",
      "receipt": "https://files.gigs.com/receipts/pay_0SNlurA049MEWV2HRA0slWFuS8DV.pdf",
      "references": [
        {
          "object": "order",
          "id": "ord_0SNlurA049MEWV0SiRFOw0dmChqN"
        }
      ],
      "refunded": {
        "amount": 0,
        "currency": "USD"
      },
      "refundedAt": "2021-02-14T19:38:34Z",
      "status": "succeeded",
      "subtotal": {
        "amount": 1000,
        "currency": "USD"
      },
      "taxes": [
        {
          "object": "tax",
          "inclusive": false,
          "name": "State Sales Tax",
          "value": {
            "amount": 90,
            "currency": "USD"
          }
        }
      ],
      "total": {
        "amount": 990,
        "currency": "USD"
      },
      "user": {
        "object": "user",
        "id": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
        "metadata": {},
        "birthday": "2017-07-21",
        "createdAt": "2021-01-21T19:38:34Z",
        "email": "jerry@example.com",
        "emailVerified": true,
        "fullName": "Jerry Seinfeld",
        "preferredLocale": "en-US"
      },
      "voucher": {
        "object": "voucher",
        "id": "vou_0SNlurA049MEWV0h2jfjkdiOdplN",
        "createdAt": "2021-02-14T19:38:34Z",
        "name": "Monthly Basic 15%",
        "priceDiscount": {
          "amount": 100,
          "currency": "USD"
        },
        "priceDiscountPercentage": null,
        "recurrence": {
          "type": "once",
          "durationInMonths": null
        },
        "redemptions": 2,
        "restrictions": {
          "expiresAt": "2021-04-14T19:38:34Z",
          "maximumRedemptions": null
        },
        "retiredReason": null,
        "status": "available"
      },
      "voucherCode": {
        "object": "voucherCode",
        "id": "voc_0SNlurA049MEWV0Q5vaTJnKoXc1v",
        "code": "BlackFriday22",
        "createdAt": "2021-02-14T19:38:34Z",
        "redemptions": 2,
        "restrictions": {
          "firstTimeTransaction": true,
          "maximumRedemptions": null,
          "minimumPrice": {
            "amount": 999,
            "currency": "USD"
          },
          "expiresAt": "2021-04-14T19:38:34Z"
        },
        "retiredReason": null,
        "status": "active",
        "voucher": "vou_0SNlurA049MEWV0h2jfjkdiOdplN"
      }
    }
  ],
  "moreItemsAfter": null,
  "moreItemsBefore": null
}

POST/projects/{project}/payments/{payment}/refund

Refund a payment

Issues a full or partial refund for a payment.

Body

  • Name
    amount
    Type
    integer
    Description

    The refund amount in the currency's minor unit, e.g. "cents" for many currencies. If this parameter is missing, a full refund is issued. If it is present, it must be a positive integer. Note that the refund amount cannot exceed the amount of the corresponding payment. The minimum amount is $0.50 US or equivalent in the refunded currency.

    Example: 999
    >= 1

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    payment
    Type
    string
    required
    Description

    The unique identifier for the payment.

    Example: pay_0SNlurA049MEWV2HRA0slWFuS8DV

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always payment.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the payment.

    Example: pay_0SNlurA049MEWV2HRA0slWFuS8DV
  • Name
    amount
    Type
    object
    required
    Description
    The total amount paid.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    attemptedAt
    Type
    string
    required
    Description

    Time when the payment was last attempted.

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

    Time when the payment was created.

    Example: 2021-02-14T19:38:34Z
  • Name
    discount
    Type
    object
    required
    Description
    The total discount applied to this payment.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    disputeClosedAt
    Type
    nullable string
    required
    Description

    Time when the payment dispute was closed. Otherwise null.

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

    The outcome of a payment dispute. Otherwise null.

    Allowed values: , lost, won
  • Name
    failedAttempts
    Type
    integer
    required
    Description

    The number of failed payment attempts so far.

    Example: 3
    >= 0
  • Name
    failureCode
    Type
    nullable string
    required
    Description

    An error code indicating the reason for the payment failure.

    Example: paymentCardDeclined
  • Name
    failureMessage
    Type
    nullable string
    required
    Description

    A human-readable message indicating the reason for the payment failure.

    Example: The card has been declined.
  • Name
    invoiceNumber
    Type
    string
    required
    Description

    The number of the invoice from the payment provider

    Example: B74BDB55-0555
  • Name
    method
    Type
    nullable object
    required
    Description
    The payment method describes how a payment can be made.
  • Name
    reason
    Type
    string
    required
    Description

    The reason for this payment.

    Allowed values: subscriptionCreation, subscriptionRenewal, other
  • Name
    receipt
    Type
    nullable string
    required
    Description

    The URL of a PDF receipt. The URL and the content it links to might change whenever the payment transitions to another state. The URL is signed, but care should be taken when sharing it, as it is publicly accessible.

    Example: https://files.gigs.com/receipts/pay_0SNlurA049MEWV2HRA0slWFuS8DV.pdf
  • Name
    references
    Type
    array
    required
    Description
    List of payment references. Supported reference types are `order` and `subscription`.
    • Name
      object
      Type
      string
      Description

      The type of the referenced object.

      Allowed values: order, subscription, subscriptionAddon
    • Name
      id
      Type
      string
      Description

      Unique identifier of the referenced object.

      Example: ord_0SNlurA049MEWV0SiRFOw0dmChqN
  • Name
    refunded
    Type
    object
    required
    Description
    The sum of all refunds related to this payment. Cannot be greater than the paid sum.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    refundedAt
    Type
    nullable string
    required
    Description

    Time when the payment was fully refunded. Otherwise null.

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

    The status of the payment. Can be succeeded, requiresConfirmation, failed, refunded or disputed.

    Allowed values: succeeded, requiresConfirmation, failed, refunded, disputed, requiresPaymentMethod
  • Name
    subtotal
    Type
    object
    required
    Description
    The total amount to be paid before any applied discounts.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    taxes
    Type
    array
    PREVIEW
    required
    Description
    List of taxes.
  • Name
    total
    Type
    object
    PREVIEW
    required
    Description
    The total amount paid.
    • Name
      amount
      Type
      integer
      required
      Description

      The price amount in the currency's minor unit, e.g. "cents" for many currencies.

      Example: 999
      >= 0
    • Name
      currency
      Type
      string
      required
      Description

      Three-letter ISO 4217 currency code. Must be a supported currency.

      Example: USD
  • Name
    user
    Type
    object
    required
    Description
  • Name
    voucher
    Type
    nullable object
    required
    Description
    Voucher applied to the payment.
  • Name
    voucherCode
    Type
    nullable object
    required
    Description
    Voucher code applied to the payment.

Request

POST
/projects/{project}/payments/{payment}/refund
curl https://api.gigs.com/projects/{project}/payments/{payment}/refund \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d "{\"amount\":999}"

Response

{
  "object": "payment",
  "id": "pay_0SNlurA049MEWV2HRA0slWFuS8DV",
  "amount": {
    "amount": 990,
    "currency": "USD"
  },
  "attemptedAt": "2021-02-14T19:38:34Z",
  "createdAt": "2021-02-14T19:38:34Z",
  "discount": {
    "amount": 100,
    "currency": "USD"
  },
  "disputeClosedAt": "2021-02-14T19:38:34Z",
  "disputeOutcome": null,
  "failedAttempts": 3,
  "failureCode": "paymentCardDeclined",
  "failureMessage": "The card has been declined.",
  "invoiceNumber": "B74BDB55-0555",
  "method": {
    "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"
  },
  "reason": "subscriptionCreation",
  "receipt": "https://files.gigs.com/receipts/pay_0SNlurA049MEWV2HRA0slWFuS8DV.pdf",
  "references": [
    {
      "object": "order",
      "id": "ord_0SNlurA049MEWV0SiRFOw0dmChqN"
    }
  ],
  "refunded": {
    "amount": 0,
    "currency": "USD"
  },
  "refundedAt": "2021-02-14T19:38:34Z",
  "status": "succeeded",
  "subtotal": {
    "amount": 1000,
    "currency": "USD"
  },
  "taxes": [
    {
      "object": "tax",
      "inclusive": false,
      "name": "State Sales Tax",
      "value": {
        "amount": 90,
        "currency": "USD"
      }
    }
  ],
  "total": {
    "amount": 990,
    "currency": "USD"
  },
  "user": {
    "object": "user",
    "id": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
    "metadata": {},
    "birthday": "2017-07-21",
    "createdAt": "2021-01-21T19:38:34Z",
    "email": "jerry@example.com",
    "emailVerified": true,
    "fullName": "Jerry Seinfeld",
    "preferredLocale": "en-US"
  },
  "voucher": {
    "object": "voucher",
    "id": "vou_0SNlurA049MEWV0h2jfjkdiOdplN",
    "createdAt": "2021-02-14T19:38:34Z",
    "name": "Monthly Basic 15%",
    "priceDiscount": {
      "amount": 100,
      "currency": "USD"
    },
    "priceDiscountPercentage": null,
    "recurrence": {
      "type": "once",
      "durationInMonths": null
    },
    "redemptions": 2,
    "restrictions": {
      "expiresAt": "2021-04-14T19:38:34Z",
      "maximumRedemptions": null
    },
    "retiredReason": null,
    "status": "available"
  },
  "voucherCode": {
    "object": "voucherCode",
    "id": "voc_0SNlurA049MEWV0Q5vaTJnKoXc1v",
    "code": "BlackFriday22",
    "createdAt": "2021-02-14T19:38:34Z",
    "redemptions": 2,
    "restrictions": {
      "firstTimeTransaction": true,
      "maximumRedemptions": null,
      "minimumPrice": {
        "amount": 999,
        "currency": "USD"
      },
      "expiresAt": "2021-04-14T19:38:34Z"
    },
    "retiredReason": null,
    "status": "active",
    "voucher": "vou_0SNlurA049MEWV0h2jfjkdiOdplN"
  }
}

GET/projects/{project}/payments/{payment}/secret

Retrieve a payment secret

Retrieves a payment secret.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    payment
    Type
    string
    required
    Description

    The unique identifier for the payment.

    Example: pay_0SNlurA049MEWV2HRA0slWFuS8DV

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always paymentSecret.

  • Name
    clientSecret
    Type
    string
    required
    Description

    A Stripe specific client secret to be used for payment intent confirmation.

    Example: pi_XXXXXXXXXXXXXXXXXXXXXXXX_secret_XXXXXXXXXXXXXXXXXXXXXXXXX

Request

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

Response

{
  "object": "paymentSecret",
  "clientSecret": "pi_XXXXXXXXXXXXXXXXXXXXXXXX_secret_XXXXXXXXXXXXXXXXXXXXXXXXX"
}